cuprite icon indicating copy to clipboard operation
cuprite copied to clipboard

Parallel specs

Open sebyx07 opened this issue 6 years ago • 2 comments

Here is my capyabra integration with parallel specs: it should work out of the box, maybe it's useful for others


test_env_number = ENV["TEST_ENV_NUMBER"].to_i

Capybara.server_port = 9887 + test_env_number

Capybara.register_driver :cuprite do |app|
  Capybara::Cuprite::Driver.new(
      app,
      browser_options: {
          'no-sandbox': nil,
          'disable-gpu': nil,
          'disable-dev-shm-usage': nil,
          'disable-infobars': nil,
          'disable-extensions': nil,
          'disable-popup-blocking': nil,
          'window-size': '1280,1024'
      },
      port: 9515 + test_env_number
  )
end

Capybara.default_driver = :cuprite

sebyx07 avatar Aug 30 '19 11:08 sebyx07

I guess if you shortly explain your setup we can add it to README, issues are for bugs :)

route avatar Aug 30 '19 11:08 route

Sure, this can be used, with or w/o parallel_specs. I'm using it with docker.

browser_options contains flags from a previous integration with chromedriver-helper.

Then you need to increment the ports of Capybara.server_port(rails process) and the browser. port: 9515 + test_env_number that's pretty much it.

I've made a similar issue some time ago to help others in need https://github.com/grosser/parallel_tests/issues/658

sebyx07 avatar Aug 30 '19 12:08 sebyx07