-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathplaywright.config.ts
49 lines (48 loc) · 1.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
import { PlaywrightTestConfig, devices } from '@playwright/test';
const config: PlaywrightTestConfig = {
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
testDir: "tests/",
workers: 3,
use: {
trace: 'on-first-retry',
// Necessary to get the media codecs to play video (default 'chromium' doesn't have them)
channel: 'chrome'
},
webServer: {
command: 'npm run examples',
port: 1234,
reuseExistingServer: !process.env.CI,
},
projects: [
{
name: 'setup csp',
testMatch: /global\.setup\.ts/,
teardown: 'cleanup csp'
},
{
name: 'cleanup csp',
testMatch: /global\.teardown\.ts/
},
{
name: 'chromium with csp',
use: {
...devices['Desktop Chrome'],
launchOptions: {
args: ['--disable-web-security']
}
},
dependencies: ['setup csp'],
},
// Don't work with channel set to 'chrome'
// {
// name: 'firefox',
// use: { ...devices['Desktop Firefox'] },
// },
// {
// name: 'webkit',
// use: { ...devices['Desktop Safari'] },
// },
],
};
export default config;