@@ -4,8 +4,7 @@ import { defineConfig, devices } from '@playwright/test';
4
4
* Read environment variables from file.
5
5
* https://github.com/motdotla/dotenv
6
6
*/
7
- // import dotenv from 'dotenv';
8
- // dotenv.config({ path: path.resolve(__dirname, '.env') });
7
+ // require('dotenv').config();
9
8
10
9
/**
11
10
* See https://playwright.dev/docs/test-configuration.
@@ -25,28 +24,42 @@ export default defineConfig({
25
24
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
26
25
use : {
27
26
/* Base URL to use in actions like `await page.goto('/')`. */
28
- // baseURL: 'http://127.0.0.1:3000 ',
27
+ baseURL : 'http://localhost:5173 ' ,
29
28
30
29
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
31
30
trace : 'on-first-retry' ,
32
31
} ,
33
32
34
33
/* Configure projects for major browsers */
35
34
projects : [
35
+ { name : 'setup' , testMatch : / .* \. s e t u p \. t s / } ,
36
+
36
37
{
37
38
name : 'chromium' ,
38
- use : { ...devices [ 'Desktop Chrome' ] } ,
39
+ use : {
40
+ ...devices [ 'Desktop Chrome' ] ,
41
+ storageState : 'playwright/.auth/user.json' ,
42
+ } ,
43
+ dependencies : [ 'setup' ] ,
39
44
} ,
40
45
41
- {
42
- name : 'firefox' ,
43
- use : { ...devices [ 'Desktop Firefox' ] } ,
44
- } ,
46
+ // {
47
+ // name: 'firefox',
48
+ // use: {
49
+ // ...devices['Desktop Firefox'],
50
+ // storageState: 'playwright/.auth/user.json',
51
+ // },
52
+ // dependencies: ['setup'],
53
+ // },
45
54
46
- {
47
- name : 'webkit' ,
48
- use : { ...devices [ 'Desktop Safari' ] } ,
49
- } ,
55
+ // {
56
+ // name: 'webkit',
57
+ // use: {
58
+ // ...devices['Desktop Safari'],
59
+ // storageState: 'playwright/.auth/user.json',
60
+ // },
61
+ // dependencies: ['setup'],
62
+ // },
50
63
51
64
/* Test against mobile viewports. */
52
65
// {
@@ -70,9 +83,9 @@ export default defineConfig({
70
83
] ,
71
84
72
85
/* Run your local dev server before starting the tests */
73
- // webServer: {
74
- // command: 'npm run start ',
75
- // url: 'http://127.0.0.1:3000 ',
76
- // reuseExistingServer: !process.env.CI,
77
- // },
86
+ webServer : {
87
+ command : 'npm run dev ' ,
88
+ url : 'http://localhost:5173 ' ,
89
+ reuseExistingServer : ! process . env . CI ,
90
+ } ,
78
91
} ) ;
0 commit comments