Skip to content

Commit 2d90c48

Browse files
committed
ci: test frontend in multiple browsers
Get the playwright browser from the `VITE_BROWSER` environment variable, defaulting to `chromium`. Run the CI tests in chromium, firefox, and webkit.
1 parent 0e96018 commit 2d90c48

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

.github/workflows/frontend-test.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ jobs:
1515
# Make sure to grab the latest version of the Playwright image
1616
# https://playwright.dev/docs/docker#pull-the-image
1717
image: mcr.microsoft.com/playwright:v1.54.0-noble
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
browser: [chromium, firefox, webkit]
1822
defaults:
1923
run:
2024
working-directory: ./frontend-v2
@@ -33,3 +37,6 @@ jobs:
3337

3438
- name: Run tests
3539
run: yarn test-storybook
40+
env:
41+
VITE_BROWSER: ${{ matrix.browser }}
42+
HOME: /root

frontend-v2/vite.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const proxy = {
3333

3434
// https://vitejs.dev/config/
3535
export default ({ mode }) => {
36-
const { VITE_APP_GA_ID } = loadEnv(mode, process.cwd());
36+
const { VITE_APP_GA_ID, VITE_BROWSER = "chromium" } = loadEnv(mode, process.cwd());
3737
const radarOptions = {
3838
enableDev: true,
3939
analytics: {
@@ -93,7 +93,7 @@ export default ({ mode }) => {
9393
enabled: true,
9494
headless: true,
9595
provider: "playwright",
96-
instances: [{ browser: "chromium" }],
96+
instances: [{ browser: VITE_BROWSER }],
9797
},
9898
setupFiles: [".storybook/vitest.setup.ts"],
9999
retry: 2,

0 commit comments

Comments
 (0)