Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

mayorova
Copy link
Contributor

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:

# 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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capybara.current_driver = DEFAULT_JS_DRIVER
end

Before '@chrome' do
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines -16 to -22
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
Copy link
Contributor Author

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
Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link

codecov bot commented Nov 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.68%. Comparing base (48f32d6) to head (70c9544).
Report is 9 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@akostadinov akostadinov left a 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

@mayorova
Copy link
Contributor Author

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.

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

Successfully merging this pull request may close these issues.

3 participants