-
Notifications
You must be signed in to change notification settings - Fork 150
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
56 lines (53 loc) · 1.47 KB
/
playwright.config.ts
File metadata and controls
56 lines (53 loc) · 1.47 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
import {devices} from '@playwright/test'
const minPort = 10_000
const maxPort = 60_000
const configuredPort = Number(process.env['TRYSTERO_TEST_PORT'])
const testPort =
Number.isInteger(configuredPort) &&
configuredPort >= minPort &&
configuredPort <= 65_535
? configuredPort
: Math.floor(Math.random() * (maxPort - minPort + 1)) + minPort
const testUrl = `https://localhost:${testPort}/test`
process.env['TRYSTERO_TEST_PORT'] = String(testPort)
export default {
timeout: 53_333,
reporter: [['list'], ['./test/connection-timing-reporter.js']],
use: {
ignoreHTTPSErrors: true,
headless: true,
launchOptions: {
args: [
'--use-fake-ui-for-media-stream',
'--use-fake-device-for-media-stream',
'--disable-features=WebRtcHideLocalIpsWithMdns',
'--disable-setuid-sandbox',
'--no-sandbox'
],
firefoxUserPrefs: {
'media.navigator.permission.disabled': true,
'media.navigator.streams.fake': true,
'media.peerconnection.ice.obfuscate_host_addresses': false
}
}
},
projects: [
{
name: 'chromium',
use: {...devices['Desktop Chrome']}
},
{
name: 'firefox',
use: {...devices['Desktop Firefox']}
},
{
name: 'webkit',
use: {...devices['Desktop Safari']}
}
],
webServer: {
command: `serve -p ${testPort} --ssl-cert ./test/certs/cert.pem --ssl-key ./test/certs/key.pem`,
url: testUrl,
ignoreHTTPSErrors: true
}
}