-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove redundant configs for Capybara #3947
base: master
Are you sure you want to change the base?
Conversation
# Needed because cucumber-rails requires capybara/cucumber | ||
# https://github.com/cucumber/cucumber-rails/blob/7b47bf1dda3368247bf2d45bcb17a224e80ec6fd/lib/cucumber/rails/capybara.rb#L3 | ||
# https://github.com/teamcapybara/capybara/blob/2.18.0/lib/capybara/cucumber.rb#L17-L19 | ||
Before '@javascript' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This effectively was doing the same as https://github.com/teamcapybara/capybara/blob/3.40.0/lib/capybara/cucumber.rb#L18-L20
Capybara.current_driver = DEFAULT_JS_DRIVER | ||
end | ||
|
||
Before '@chrome' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Capybara.default_driver = :rack_test | ||
Capybara.javascript_driver = DEFAULT_JS_DRIVER | ||
Capybara.default_selector = :css | ||
Capybara.disable_animation = true | ||
|
||
# Capybara 3 changes the default server to Puma. It can be reverted to the previous default of WEBRick by specifying: | ||
Capybara.server = :webrick |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it doesn't make sense to set the same configs both here, and then inside the Capybara.configure
block. They seem to have the same effect.
Capybara.current_driver = :firefox | ||
# Capybara 3 changes the default server to Puma. It can be reverted to the previous default of WEBRick by specifying: | ||
config.server = :webrick | ||
config.disable_animation = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This disable_animation
is the only one that is not documented here: https://rubydoc.info/github/jnicklas/capybara/Capybara#configure-class_method
But the tests pass, so either it works fine, or this setting is irrelevant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case I would remove it and see if the tests pass. The more we can cleanup the better.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3947 +/- ##
==========================================
- Coverage 93.82% 93.68% -0.14%
==========================================
Files 2996 2987 -9
Lines 96764 95268 -1496
Branches 627 627
==========================================
- Hits 90789 89253 -1536
- Misses 5951 5991 +40
Partials 24 24 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks nice! good to check if there are useful ideas also in #3911
Oh wow! I missed that one completely 🤦 Thanks, I'll take a look. |
What this PR does / why we need it:
There are some configs for Capybara that I believe are not needed - see comments inline.
Which issue(s) this PR fixes
Verification steps
Make sure all tests works :)
Special notes for your reviewer: