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

🚧🥒 Reduce Capybara / Cucumber config #3911

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

Conversation

josemigallas
Copy link
Contributor

The capybara configuration has grown a lot recently and I believe we're building on top of an outdated setup. Capybara/Selenium offers default features that we can use.

@josemigallas josemigallas self-assigned this Oct 9, 2024
end
# Before '@javascript' do
# Capybara.current_driver = DEFAULT_JS_DRIVER
# end

Before '@chrome' do
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe

Suggested change
Before '@chrome' do
Before '@foreground' do


# 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
Capybara.current_driver = DEFAULT_JS_DRIVER
end
Copy link
Contributor

Choose a reason for hiding this comment

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

I remember this @javascript tag was heavily patched by us. I had some updates to upstream capybara/cucumber but IIRC it required Ruby 3. So I can check about this now we have Ruby 3.1 merged.

@josemigallas josemigallas force-pushed the simple_capybara_config branch 6 times, most recently from a930d27 to e185ba4 Compare October 10, 2024 13:45
@@ -91,7 +91,7 @@ attach-to-workspace: &attach-to-workspace
at: .

system-builder-ruby31: &system-builder-ruby31
image: quay.io/3scale/system-builder:stream8-ruby3.1
image: quay.io/3scale/system-builder:stream8-ruby3.1-chrome126
Copy link
Contributor

Choose a reason for hiding this comment

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

127+ didn't work with --disable-gpu? That's worrying.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes it does. I was trying to fix current Circleci failures by downgrading chromedriver, with no success.

Capybara.current_driver = DEFAULT_JS_DRIVER
end
Capybara.javascript_driver = :headless_chrome
Capybara.match = :prefer_exact # TODO: this is Capybara v1 default, we should use :one or :smart
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not change it to :one or :smart directly?

options.add_argument('--host-resolver-rules=MAP * ~NOTFOUND , EXCLUDE *localhost*')
options.add_argument('--disable-search-engine-choice-screen')
Copy link
Contributor

Choose a reason for hiding this comment

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

Not needed anymore?

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