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

fix: pass all chromium flags through to Electron #29443

Merged
merged 11 commits into from May 2, 2024

Conversation

jennifer-shehane
Copy link
Member

@jennifer-shehane jennifer-shehane commented Apr 30, 2024

Additional details

This issue highlighted that there are some differences in how Electron's Chromium browser runs vs Chrome's browser due to the same Chrome flags/switches not all being passed to Electron.

You can see in many cases where we fixed a bug by passing a new Chrome flag, then later had to followup to fix another bug in Electron with the same flag.

We should send the same flags to Electron as we do Chrome.

Steps to test

  • I added some unit tests around the formatting of the flags.
  • I added a specific test to ensure that the navigator.webdriver is true (there is a bug with Webkit honoring this logged here) This test indirectly tests that there is an --enable-automation flag being passed to Electron, Chrome, and Firefox. So it's not a pure test to ensure our flags are being passed correctly.

How has the user experience changed?

This should resolve some situations where there's a difference in behavior between the 2 browsers. This may fix some bugs for people in Electron, but it might also introduce 'unwanted' changes in behavior (such as the original navigator.webdriver behavior changing which could cause user's applications to no longer load in Electron - although this is the correct behavior)

PR Tasks

Copy link

cypress bot commented Apr 30, 2024

2 flaky tests on run #55292 ↗︎

0 5544 77 0 Flakiness 2

Details:

lint fix
Project: cypress Commit: 4ad362011e
Status: Passed Duration: 17:11 💡
Started: May 2, 2024 3:22 PM Ended: May 2, 2024 3:39 PM
Flakiness  waiting.cy.js • 1 flaky test • 5x-driver-chrome

View Output

Test Artifacts
... > errors > throws when waiting for response to route Test Replay
Flakiness  files.cy.js • 1 flaky test • 5x-driver-chrome

View Output

Test Artifacts
... > passes through assertion error when not about existence Test Replay

Review all test suite changes for PR #29443 ↗︎

@AtofStryker AtofStryker self-requested a review May 1, 2024 17:13
Copy link
Contributor

@mschile mschile left a comment

Choose a reason for hiding this comment

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

Added a couple comments.

jennifer-shehane and others added 2 commits May 1, 2024 13:24
Co-authored-by: Matt Schile <mschile@cypress.io>
Yes 😝 Probably why a better test would be good around this.

Co-authored-by: Matt Schile <mschile@cypress.io>
@jennifer-shehane jennifer-shehane merged commit 0e3dfd1 into develop May 2, 2024
80 of 82 checks passed
@jennifer-shehane jennifer-shehane deleted the chromium-flags-to-electron branch May 2, 2024 15:38
jj497 pushed a commit to jj497/cypress that referenced this pull request May 5, 2024
* fix: pass all chromium flags through to Electron

* Add changelog entry

* exclude webkit from test for navigator.webdriver being true

* add debug log for switches in electron

* Fix the unit test so it passes now

* Update packages/server/lib/environment.js

Co-authored-by: Matt Schile <mschile@cypress.io>

* Update packages/server/lib/environment.js

Yes 😝 Probably why a better test would be good around this.

Co-authored-by: Matt Schile <mschile@cypress.io>

* Update packages/server/test/unit/util/chromium_flags_spec.js

Co-authored-by: Bill Glesias <bglesias@gmail.com>

* lint fix

---------

Co-authored-by: Matt Schile <mschile@cypress.io>
Co-authored-by: Bill Glesias <bglesias@gmail.com>
@cypress-bot
Copy link
Contributor

cypress-bot bot commented May 8, 2024

Released in 13.9.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v13.9.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators May 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Works in Electron but hangs when using Chrome and Firefox
3 participants