1+ // playwright.config.mts
12import path from 'path' ;
23import { fileURLToPath } from 'url' ;
34import { defineConfig , devices } from '@playwright/test' ;
@@ -6,7 +7,7 @@ import * as dotenv from 'dotenv';
67
78const __filename = fileURLToPath ( import . meta. url ) ;
89const __dirname = path . dirname ( __filename ) ;
9- const ROOT = path . resolve ( __dirname , '..' ) ; // repo root
10+ const ROOT = path . resolve ( __dirname , '..' ) ;
1011
1112const env = process . env . ENV || 'local' ;
1213const envPath = path . join ( ROOT , `.env.${ env } ` ) ;
@@ -18,8 +19,12 @@ if (fs.existsSync(envPath)) {
1819}
1920
2021export default defineConfig ( {
21- // Your tests live at repo root under tests/e2e
22- testDir : path . resolve ( __dirname , 'tests' ) ,
22+ // Only look under tests/e2e
23+ testDir : path . resolve ( __dirname , 'tests/e2e' ) ,
24+ testMatch : / .* \. e 2 e \. ( s p e c | t e s t ) \. ( t s | j s | m j s | c j s ) $ / ,
25+
26+ // Belt & suspenders: if someone moves things around, still ignore unit
27+ testIgnore : [ '**/unit/**' , '**/*.vitest.*' ] ,
2328
2429 reporter : [ [ 'html' , { outputFolder : path . resolve ( __dirname , 'playwright-report' ) , open : 'never' } ] ] ,
2530 fullyParallel : true ,
@@ -37,12 +42,11 @@ export default defineConfig({
3742 { name : 'firefox' , use : { ...devices [ 'Desktop Firefox' ] } } ,
3843 ] ,
3944
40- webServer : {
41- // build at repo root (Makefile), then preview inside web-client
42- command : 'make -s build && npm --prefix web-client run preview -- --port=5173 --strictPort' ,
43- port : 5173 ,
44- reuseExistingServer : ! process . env . CI ,
45- cwd : ROOT , // repo root (Makefile lives here)
46- timeout : 120_000 ,
47- }
45+ webServer : {
46+ command : 'make -s build && npm --prefix web-client run preview -- --port=5173 --strictPort' ,
47+ port : 5173 ,
48+ reuseExistingServer : ! process . env . CI ,
49+ cwd : ROOT ,
50+ timeout : 120_000 ,
51+ } ,
4852} ) ;
0 commit comments