-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathplaywright.config.js
115 lines (114 loc) · 3.64 KB
/
playwright.config.js
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
/* global process */
import { defineConfig, devices } from '@playwright/test';
export default defineConfig({
projects: [
{
name: 'windows',
testMatch: [
'duckplayer.spec.js',
'duckplayer-screenshots.spec.js',
'onboarding.spec.js',
'special-error.spec.js',
'special-error-screenshots.spec.js',
],
use: {
...devices['Desktop Edge'],
injectName: 'windows',
platform: 'windows',
},
},
{
name: 'integration',
// prettier-ignore
testMatch: [
'favorites.spec.js',
'freemium-pir-banner.spec.js',
'new-tab.spec.js',
'new-tab.screenshots.spec.js',
'next-steps.spec.js',
'privacy-stats.spec.js',
'rmf.spec.js',
'update-notification.spec.js',
'customizer.spec.js',
'activity.spec.js',
'history.spec.js',
'history-selections.spec.js',
'history.screenshots.spec.js',
],
use: {
...devices['Desktop Chrome'],
injectName: 'integration',
platform: 'windows',
},
},
{
name: 'macos',
testMatch: [
'duckplayer.spec.js',
'duckplayer-screenshots.spec.js',
'onboarding.spec.js',
'release-notes.spec.js',
'special-error.spec.js',
'special-error-screenshots.spec.js',
],
use: {
...devices['Desktop Safari'],
injectName: 'apple',
platform: 'macos',
},
},
{
name: 'android',
testMatch: ['duckplayer.spec.js', 'duckplayer-screenshots.spec.js'],
use: {
...devices['Galaxy S III'],
injectName: 'android',
platform: 'android',
},
},
{
name: 'android-landscape',
testMatch: ['duckplayer-screenshots.spec.js', 'duckplayer-telemetry.spec.js'],
use: {
...devices['Galaxy S III landscape'],
injectName: 'android',
platform: 'android',
},
},
{
name: 'ios',
testMatch: [
'duckplayer.spec.js',
'duckplayer-screenshots.spec.js',
'special-error.spec.js',
'special-error-screenshots.spec.js',
],
use: {
...devices['iPhone 14'],
injectName: 'apple',
platform: 'ios',
},
},
],
fullyParallel: !process.env.CI,
/* Don't allow `.only` in CI */
forbidOnly: Boolean(process.env.CI),
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 2 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: 'html',
// @ts-expect-error - Type 'undefined' is not assignable to type 'string'. process.env
webServer: {
command: process.env.PAGE ? `npm run watch -- --page ${process.env.PAGE}` : 'npm run serve',
port: process.env.PAGE ? 8000 : 3210,
reuseExistingServer: true,
env: process.env,
},
use: {
actionTimeout: 5000,
trace: 'on-first-retry',
video: { mode: 'on-first-retry' },
},
});