Skip to content

Commit 1faaba9

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 82259ed commit 1faaba9

2 files changed

Lines changed: 12 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.56.1-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: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ const proxy = {
3434

3535
// https://vitejs.dev/config/
3636
export default ({ mode }) => {
37-
const { VITE_APP_GA_ID } = loadEnv(mode, process.cwd());
37+
const { VITE_APP_GA_ID, VITE_BROWSER = "chromium" } = loadEnv(
38+
mode,
39+
process.cwd(),
40+
);
3841
const radarOptions = {
3942
enableDev: true,
4043
analytics: {
@@ -94,7 +97,7 @@ export default ({ mode }) => {
9497
enabled: true,
9598
headless: true,
9699
provider: playwright(),
97-
instances: [{ browser: "chromium" }],
100+
instances: [{ browser: VITE_BROWSER }],
98101
},
99102
setupFiles: [".storybook/vitest.setup.ts"],
100103
retry: 2,

0 commit comments

Comments
 (0)