-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathplaywright.config.js
More file actions
75 lines (70 loc) · 1.95 KB
/
Copy pathplaywright.config.js
File metadata and controls
75 lines (70 loc) · 1.95 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
import { defineConfig } from '@playwright/test';
const edgeExecutable = process.env.PLAYWRIGHT_EXECUTABLE_PATH || null;
const usesExternalServer = process.env.RETROVISOR_E2E_EXTERNAL_SERVER === '1';
const traceMode = process.env.RETROVISOR_E2E_TRACE === '1' ? 'retain-on-failure' : 'off';
const releaseVideo = process.env.RETROVISOR_RELEASE_VIDEO === '1'
? {
mode: 'on',
size: { width: 1600, height: 1000 },
}
: 'off';
const webServerCommand = process.platform === 'win32'
? 'node ./node_modules/vite/bin/vite.js --host 127.0.0.1 --port 41733 --strictPort'
: 'node ./node_modules/vite/bin/vite.js --host 127.0.0.1 --port 41733 --strictPort';
const launchOptions = {
args: [
'--use-angle=swiftshader',
'--enable-webgl',
'--ignore-gpu-blocklist',
],
};
if (edgeExecutable) {
launchOptions.executablePath = edgeExecutable;
}
export default defineConfig({
testDir: './tests/e2e',
fullyParallel: false,
workers: 1,
reporter: [
['list'],
['html', { outputFolder: 'artifacts/playwright-report', open: 'never' }],
],
use: {
baseURL: 'http://127.0.0.1:41733',
colorScheme: 'dark',
viewport: { width: 1440, height: 960 },
ignoreHTTPSErrors: true,
launchOptions,
screenshot: 'only-on-failure',
trace: traceMode,
video: 'off',
},
webServer: usesExternalServer
? undefined
: {
command: webServerCommand,
url: 'http://127.0.0.1:41733',
reuseExistingServer: false,
timeout: 120000,
},
projects: [
{
name: 'smoke',
outputDir: 'artifacts/e2e-smoke',
testIgnore: /release-capture\.spec\.js/,
},
{
name: 'release-capture',
outputDir: 'artifacts/release-videos',
testMatch: /release-capture\.spec\.js/,
timeout: 300000,
use: {
colorScheme: 'dark',
viewport: { width: 1600, height: 1000 },
screenshot: 'off',
trace: 'off',
video: releaseVideo,
},
},
],
});