-
Notifications
You must be signed in to change notification settings - Fork 18
/
playwright.config.ts
67 lines (65 loc) · 1.7 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
import { defineConfig, devices } from '@playwright/test';
const docker = process.env.DOCKER !== undefined;
const production = process.env.NODE_ENV === 'production';
const host = docker ? 'http://host.docker.internal' : 'http://localhost';
const url = `${host}:${production ? '31313' : '3000'}`;
const ci = Boolean(process.env.CI) || docker;
// eslint-disable-next-line import/no-default-export
export default defineConfig({
testDir: './tests',
fullyParallel: true,
forbidOnly: ci,
retries: ci ? 2 : 1,
/* Opt out of parallel tests on CI. */
workers: ci ? 1 : undefined,
reporter: 'html',
use: {
baseURL: url,
headless: true,
launchOptions: {
ignoreDefaultArgs: ['--hide-scrollbars'],
},
trace: ci ? 'retain-on-failure' : 'on-first-retry',
video: ci ? 'retain-on-failure' : 'on-first-retry',
},
projects: [
{
name: 'chromium-hd',
use: {
...devices['Desktop Chrome HiDPI'],
},
testMatch: /screenshots.spec.ts/,
},
{
name: 'chromium',
use: {
...devices['Desktop Chrome'],
},
testIgnore: /screenshots.spec.ts/,
},
{
name: 'firefox',
use: { ...devices['Desktop Firefox'] },
testIgnore: /screenshots.spec.ts/,
},
{
name: 'webkit',
use: { ...devices['Desktop Safari'] },
testIgnore: /screenshots.spec.ts/,
},
{
name: 'mobile-webkit',
use: { ...devices['iPad Mini landscape'] },
testIgnore: /screenshots.spec.ts/,
},
],
...(docker
? {}
: {
webServer: {
command: production ? 'yarn preview --open=0' : 'yarn start --open=0',
reuseExistingServer: !process.env.CI,
url,
},
}),
});