-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaywright.config.js
103 lines (96 loc) · 2.15 KB
/
playwright.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/** @type {import('@playwright/test').PlaywrightTestConfig} */
import { defineConfig, devices } from '@playwright/test';
import dotenv from 'dotenv';
dotenv.config({ path: '.env.development' });
const commonTests = [
{ name: 'auth', testMatch: /auth\.setup\.js/ },
{
name: 'chromium',
testMatch: /.*\.spec\.js/,
testIgnore: /v2\/.*\.spec\.js/,
use: {
...devices['Desktop Chrome'],
storageState: 'tests/.auth/user.json'
},
dependencies: ['auth']
},
{
name: 'firefox',
testMatch: /.*\.spec\.js/,
testIgnore: /v2\/.*\.spec\.js/,
use: {
...devices['Desktop Firefox'],
storageState: 'tests/.auth/user.json'
},
dependencies: ['auth']
}
];
const v2Tests = [
{
name: 'collect_mock_tasks',
testMatch: /v2\/collect_mock_tasks\.setup\.js/,
use: {
storageState: 'tests/.auth/user.json'
},
dependencies: ['auth']
},
{
name: 'create_fake_task',
testMatch: /v2\/create_fake_task\.setup\.js/,
use: {
storageState: 'tests/.auth/user.json'
},
dependencies: ['auth']
},
{
name: 'chromium',
testMatch: /v2\/.*\.spec\.js/,
use: {
...devices['Desktop Chrome'],
storageState: 'tests/.auth/user.json'
},
dependencies: ['collect_mock_tasks', 'create_fake_task']
},
{
name: 'firefox',
testMatch: /v2\/.*\.spec\.js/,
use: {
...devices['Desktop Firefox'],
storageState: 'tests/.auth/user.json'
},
dependencies: ['collect_mock_tasks', 'create_fake_task']
}
];
export default defineConfig({
testDir: 'tests',
retries: 3,
projects: [...commonTests, ...v2Tests],
webServer: [
{
command: './tests/start-test-server.sh --branch main',
port: 8000,
waitForPort: true,
stdout: 'pipe',
reuseExistingServer: !process.env.CI,
timeout: 120000
},
{
command: 'node ./tests/fake-job-server.js',
port: 8080,
waitForPort: true,
stdout: 'pipe',
reuseExistingServer: !process.env.CI
},
{
command:
'npm run build && LOG_LEVEL_CONSOLE=debug ORIGIN=http://localhost:5173 PORT=5173 FRACTAL_RUNNER_BACKEND=slurm node build',
port: 5173,
stdout: 'pipe',
reuseExistingServer: !process.env.CI
}
],
use: {
baseURL: 'http://localhost:5173',
screenshot: 'only-on-failure'
}
});