-
Notifications
You must be signed in to change notification settings - Fork 44
/
playwright.config.ts
78 lines (76 loc) · 2.14 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
import { devices, type PlaywrightTestConfig } from '@playwright/test';
import { getMockedEndpointsServiceEndpoint } from './tests/utils/network-utils.js';
/**
* See https://playwright.dev/docs/test-configuration.
*/
const config: PlaywrightTestConfig = {
testDir: './tests',
outputDir: './reports/test-artifacts',
timeout: 180 * 60 * 1000,
expect: {
timeout: 15 * 1000,
},
// Please be aware that parallel tests execution causes tests flackiness.
// Usually because of: ZlibError: zlib: invalid stored block lengths
// Consider to use it for local development only.
workers: '25%',
fullyParallel: true,
retries: 1,
reporter: [
['list'],
['html', { outputFolder: './reports/html-report', open: 'never' }],
['junit', { outputFile: './reports/test-execution-results.xml' }],
],
// Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions.
use: {
browserName: 'chromium',
actionTimeout: 0,
headless: !!process.env.CI,
viewport: { width: 1280, height: 720 },
ignoreHTTPSErrors: true,
screenshot: {
mode: 'only-on-failure',
fullPage: true,
},
video: 'on-first-retry',
trace: 'retain-on-failure',
},
testIgnore: ['*.js'],
projects: [
{
name: 'cli',
testMatch: '**/cli/**/*.spec.ts',
},
{
name: 'chromium-desktop',
use: {
browserName: 'chromium',
...devices['Desktop Chrome'],
},
testMatch: ['**/ui/**/*.spec.ts'],
},
{
name: 'firefox-desktop',
use: {
browserName: 'firefox',
...devices['Desktop Firefox'],
},
testMatch: ['**/ui/**/*.spec.ts'],
},
{
name: 'webkit-desktop',
use: {
browserName: 'webkit',
...devices['Desktop Safari'],
},
testMatch: ['**/ui/**/*.spec.ts'],
},
],
webServer: {
// TODO: We can't use "ts-node" with Npx and Node20 because of the https://github.com/TypeStrong/ts-node/issues/1997
command: 'node --loader ts-node/esm ./tests/mocks/mocked-endpoints.ts',
url: getMockedEndpointsServiceEndpoint(),
timeout: 30 * 1000,
},
};
export default config;