Skip to content
This repository has been archived by the owner on Mar 18, 2021. It is now read-only.

v0.4.x is breaking capybara tests that use selenium-webdriver #27

Open
maeve opened this issue Feb 17, 2015 · 1 comment
Open

v0.4.x is breaking capybara tests that use selenium-webdriver #27

maeve opened this issue Feb 17, 2015 · 1 comment

Comments

@maeve
Copy link
Contributor

maeve commented Feb 17, 2015

It appears that upgrading the gem to v0.4.x breaks selenium-webdriver horribly. G5 has several apps that use selenium (with firefox) as the capybara javascript driver. When upgrading g5_authenticatable in these apps, we are seeing every selenium test error out with the message:

An error occurred in an after hook
    Selenium::WebDriver::Error::WebDriverError: unable to obtain stable firefox connection in 60 seconds (127.0.0.1:7055)
    occurred at /home/travis/build/G5/g5-content-management-system/vendor/bundle/ruby/2.2.0/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/firefox/launcher.rb:79:in `connect_until_stable'

In order to see this issue in action, check out G5/g5-content-management-system#568 and run rspec -t integration. This error happens consistently on both the CI server and in my local g5-orion-vagrant environment, even though the tests pass successfully on the master branch. The only difference between the passing and failing builds is that g5_authenticatable was upgraded from v0.3.0 to v0.4.2.

When running the tests in the vagrant environment, I can see that firefox is being successfully launched, but the selenium webdriver extension is not being installed in the browser, so selenium never attempts to make any requests to the test server, and the test eventually times out. See browser console logs demonstrating a case where the extension failed to load vs a case (with an older version of g5_authenticatable) where the extension loaded successfully.

This may be related to this selenium issue, which describes similar behavior that appears to still be plaguing the latest version of selenium-webdriver, even though it was supposedly fixed. However, I have not been able to determine what it is about g5_authenticatable that is triggering this behavior.

FWIW, the g5-orion-vagrant project installs Firefox 35, which is not officially supported by selenium-webdriver v2.44 (even though the tests do pass with older versions of g5_authenticatable). However, the CI environment uses Firefox 31.0esr, which is officially supported. The behavior on both versions of firefox is the same.

@maeve maeve added the bug label Feb 17, 2015
@maeve
Copy link
Contributor Author

maeve commented Mar 13, 2015

I've verified that the error is occurring outside the scope of the ruby code, when the firefox binary is loading the selenium-webdriver firefox extension. I suspect that g5_authenticatable merely happens to expose an existing bug in selenium webdriver, probably due to a timing issue (but who knows). Debugging this further is not worth the effort.

For now, the plan is to document the incompatibility between the test helpers and selenium-webdriver with Firefox, with a recommendation to use the poltergeist driver with PhantomJS instead. It's also possible (even likely) that the auth test helpers could be used with selenium-webdriver with a different browser, such as Chrome. However, TravisCI only supports Firefox and PhantomJS out of the box; requiring an integration with Sauce Labs for any other browser.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant