Skip to content

Commit e0c2992

Browse files
authored
chore: add shared Playwright config (#93)
1 parent b7c2949 commit e0c2992

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

artifacts/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!.gitignore

frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"build": "next build",
88
"start": "next start",
99
"lint": "next lint",
10-
"test:e2e": "playwright test",
10+
"test:e2e": "playwright test -c ../playwright.config.ts",
1111
"assets:gen": "python ../scripts/generate_reference_glbs.py",
1212
"assets:pack": "bash ../scripts/pack_models.sh",
1313
"assets:validate": "python ../scripts/glb_validate.py public/models/*.glb --fail-on-warning",

frontend/playwright.config.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
import type { PlaywrightTestConfig } from '@playwright/test';
21
import config from '../playwright.config';
32

4-
const frontendConfig: PlaywrightTestConfig = {
5-
...config,
6-
testDir: './tests/e2e',
7-
};
8-
9-
export default frontendConfig;
3+
export default config;

playwright.config.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
1+
import path from 'path';
12
import { defineConfig } from '@playwright/test';
23

4+
const testDir = path.resolve(__dirname, 'frontend/tests/e2e');
5+
const junitOutputFile = path.resolve(__dirname, 'artifacts/junit.xml');
6+
37
export default defineConfig({
4-
testDir: 'frontend/tests/e2e',
8+
testDir,
59
timeout: 60_000,
610
fullyParallel: false,
711
expect: {
812
timeout: 15_000,
913
},
1014
reporter: [
1115
['list'],
12-
['junit', { outputFile: 'artifacts/junit.xml' }],
16+
['junit', { outputFile: junitOutputFile }],
1317
],
1418
use: {
1519
baseURL: process.env.BASE_URL || 'http://localhost:3000',
@@ -21,7 +25,7 @@ export default defineConfig({
2125
'--use-gl=swiftshader',
2226
'--enable-webgl',
2327
'--disable-gpu-sandbox',
24-
'--disable-web-security', // allow wasm decoders to initialise in CI
28+
'--disable-web-security',
2529
],
2630
},
2731
},

0 commit comments

Comments
 (0)