-
Notifications
You must be signed in to change notification settings - Fork 77
Expand file tree
/
Copy pathplaywright.config.js
More file actions
132 lines (127 loc) · 3.53 KB
/
Copy pathplaywright.config.js
File metadata and controls
132 lines (127 loc) · 3.53 KB
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
// @ts-check
var { defineConfig } = require('@playwright/test');
var serverPort = process.env.TEST_SERVER_PORT || '9876';
var serverUrl = 'http://localhost:' + serverPort;
/* Reduce the number of external connections Chrome makes. */
var ChromeFlags = [
'--no-sandbox',
'--no-pings',
'--force-color-profile=srgb',
'--disable-background-networking',
'--disable-component-extensions-with-background-pages',
'--translate-script-url=""',
'--enable-unsafe-swiftshader',
'--touch-events'
];
var ChromeHeadedFlags = ChromeFlags.concat([
'--device-scale-factor=1',
'--window-position=0,0',
'--start-fullscreen',
'--kiosk',
'--incognito'
]);
/* Firefox preferences to limit external connections */
var FirefoxPrefs = {
'browser.aboutHomeSnippets.updateUrl': '',
'browser.casting.enabled': false,
'browser.library.activity-stream.enabled': false,
'browser.newtabpage.activity-stream.enabled': false,
'browser.search.geoip.url': '',
'browser.selfsupport.enabled': false,
'browser.selfsupport.url': '',
'browser.startup.homepage_override.mstone': 'ignore',
'extensions.getAddons.cache.enabled': false,
'extensions.pocket.enabled': false,
'extensions.update.enabled': false,
'network.captive-portal-service.enabled': false,
'network.dns.disablePrefetch': true,
'network.http.speculative-parallel-limit': 0,
'network.prefetch-next': false,
'browser.safebrowsing.provider.mozilla.gethashURL': '',
'browser.safebrowsing.provider.mozilla.updateURL': '',
'browser.safebrowsing.provider.google.gethashURL': '',
'browser.safebrowsing.provider.google.updateURL': '',
'browser.safebrowsing.provider.google4.dataSharingURL': '',
'browser.safebrowsing.provider.google4.gethashURL': '',
'browser.safebrowsing.provider.google4.updateURL': '',
'datareporting.healthreport.uploadEnabled': false,
'datareporting.policy.dataSubmissionEnabled': false,
'media.gmp-gmpopenh264.autoupdate': false,
'media.gmp-manager.url': '',
'dom.w3c_touch_events.enabled': 1
};
module.exports = defineConfig({
testDir: './tests',
testMatch: 'playwright-runner.spec.js',
timeout: 600000,
expect: {
timeout: 30000
},
fullyParallel: false,
forbidOnly: !!process.env.CI,
retries: 0,
workers: 1,
reporter: [
['list']
],
use: {
actionTimeout: 30000,
trace: 'off'
},
projects: [
{
name: 'chromium',
use: {
browserName: 'chromium',
trace: 'on-first-api',
headless: true,
launchOptions: {
args: ChromeFlags
},
hasTouch: true
}
},
{
name: 'chromium-headed',
use: {
browserName: 'chromium',
trace: 'on-first-api',
headless: false,
launchOptions: {
args: ChromeHeadedFlags.concat([
'--proxy-pac-url=' + serverUrl + '/testdata/proxy-for-tests.pac'
])
},
hasTouch: true,
viewport: null
}
},
{
name: 'firefox',
use: {
browserName: 'firefox',
trace: 'on-first-api',
headless: true,
hasTouch: true,
launchOptions: {
firefoxUserPrefs: FirefoxPrefs
}
}
},
{
name: 'firefox-headed',
use: {
browserName: 'firefox',
trace: 'on-first-api',
headless: false,
hasTouch: true,
launchOptions: {
firefoxUserPrefs: Object.assign({}, FirefoxPrefs, {
'network.proxy.type': 2,
'network.proxy.autoconfig_url': serverUrl + '/testdata/proxy-for-tests.pac'
})
}
}
}
]
});