-
Notifications
You must be signed in to change notification settings - Fork 5
/
playwright.config.ts
59 lines (52 loc) · 1.56 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
import { defineConfig, ViewportSize } from '@playwright/test'
export default defineConfig({
testDir: './playwright/tests',
outputDir: './playwright/test-results',
reporter: [['html', { outputFolder: './playwright/test-report' }]],
fullyParallel: !process.env.CI,
// Fail the build on CI if you accidentally left test.only in the source code.
forbidOnly: !!process.env.CI,
// Retry on CI only.
retries: process.env.CI ? 2 : 0,
use: {
baseURL: process.env.SITE_URL || 'http://localhost:8001',
// Whether to ignore HTTPS errors during navigation.
ignoreHTTPSErrors: true,
// browser context options
contextOptions: {
ignoreHTTPSErrors: true,
},
// Collect trace when retrying the failed test.
trace: 'on-first-retry',
screenshot: 'only-on-failure',
video: 'on-first-retry',
viewport: { width: 1280, height: 720 },
},
projects: [
// Test everything except full sitemap a11y check
{
name: 'main',
testIgnore: /.a11y.spec.ts/,
},
// Sitemap a11y test only
{
name: 'a11y',
testMatch: /.a11y.spec.ts/,
// No retries since no assertions are made.
retries: 0,
timeout: 4200000,
use: {
browserName:
(process.env.PW_BROWSER_VALUE as 'chromium' | 'firefox' | 'webkit') ||
'chromium',
trace: 'off',
screenshot: 'off',
video: 'off',
viewport: {
width: Number(process.env.PW_WIDTH_VALUE),
height: Number(process.env.PW_HEIGHT_VALUE),
} as ViewportSize,
},
},
],
})