-
Notifications
You must be signed in to change notification settings - Fork 25
/
playwright.config.ts
93 lines (87 loc) · 2.07 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
81
82
83
84
85
86
87
88
89
90
91
92
93
import { devices, type PlaywrightTestConfig } from '@playwright/test'
import dotenv from 'dotenv'
import path from 'path'
dotenv.config({ path: path.resolve(__dirname, './', '.env.local') })
const LOCALE = 'en-US'
const isCI = process.env.PLAYWRIGHT_RUNTIME_ENV === 'ci'
// const isLocal = process.env.PLAYWRIGHT_RUNTIME_ENV === 'local'
/**
* See https://playwright.dev/docs/test-configuration.
*/
const config: PlaywrightTestConfig = {
testDir: './tests',
outputDir: 'test-results/',
timeout: 150e3,
expect: {
timeout: 200e3,
},
fullyParallel: true,
forbidOnly: !!isCI,
retries: isCI ? 2 : 1,
workers: isCI ? 2 : undefined,
// maxFailures: process.env.CI ? 2 : 0,
reporter: 'html',
globalSetup: require.resolve('./tests/globalSetup'),
use: {
testIdAttribute: 'data-test-id',
actionTimeout: 0,
baseURL: process.env.PLAYWRIGHT_TEST_BASE_URL,
trace: 'on-first-retry',
},
projects: [
{
name: 'Chromium',
use: {
...devices['Desktop Chrome'],
locale: LOCALE,
},
},
// ...(isLocal
// ? []
// : [
// {
// name: 'firefox',
// use: {
// ...devices['Desktop Firefox'],
// locale: LOCALE,
// },
// },
// // {
// // name: 'webkit',
// // use: {
// // ...devices['Desktop Safari'],
// // locale: LOCALE,
// // },
// // },
// ]),
/* Test against mobile viewports. */
// {
// name: 'Mobile Chrome',
// use: {
// ...devices['Pixel 5'],
// locale: LOCALE,
// },
// },
// {
// name: 'Mobile Safari',
// use: {
// ...devices['iPhone 12'],
// locale: LOCALE,
// },
// },
/* Test against branded browsers. */
// {
// name: 'Microsoft Edge',
// use: {
// channel: 'msedge',
// },
// },
// {
// name: 'Google Chrome',
// use: {
// channel: 'chrome',
// },
// },
],
}
export default config