-
Notifications
You must be signed in to change notification settings - Fork 0
/
playwright.config.ts
82 lines (74 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
import { PlaywrightTestConfig } from '@playwright/test';
import { devices } from 'playwright';
const config: PlaywrightTestConfig = {
use: {
// Browser options
headless: false,
slowMo: 1000,
// Context options
viewport: { width: 1280, height: 720 },
ignoreHTTPSErrors: true,
// Artifacts
screenshot: 'only-on-failure',
video: 'retry-with-video',
},
projects: [
{
name: 'Chrome Stable',
use: {
browserName: 'chromium',
// Test against Chrome Stable channel.
channel: 'chrome',
},
},
{
name: 'Desktop Safari',
use: {
browserName: 'webkit',
viewport: { width: 1200, height: 750 },
}
},
// Test against mobile viewports.
{
name: 'Mobile Chrome',
use: devices['Pixel 5'],
},
{
name: 'Mobile Safari',
use: devices['iPhone 12'],
},
{
name: 'Desktop Firefox',
use: {
browserName: 'firefox',
//viewport: { width: 800, height: 600 },
}
},
// {
// name: 'Pixel 4',
// use: {
// browserName: 'chromium',
// ...devices['Pixel 4'],
// },
// },
// // "iPhone 11" tests use WebKit browser.
// {
// name: 'iPhone 11',
// use: {
// browserName: 'webkit',
// ...devices['iPhone 11'],
// },
// },
],
// Look for test files in the "tests" directory, relative to this configuration file
testDir: 'tests',
// Each test is given 30 seconds
timeout: 30000,
// Forbid test.only on CI
forbidOnly: !!process.env.CI,
// 1 retry for each test
retries: 1,
// Limit the number of workers on CI, use default locally
workers: process.env.CI ? 2 : undefined,
};
export default config;