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 #36978 - Add possibility to use remote webdriver #9952

Merged

Conversation

dosas
Copy link
Contributor

@dosas dosas commented Dec 13, 2023

In order to easily execute the selenium tests it would be good to have the possibility to use selenium remote webdriver images

docker run -d -p 4444:4444 --shm-size="2g" selenium/standalone-chrome:119.0

To access the driver via vagrant or a CI docker image the IP address needs to be set using an evironment variable:

SELENIUM_REMOTE_HOST=<ip_of_docker_host>
JS_TEST_DRIVER=selenium_chrome_remote

There are certain environments that require different chrome options to work so it is possible to add them via semicolon separated string as environment variable:

ADDITIONAL_CHROME_OPTIONS="--disable-dev-shm-usage"

@theforeman-bot
Copy link
Member

Can one of the admins verify this patch?

2 similar comments
@theforeman-bot
Copy link
Member

Can one of the admins verify this patch?

@theforeman-bot
Copy link
Member

Can one of the admins verify this patch?

@evgeni
Copy link
Member

evgeni commented Dec 14, 2023

ok to test

@evgeni
Copy link
Member

evgeni commented Dec 15, 2023

@MariaAga would you mind looking at this? Looks totally reasonable to me, but my knowledge around the integration tests is rather low.

@evgeni evgeni requested a review from MariaAga December 15, 2023 10:51
Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

I've opened #9962 which should provide a cleaner base for this PR.

test/integration_test_helper.rb Outdated Show resolved Hide resolved
test/integration_test_helper.rb Show resolved Hide resolved
test/integration_test_helper.rb Outdated Show resolved Hide resolved
test/test_helper.rb Outdated Show resolved Hide resolved
test/integration_test_helper.rb Outdated Show resolved Hide resolved
@dosas
Copy link
Contributor Author

dosas commented Dec 21, 2023

I have no idea why the labeler fails maybe someone can help?

@evgeni
Copy link
Member

evgeni commented Dec 21, 2023

I have no idea why the labeler fails maybe someone can help?

that's just broken, ignore it for now :)

@dosas dosas force-pushed the feature/remote-selenium-webdriver branch 2 times, most recently from 826ba53 to 40b0f2a Compare December 21, 2023 14:43
@dosas dosas force-pushed the feature/remote-selenium-webdriver branch 4 times, most recently from c369a67 to ac3b724 Compare January 15, 2024 13:56
Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

Some small nitpicks.

A bigger question here is how we're testing in GitHub Actions today and if this would actually be better. I don't know the current chromedriver & chrome are installed.

test/integration_test_helper.rb Outdated Show resolved Hide resolved
test/integration_test_helper.rb Outdated Show resolved Hide resolved
@dosas dosas force-pushed the feature/remote-selenium-webdriver branch from ac3b724 to d44b14f Compare January 18, 2024 07:57
@dosas dosas requested a review from ekohl January 18, 2024 08:28
@dosas dosas requested a review from ekohl January 18, 2024 14:23
@dosas dosas force-pushed the feature/remote-selenium-webdriver branch from 59b757a to f871fff Compare January 18, 2024 14:54
@stejskalleos stejskalleos self-assigned this Jan 30, 2024
@dosas dosas force-pushed the feature/remote-selenium-webdriver branch 2 times, most recently from bb361dc to 72a9c95 Compare January 30, 2024 15:34
@dosas
Copy link
Contributor Author

dosas commented Jan 31, 2024

Any news on this?

@stejskalleos stejskalleos removed their assignment Feb 13, 2024
@dosas
Copy link
Contributor Author

dosas commented Mar 12, 2024

@ekohl what do we need to do to get this forward?

@dosas
Copy link
Contributor Author

dosas commented Mar 21, 2024

ping

@dosas
Copy link
Contributor Author

dosas commented Apr 15, 2024

@ekohl Do you need any additional information on the answers from above?

@dosas dosas force-pushed the feature/remote-selenium-webdriver branch from 72a9c95 to faf5a31 Compare May 23, 2024 07:05
@dosas dosas force-pushed the feature/remote-selenium-webdriver branch from faf5a31 to 8577c35 Compare June 17, 2024 06:43
@dosas dosas force-pushed the feature/remote-selenium-webdriver branch from 8577c35 to 76f1da7 Compare June 27, 2024 14:28
ekohl
ekohl previously approved these changes Jun 27, 2024
test/integration_test_helper.rb Outdated Show resolved Hide resolved
test/integration_test_helper.rb Show resolved Hide resolved
test/integration_test_helper.rb Show resolved Hide resolved
@stejskalleos stejskalleos removed their request for review July 1, 2024 06:22
@dosas dosas force-pushed the feature/remote-selenium-webdriver branch from 76f1da7 to 62554a2 Compare July 16, 2024 09:15
@dosas dosas requested review from stejskalleos and ekohl July 16, 2024 09:17
@dosas dosas force-pushed the feature/remote-selenium-webdriver branch from 62554a2 to ba6bed9 Compare July 16, 2024 09:26
@sbernhard
Copy link
Contributor

Looks like, this does not work @dosas . Use the previous implementation?

PG::Coder.new(hash) is deprecated. Please use keyword arguments instead! Called from /home/runner/work/foreman/foreman/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7.8/lib/active_record/connection_adapters/postgresql_adapter.rb:883:innew'
rake aborted!
NoMethodError: undefined method `headless!' for #<Selenium::WebDriver::Chrome::Options:0x000055b424d96268 @options={:args=>["--window-size=1024,768"], :prefs=>{}, :emulation=>{}, :local_state=>{}, :exclude_switches=>[], :perf_logging_prefs=>{}, :window_types=>[], :browser_name=>"chrome"}, @Profile=nil, @logging_prefs={}, @encoded_extensions=[], @extensions=[]>

`

@dosas dosas force-pushed the feature/remote-selenium-webdriver branch from ba6bed9 to 6d3bc85 Compare July 16, 2024 10:23
@sbernhard
Copy link
Contributor

Failed tests are not related.

@sbernhard sbernhard merged commit 7ce3336 into theforeman:develop Jul 16, 2024
49 of 53 checks passed
@maximiliankolb maximiliankolb deleted the feature/remote-selenium-webdriver branch July 16, 2024 14:43
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.

7 participants