Skip to content

Use --headless=new for Chrome in Capybara#14426

Merged
cbliard merged 6 commits intorelease/13.1from
fix/use-headless-new-for-chrome-in-capybara
Dec 18, 2023
Merged

Use --headless=new for Chrome in Capybara#14426
cbliard merged 6 commits intorelease/13.1from
fix/use-headless-new-for-chrome-in-capybara

Conversation

@cbliard
Copy link
Member

@cbliard cbliard commented Dec 15, 2023

./modules/my_page/spec/features/my/my_spent_time_widget_with_a_negative_time_zone_spec.rb is failing with error undefined method execute_cdp' for #<Selenium::WebDriver::Chrome::Driver:0x..fe768862b9701efbc browser=:"chrome-headless-shell">`.

The --headless flag uses the old headless mode of Chrome. Since version 120, this version's name is "chrome-headless-shell". This name is not properly recognized in selenium-webdriver 4.16.0 and some extensions are not loaded, like the one allowing to use execute_cdp.

This will be fixed in next selenium-webdriver with this PR: SeleniumHQ/selenium#13271

In the meantime, using the new headless mode with --headless=new fixes the issue.

Edit: the --headless=new has been activated only for the one failing spec.

`./modules/my_page/spec/features/my/my_spent_time_widget_with_a_negative_time_zone_spec.rb`
is failing with error `undefined method `execute_cdp'
for #<Selenium::WebDriver::Chrome::Driver:0x..fe768862b9701efbc browser=:"chrome-headless-shell">`.

The `--headless` flag uses the old headless mode of Chrome. Since
version 120, this version's name is "chrome-headless-shell". This name
is not properly recognized in selenium-webdriver 4.16.0 and some
extensions are not loaded, like the one allowing to use execute_cdp.

This will be fixed in next selenium-webdriver with this PR: SeleniumHQ/selenium#13271

In the meantime, using the new headless mode with `--headless=new` fixes the issue.
@cbliard cbliard force-pushed the fix/use-headless-new-for-chrome-in-capybara branch from 4d96c3b to 06a58e0 Compare December 15, 2023 13:03
@cbliard cbliard changed the base branch from dev to release/13.1 December 15, 2023 13:03
This prevents spec/features/work_packages/details/markdown/todolist_spec.rb:157
from passing.
spec/features/wiki/attachment_upload_spec.rb:107 got broken when using
`--headless=true`: when resizing the image and scrolling on the handle,
it scrolled out of bound to align the handle to the top of the page,
instead of aligning with the top of the text area.

By scrolling and aligning on the center vertically, it stays visible and
the drag handle can be dragged and dropped.
It's hard to stabilize all tests with new headless
@cbliard cbliard force-pushed the fix/use-headless-new-for-chrome-in-capybara branch from e99fb22 to e086485 Compare December 18, 2023 09:01
@cbliard cbliard merged commit f440c9e into release/13.1 Dec 18, 2023
@cbliard cbliard deleted the fix/use-headless-new-for-chrome-in-capybara branch December 18, 2023 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant