-
Notifications
You must be signed in to change notification settings - Fork 983
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
base: develop
Are you sure you want to change the base?
Fixes #36978 - Add possibility to use remote webdriver #9952
Conversation
Can one of the admins verify this patch? |
2 similar comments
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
ok to test |
@MariaAga would you mind looking at this? Looks totally reasonable to me, but my knowledge around the integration tests is rather low. |
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've opened #9962 which should provide a cleaner base for this PR.
9529ef0
to
f89c5ac
Compare
I have no idea why the labeler fails maybe someone can help? |
that's just broken, ignore it for now :) |
826ba53
to
40b0f2a
Compare
c369a67
to
ac3b724
Compare
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.
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.
ac3b724
to
d44b14f
Compare
d44b14f
to
59b757a
Compare
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 is just me reading the code. I hope to find some time to actually play around with this myself.
59b757a
to
f871fff
Compare
bb361dc
to
72a9c95
Compare
Any news on this? |
@ekohl what do we need to do to get this forward? |
ping |
@ekohl Do you need any additional information on the answers from above? |
72a9c95
to
faf5a31
Compare
faf5a31
to
8577c35
Compare
8577c35
to
76f1da7
Compare
def work_around_selenium_file_detector_bug | ||
# see: https://stackoverflow.com/questions/70441796/selenium-webdriver-for-aws-device-farm-error-when-sending-period-keystroke-t |
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.
If I'm really pedantic I'd suggest yardoc tags (which we don't use enough in our codebase).
def work_around_selenium_file_detector_bug | |
# see: https://stackoverflow.com/questions/70441796/selenium-webdriver-for-aws-device-farm-error-when-sending-period-keystroke-t | |
# @see https://stackoverflow.com/questions/70441796/selenium-webdriver-for-aws-device-farm-error-when-sending-period-keystroke-t | |
def work_around_selenium_file_detector_bug |
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 will change that but shouldn't we add a rubocop for it then and if the community decides that this is a valid cop we can do it like that?
elsif javascript_driver == :selenium_chrome_headless | ||
options = chrome_options | ||
options.args << '--headless' | ||
Capybara.register_driver :selenium_chrome_headless do |app| | ||
Capybara::Selenium::Driver.new( | ||
app, | ||
browser: :chrome, | ||
options: options) | ||
end |
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.
Why is this needed? This should be available by default:
https://github.com/teamcapybara/capybara/blob/0480f90168a40780d1398c75031a255c1819dce8/lib/capybara/registrations/drivers.rb#L31-L42
I had hoped to utilize this if possible. Given we don't set the window size elsewhere, I'd be tempted to drop chrome_options
. I'm not sure anyone actually uses ADDITIONAL_CHROME_OPTIONS
anyway.
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.
As far as I remember (I touched this code 5 months ago) but the window size was required. Although the discussion if that is needed is IMO out of scope for this PR (can be done in follow up PR)
I'm requiring ADDITIONAL_CHROME_OPTIONS
downstream. This will make it more easily configurable.
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 its a good idea to be able to set additonal options which can be used. They are optional. So, if you don't need them, don't set the option and it doesn't hurt.
end | ||
elsif javascript_driver == :selenium_chrome_headless | ||
options = chrome_options | ||
options.args << '--headless' |
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.
If we keep this, there's also a dedicated API:
options.args << '--headless' | |
options.headless! |
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 don't understand, can you please explain in more detail?
In order to easily execute the selenium tests it would be good to have the possibility to use selenium remote webdriver images
To access the driver via vagrant or a CI docker image the IP address needs to be set using an evironment variable:
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: