-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathplaywright.config.ts
80 lines (78 loc) · 2.46 KB
/
playwright.config.ts
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
import { defineConfig, devices } from '@playwright/test';
import 'dotenv/config';
/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: './tests',
fullyParallel: false,
forbidOnly: false,
retries: process.env.CI ? 1 : 0,
workers: 1,
reporter: process.env.CI
? [
[
'playwright-ctrf-json-reporter',
{ useDetails: true, outputDir: 'playwright-ctrf', outputFile: 'playwright-ctrf.json' },
],
['html', { outputFolder: 'playwright-report' }],
['@currents/playwright'],
]
: 'list',
timeout: process.env.CI ? 60000 : 30000,
expect: { timeout: process.env.CI ? 60000 : 20000 },
use: {
testIdAttribute: 'data-ouia-component-id',
launchOptions: {
args: ['--use-fake-device-for-media-stream'],
},
...(process.env.TOKEN
? {
extraHTTPHeaders: {
Authorization: process.env.TOKEN,
},
}
: {}),
baseURL: process.env.BASE_URL,
trace: 'on',
screenshot: 'on',
video: 'on',
ignoreHTTPSErrors: true,
...process.env.PROXY ? {
proxy: {
server: process.env.PROXY,
}
} : {}
},
projects: [
{ name: 'setup', testMatch: /.*\.setup\.ts/ },
{
name: 'chromium',
grepInvert: !!process.env.PROD ? [/preview-only/, /switch-to-preview/] : [/switch-to-preview/],
use: {
...devices['Desktop Chrome'],
storageState: `.auth/${process.env.USER1USERNAME}.json`,
},
dependencies: ['setup'],
},
...!!process.env.PROD ?
[{
name: 'Switch to preview',
grep: [/switch-to-preview/],
use: {
...devices['Desktop Chrome'],
storageState: `.auth/${process.env.USER1USERNAME}.json`,
},
dependencies: ['setup'],//'chromium',
},
{
name: 'Run preview only',
grep: [/preview-only/],
use: {
...devices['Desktop Chrome'],
storageState: `.auth/${process.env.USER1USERNAME}.json`,
},
dependencies: ['Switch to preview'],
}] : [],
],
});