Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
SystemTesting::Driver can register capybara-webkit and poltergeist #29315
This PR is related to issue #29000
Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @pixeltrix (or someone else) soon.
If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.
This repository is being automatically checked for code quality issues using Code Climate. You can see results for this analysis in the PR status below. Newly introduced issues should be fixed before a Pull Request is considered ready to review.
Please see the contribution instructions for more information.
Looking good so far!
Jun 2, 2017
added a commit
this pull request
Jun 2, 2017
referenced this pull request
Jun 2, 2017
Apologies if this is the wrong place to raise this issue, but it's directly caused by this pull request.
Ruby version 2.4.1
The changes made in this commit to actionpack/lib/action_dispatch/system_testing/driver.rb break the ability to register Capybara drivers not named
For instance, the code below sets up headless_chrome as a system test driver:
This causes a nil error in
Super hacky fix is to monkey patch register:
# test/application_system_test_case.rb require 'test_helper' require 'capybara' # require 'capybara/poltergeist' ENV['RAILS_SYSTEM_TESTING_SCREENSHOT'] = 'simple' ActionDispatch::SystemTestCase.driver class ActionDispatch::SystemTesting::Driver # :nodoc: def register return unless [:selenium, :poltergeist, :webkit].include?(@name) Capybara.register_driver @name do |app| case @name when :selenium then register_selenium(app) when :poltergeist then register_poltergeist(app) when :webkit then register_webkit(app) end end end end class ApplicationSystemTestCase < ActionDispatch::SystemTestCase ...
This is obviously not the way to go about things. I'm not sure modifying
Possibly a solution involves some sort of polymorphism, with a fallback that does nothing when the user manually registered the capybara driver they want to use?
Again, apologies if this is the wrong place for this comment.