Sha256: df60ee8f975ea4fb1e0855d5326c2b8caf8c6d3ce0cb2a1c145f0bf5da5d1e85

Contents?: true

Size: 855 Bytes

Versions: 18

Compression:

Stored size: 855 Bytes

Contents

# A meta-driver that allows the driver to be set using the `INTEGRATION_DRIVER`
# environment variable (e.g. for a CI matrix), assuming that driver has been pre-registered
# with Capybara.

# Although the aim is to move to Chrome headless, we keep poltergeist as the default
# driver for now. For motivation behind not changing immediately, see the "Differences
# between Poltergeist and Selenium" section of:
#
#   https://about.gitlab.com/2017/12/19/moving-to-headless-chrome/
#
Capybara.register_driver(:switchable) do |app|
  choice = ENV.fetch('INTEGRATION_DRIVER', 'poltergeist').to_sym

  Capybara.drivers.fetch(choice).call(app)
end

Capybara::Screenshot.register_driver(:switchable) do |driver, path|
  choice = ENV.fetch('INTEGRATION_DRIVER', 'poltergeist').to_sym

  Capybara::Screenshot.registered_drivers.fetch(choice).call(driver, path)
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
ndr_dev_support-5.3.1 lib/ndr_dev_support/integration_testing/drivers/switchable.rb
ndr_dev_support-5.3.0 lib/ndr_dev_support/integration_testing/drivers/switchable.rb
ndr_dev_support-5.2.0 lib/ndr_dev_support/integration_testing/drivers/switchable.rb
ndr_dev_support-5.1.0 lib/ndr_dev_support/integration_testing/drivers/switchable.rb
ndr_dev_support-5.0.1 lib/ndr_dev_support/integration_testing/drivers/switchable.rb
ndr_dev_support-5.0.0 lib/ndr_dev_support/integration_testing/drivers/switchable.rb
ndr_dev_support-4.2.1 lib/ndr_dev_support/integration_testing/drivers/switchable.rb
ndr_dev_support-4.2.0 lib/ndr_dev_support/integration_testing/drivers/switchable.rb
ndr_dev_support-4.1.3 lib/ndr_dev_support/integration_testing/drivers/switchable.rb
ndr_dev_support-4.1.2 lib/ndr_dev_support/integration_testing/drivers/switchable.rb
ndr_dev_support-4.1.1 lib/ndr_dev_support/integration_testing/drivers/switchable.rb
ndr_dev_support-4.1.0 lib/ndr_dev_support/integration_testing/drivers/switchable.rb
ndr_dev_support-4.0.0 lib/ndr_dev_support/integration_testing/drivers/switchable.rb
ndr_dev_support-3.1.3 lib/ndr_dev_support/integration_testing/drivers/switchable.rb
ndr_dev_support-3.1.2 lib/ndr_dev_support/integration_testing/drivers/switchable.rb
ndr_dev_support-3.1.1 lib/ndr_dev_support/integration_testing/drivers/switchable.rb
ndr_dev_support-3.1.0 lib/ndr_dev_support/integration_testing/drivers/switchable.rb
ndr_dev_support-3.0.0 lib/ndr_dev_support/integration_testing/drivers/switchable.rb