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

Fixes #36997 - Use selenium_chrome_headless for integration tests #9962

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

Conversation

ekohl
Copy link
Member

@ekohl ekohl commented Dec 19, 2023

Currently we configure selenium_chrome to be headless, unless some parameter is given. It's better to use selenium_chrome_headless instead and have users select the selenium_chrome driver if they need to debug it.

See https://github.com/teamcapybara/capybara#selenium for the built in ones.

The inspiration for this was #9952.

Currently we configure selenium_chrome to be headless, unless some
parameter is given. It's better to use selenium_chrome_headless instead
and have users select the selenium_chrome driver if they need to debug
it.

See https://github.com/teamcapybara/capybara#selenium for the built in
ones.
Capybara.configure do |config|
config.javascript_driver = ENV["JS_TEST_DRIVER"]&.to_sym || :selenium_chrome
config.javascript_driver = ENV.fetch("JS_TEST_DRIVER") { ENV['DEBUG_JS_TEST'] ? :selenium_chrome : :selenium_chrome_headless }.to_sym
Copy link
Contributor

@dosas dosas Dec 20, 2023

Choose a reason for hiding this comment

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

We should probably also adapt this line https://github.com/theforeman/foreman/blob/develop/test/integration_test_helper.rb#L302

When not set to the correct JS_TEST_DRIVER (:selnium_chorme, :selenium_chrome_headless, :selenium_chrome_remote) it throws the following error:

ShowMeTheCookies::SeleniumSiteNotVisitedError: Can't set a cookie on about:blank. Visit a url in your app first.
    test/integration_test_helper.rb:330:in `set_request_user'
    test/integration_test_helper.rb:321:in `login_admin'
    test/test_helper.rb:73:in `before_setup'
    test/integration_test_helper.rb:348:in `before_setup'

Maybe the if clause in L302 can even be removed?

@dosas
Copy link
Contributor

dosas commented Jan 10, 2024

Any news on this?

@dosas
Copy link
Contributor

dosas commented Feb 22, 2024

Changes implemented here #9952 can be closed with sufficient rights

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