Skip to content

ci(test): run Cypress E2E workflows in Chrome - #1266

Open
ale18V wants to merge 2 commits into
mainfrom
ci/cypress-use-chrome
Open

ale18V wants to merge 2 commits into
mainfrom
ci/cypress-use-chrome

Conversation

@ale18V

@ale18V ale18V commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Cypress is officially planning to deprecate its bundled Electron test browser:

In addition, Electron exhibits subtle behavioral and rendering divergences in headless Linux environments (e.g. forced --disable-gpu and software fallback quirks).

This PR:

  1. Updates the GitHub Actions CI workflows to explicitly execute Cypress test jobs in Google Chrome (browser: chrome).
  2. Adds support for selecting the Cypress browser via the DISCO_E2E_BROWSER environment variable (e.g. DISCO_E2E_BROWSER=firefox, chrome, edge).
  3. Documents browser selection for E2E tests in docs/CONTRIBUTING.md.

@ale18V

ale18V commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator Author

As a side note: the cypress action GH action documentation states that the defaultBrowser of the cypress config is used if none is specified in the action parameters. And if that is undefined then electron is used (which is the case RN).

@JulienVig two points:

  1. I didn't set an explicit fallback in the defaultBrowser - it's only set by the env variable right now. I didn't want to hardcode chrome or firefox as it depends on which browser the developer is used to on their system. Do we want to have a default browser such as chrome same for everyone when the env var is not set?
  2. Even if we set the defaultBrowser I think it's better to be explicit and still set the browser in the action params which is what this PR does.

@JulienVig JulienVig left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

All good thanks! Being explicit on the CI browser sounds fine to me. However I think we should set a fallback browser.

Comment thread docs/CONTRIBUTING.md

In CI, Cypress workflows run in Google Chrome (`browser: chrome`).

When running end-to-end training tests locally, you can select which browser to run with using the `DISCO_E2E_BROWSER` environment variable (e.g. `chrome`, `firefox`, `edge`):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The env var sets the browser for every webapp tests, not just end-to-end training no? If so this subsection doesn't need to be nested in "Training end-to-end tests"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
When running end-to-end training tests locally, you can select which browser to run with using the `DISCO_E2E_BROWSER` environment variable (e.g. `chrome`, `firefox`, `edge`):
When running end-to-end training tests locally, you can choose the browser with the `DISCO_E2E_BROWSER` environment variable (e.g. `chrome`, `firefox`, `edge`):

Comment thread webapp/cypress.config.ts
);

export default defineConfig({
defaultBrowser: process.env.DISCO_E2E_BROWSER,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

regarding your comment on a fallback browser I think we should set one (I guess chrome is more likely to already be installed) and if contributors want to use a different one they can just use the env var

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This would also ensure that new tests still run on chrome in the CI if we forget to specify the browser in the yaml file

with: { name: all-builds }
- uses: cypress-io/github-action@v7
with:
browser: chrome

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can you look into chrome-for-testing (doc)? mabe this would be a good option for the CI

Comment thread docs/CONTRIBUTING.md
DISCO_E2E_BROWSER=chrome pnpm -F webapp run test:e2e:local
```

On Linux, running image tasks (such as LUS COVID) with real browsers like Chrome or Firefox is recommended over headless Electron to leverage hardware WebGL acceleration and avoid CPU software fallback stalls.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think we can remove any mention of Electron since it is deprecated and will be removed, especially if we set a default fallback browser

This branch has not been deployed

No deployments
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.

2 participants