-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[rb] Add helper method to launch Chrome in headless mode. #5478
[rb] Add helper method to launch Chrome in headless mode. #5478
Conversation
This makes it consistent with Firefox::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.
hmmm... Python bindings awlays passes --disable-gpu
along with --headless
. https://github.com/SeleniumHQ/selenium/blob/master/py/selenium/webdriver/chrome/options.py#L161
Assuming I feel adding an extra flag (which the end user might not be aware of) might not be always desirable. See, puppeteer/puppeteer#1260 for instance. |
Let's add a condition for Windows add_argument '--headless'
# https://bugs.chromium.org/p/chromium/issues/detail?id=737678#c1
add_argument '--disable-gpu' if WebDriver::Platform.windows? |
subject.add_argument('foo') | ||
subject.add_argument('bar') | ||
|
||
expect(subject.args).to eq %w[foo bar] |
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 you're fixing up p0deje's request. can you wrap all your expectations in()
instead of space separation and change line 105 to it 'should not add the same argument more than once'
do
Due to a chromium issue (https://bugs.chromium.org/p/chromium/issues/detail?id=737678#c1), --disable-gpu flag needs to be set while running chrome headless on Windows.
90df96e
to
6166a5b
Compare
@p0deje, @luke-hill Pushed the changes. |
I've merged to master - thank you for PR! |
the Python bindings set |
I would guess it's up to the maintainers. It also depends on how the specs are written in python. @lmtierney You've got visibility of both bindings. What do you think. It does feel superfluous but I'm not a python expert. |
just to add some more confusion... have a look at https://bugs.chromium.org/p/chromium/issues/detail?id=737678 , which references:
so... should |
🤷♂️ |
Currently, Java and Javascript also include the |
Okay, so chromedriver's python client adds |
From what Alex said earlier. It seems easiest / most-agile to wait until 729961 is fixed and then so a Selenium-wide change to make all the bindings correct? |
This makes it consistent with Firefox::Options#headless! (Refer: #4762)
Though I agree with @jimevans to not add this API for a single command line argument, but adding this for consistency.
Another thread: #4591
X
in the preceding checkbox, I verify that I have signed the Contributor License Agreement