From 6ae4a1a17f7b6d5f0467cc8d68ec354df38c2015 Mon Sep 17 00:00:00 2001 From: ale18V Date: Tue, 20 Oct 2026 22:00:28 +0200 Subject: [PATCH 1/3] ci(test): run Cypress E2E workflows in Chrome --- .github/workflows/_test.yml | 4 ++++ .github/workflows/record-cypress.yml | 1 + 2 files changed, 5 insertions(+) diff --git a/.github/workflows/_test.yml b/.github/workflows/_test.yml index 406d47ef4..e16375e53 100644 --- a/.github/workflows/_test.yml +++ b/.github/workflows/_test.yml @@ -63,6 +63,7 @@ jobs: with: { name: all-builds } - uses: cypress-io/github-action@v7 with: + browser: chrome working-directory: webapp install: false start: pnpm exec vite --mode test --port 1351 @@ -85,6 +86,7 @@ jobs: env: DISCO_TRAINING_E2E: "1" with: + browser: chrome working-directory: webapp install: false start: pnpm exec vite --mode test --port 1351 @@ -111,6 +113,7 @@ jobs: DISCO_SCRIPTED_SERVER_E2E: "1" VITE_SERVER_URL: http://server:8080 with: + browser: chrome working-directory: webapp install: false start: pnpm exec vite --mode test --port 1351 @@ -142,6 +145,7 @@ jobs: DISCO_TRAINING_E2E: "1" DISCO_E2E_FEDERATED_TASK: ${{ matrix.task }} with: + browser: chrome working-directory: webapp install: false start: >- diff --git a/.github/workflows/record-cypress.yml b/.github/workflows/record-cypress.yml index f737d29e8..248b12bf4 100644 --- a/.github/workflows/record-cypress.yml +++ b/.github/workflows/record-cypress.yml @@ -23,6 +23,7 @@ jobs: - run: pnpm -F webapp run test:unit - uses: cypress-io/github-action@v7 with: + browser: chrome working-directory: webapp install: false start: pnpm start From f6a113af77192f68c42f3bf0502893ae3b0abd02 Mon Sep 17 00:00:00 2001 From: ale18V Date: Wed, 21 Oct 2026 00:04:21 +0200 Subject: [PATCH 2/3] feat(webapp): support selecting Cypress browser via DISCO_E2E_BROWSER --- docs/CONTRIBUTING.md | 13 +++++++++++++ webapp/cypress.config.ts | 2 ++ 2 files changed, 15 insertions(+) diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 9fb2d2be2..016c4d569 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -129,6 +129,19 @@ Federated training tests run in separate CI jobs for Titanic and LUS COVID. Each job starts a real server and a Node participant configured for its task; see `test-e2e-federated` in `.github/workflows/_test.yml` for the setup. +##### Running with a specific browser + +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`): + +```sh +DISCO_E2E_BROWSER=firefox pnpm -F webapp run test:e2e:local +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. + #### Cypress and Github Actions It is possible to record the cypress tests ran in the Github Actions CI and visualize them in the [Cypress Cloud](cloud.cypress.io). It is currently used only when needed (because the free plan has a limited number of recordings). The [cypress documentation](https://docs.cypress.io/app/continuous-integration/github-actions) describes how to set up the recordings. diff --git a/webapp/cypress.config.ts b/webapp/cypress.config.ts index 738464585..0f4593bf7 100644 --- a/webapp/cypress.config.ts +++ b/webapp/cypress.config.ts @@ -51,6 +51,8 @@ if ( ); export default defineConfig({ + defaultBrowser: process.env.DISCO_E2E_BROWSER, + // Cypress.env() is deprecated throw; use cy.env() for sensitive values // and Cypress.expose() otherwise // allowCypressEnv will be removed in v16.0 so delete this line at that point From 3ec34fc620f03836f0e259bb65d9560d1a4e6bec Mon Sep 17 00:00:00 2001 From: ale18V Date: Wed, 28 Oct 2026 09:54:19 +0100 Subject: [PATCH 3/3] feat(webapp): default to chrome, log exact browser version, and refine docs --- docs/CONTRIBUTING.md | 28 +++++++++++++--------------- webapp/cypress.config.ts | 8 +++++++- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 016c4d569..cffed113f 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -104,13 +104,24 @@ pnpm -F webapp test The webapp tests rely on `cypress` and the test suite is located in the `webapp/cypress` folder. -Note that you can also run test interactively in the browser of your choice. To do so, run from the `webapp` folder +#### Running with a specific browser +In CI, Cypress workflows run in Google Chrome (`browser: chrome`). + +Cypress defaults to Google Chrome for headless tests. When running tests locally, you can choose the browser with the `DISCO_E2E_BROWSER` environment variable (e.g. `chrome`, `firefox`, `edge`): + +```sh +DISCO_E2E_BROWSER=firefox pnpm -F webapp test +DISCO_E2E_BROWSER=firefox pnpm -F webapp run test:e2e:local ``` + +Note that you can also run tests interactively in the browser of your choice. To do so, run from the `webapp` folder: + +```sh pnpm run test:e2e-interactive ``` -which should open the Cypress UI and let you choose the browser you wand to use and which tests to run. More information on [the Cypress docs](https://docs.cypress.io/app/get-started/open-the-app). +which should open the Cypress UI and let you choose the browser you want to use and which tests to run. More information on [the Cypress docs](https://docs.cypress.io/app/get-started/open-the-app). #### Training end-to-end tests @@ -129,19 +140,6 @@ Federated training tests run in separate CI jobs for Titanic and LUS COVID. Each job starts a real server and a Node participant configured for its task; see `test-e2e-federated` in `.github/workflows/_test.yml` for the setup. -##### Running with a specific browser - -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`): - -```sh -DISCO_E2E_BROWSER=firefox pnpm -F webapp run test:e2e:local -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. - #### Cypress and Github Actions It is possible to record the cypress tests ran in the Github Actions CI and visualize them in the [Cypress Cloud](cloud.cypress.io). It is currently used only when needed (because the free plan has a limited number of recordings). The [cypress documentation](https://docs.cypress.io/app/continuous-integration/github-actions) describes how to set up the recordings. diff --git a/webapp/cypress.config.ts b/webapp/cypress.config.ts index 0f4593bf7..64b58e68e 100644 --- a/webapp/cypress.config.ts +++ b/webapp/cypress.config.ts @@ -51,7 +51,7 @@ if ( ); export default defineConfig({ - defaultBrowser: process.env.DISCO_E2E_BROWSER, + defaultBrowser: process.env.DISCO_E2E_BROWSER ?? "chrome", // Cypress.env() is deprecated throw; use cy.env() for sensitive values // and Cypress.expose() otherwise @@ -76,6 +76,12 @@ export default defineConfig({ ...(scriptedServer ? [] : ["cypress/e2e/training/scripted/**/*.cy.ts"]), ], setupNodeEvents(on) { + on("before:browser:launch", (browser) => { + console.log( + `Running on ${browser.displayName} ${browser.version} (${browser.path})`, + ); + }); + // Creates a scripted server const scriptServer = scriptedServer ? serveWebSockets(Number(serverUrl.port))