-
Notifications
You must be signed in to change notification settings - Fork 58
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
75 lines (74 loc) · 1.94 KB
/
Copy pathplaywright.config.ts
File metadata and controls
75 lines (74 loc) · 1.94 KB
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
import { defineConfig, devices } from '@playwright/test';
import 'dotenv/config';
/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: './playwright/',
fullyParallel: false,
forbidOnly: false,
retries: process.env.CI ? 1 : 0,
workers: 4,
reporter: process.env.CI
? [
['html', { outputFolder: 'playwright-report' }],
[
'playwright-ctrf-json-reporter',
{ outputDir: 'playwright-ctrf', outputFile: 'playwright-ctrf.json' },
],
['@currents/playwright'],
]
: 'list',
globalTimeout: (process.env.INTEGRATION ? 35 : 20) * 60 * 1000, // 35m || 20m
timeout: (process.env.INTEGRATION ? 8 : 4) * 60 * 1000, // 8m || 4m
expect: { timeout: 30_000 }, // 30s
use: {
actionTimeout: 30_000, // 30s
navigationTimeout: 30_000, // 30s
launchOptions: {
args: ['--use-fake-device-for-media-stream'],
},
...(process.env.ADMIN_TOKEN
? {
extraHTTPHeaders: {
Authorization: process.env.ADMIN_TOKEN,
},
}
: {}),
baseURL: process.env.BASE_URL,
ignoreHTTPSErrors: true,
...(process.env.PROXY
? {
proxy: {
server: process.env.PROXY,
},
}
: {}),
trace: 'on',
screenshot: 'on',
video: 'on',
},
projects: [
{ name: 'setup', testMatch: /.*\.setup\.ts/, use: { trace: 'off' } },
process.env.INTEGRATION
? {
name: 'Integration',
use: {
...devices['Desktop Chrome'],
storageState: '.auth/ADMIN_TOKEN.json',
},
testDir: './playwright/Integration/',
dependencies: ['setup'],
}
:
{
name: 'UI',
use: {
...devices['Desktop Chrome'],
storageState: '.auth/ADMIN_TOKEN.json',
},
testDir: './playwright/UI/',
dependencies: ['setup'],
},
],
});