Sha256: 30527246d1e06e67c29195c0f5b8cea1df7618a3ad064026b28c7b96140da657

Contents?: true

Size: 1.36 KB

Versions: 3

Compression:

Stored size: 1.36 KB

Contents

# Set up basic capybara:
require 'capybara/rails'
ActionDispatch::IntegrationTest.include(Capybara::DSL)

# Set up basic screenshotting capability:
#
# TODO: Once Rails 5.1 is the minimum version we support, we should be able to
#       use the built-in behaviour that Rails adds to after_teardown.
#
require 'capybara-screenshot'
if defined?(Minitest)
  require 'capybara-screenshot/minitest'
  ActionDispatch::IntegrationTest.include(Capybara::Screenshot::MiniTestPlugin)
else
  require 'capybara-screenshot/testunit'
end

# Include our custom DSL extensions, that also cover screenshotting:
require 'ndr_dev_support/integration_testing/dsl'

# Include support for retrying tests that sporadically fail:
require 'ndr_dev_support/integration_testing/flakey_tests'

# These are all the drivers we have capybara / screenshot support for:
require 'ndr_dev_support/integration_testing/drivers/chrome'
require 'ndr_dev_support/integration_testing/drivers/chrome_headless'
require 'ndr_dev_support/integration_testing/drivers/firefox'
require 'ndr_dev_support/integration_testing/drivers/switchable'

Capybara.default_driver    = :switchable
Capybara.javascript_driver = :switchable

# Inject middleware to disable jQuery fx, CSS transitions/animations
Capybara.disable_animation = true

Capybara.save_path = Rails.root.join('tmp', 'screenshots')
Capybara::Screenshot.prune_strategy = { keep: 20 }

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ndr_dev_support-7.2.3 lib/ndr_dev_support/integration_testing.rb
ndr_dev_support-7.2.2 lib/ndr_dev_support/integration_testing.rb
ndr_dev_support-7.2.1 lib/ndr_dev_support/integration_testing.rb