@@ -2,6 +2,14 @@ import path from 'node:path';
22import { defineConfig , devices } from '@playwright/test' ;
33import baseConfig from '../playwright.config' ;
44
5+ const buildCommand = [
6+ 'INCLUDE_AUTH_PAGES=true' ,
7+ 'NEXT_PUBLIC_TIME_TILL_LOGOUT_SECONDS=25' ,
8+ 'NEXT_PUBLIC_PROMPT_SECONDS_BEFORE_LOGOUT=5' ,
9+ 'NEXT_PUBLIC_ENABLE_LETTERS=true' ,
10+ 'npm run build && npm run start' ,
11+ ] . join ( ' ' ) ;
12+
513export default defineConfig ( {
614 ...baseConfig ,
715
@@ -11,18 +19,37 @@ export default defineConfig({
1119 } ,
1220 projects : [
1321 {
14- name : 'e2e-local' ,
22+ name : 'e2e:setup' ,
23+ testMatch : 'e2e.setup.ts' ,
24+ use : {
25+ baseURL : 'http://localhost:3000' ,
26+ ...devices [ 'Desktop Chrome' ] ,
27+ headless : true ,
28+ screenshot : 'only-on-failure' ,
29+ } ,
30+ } ,
31+ {
32+ name : 'e2e' ,
1533 testMatch : '*.e2e.spec.ts' ,
1634 use : {
35+ screenshot : 'only-on-failure' ,
1736 baseURL : 'http://localhost:3000' ,
1837 ...devices [ 'Desktop Chrome' ] ,
38+ headless : true ,
39+ storageState : path . resolve ( __dirname , '../.auth/e2e/user.json' ) ,
1940 } ,
41+ dependencies : [ 'e2e:setup' ] ,
42+ teardown : 'e2e:teardown' ,
43+ } ,
44+ {
45+ name : 'e2e:teardown' ,
46+ testMatch : 'e2e.teardown.ts' ,
2047 } ,
2148 ] ,
2249 /* Run your local dev server before starting the tests */
2350 webServer : {
2451 timeout : 2 * 60 * 1000 , // 2 minutes
25- command : 'npm run build && npm run start' ,
52+ command : buildCommand ,
2653 cwd : path . resolve ( __dirname , '../../../..' ) ,
2754 url : 'http://localhost:3000/templates/create-and-submit-templates' ,
2855 reuseExistingServer : ! process . env . CI ,
0 commit comments