-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathplaywright.config.cjs
More file actions
40 lines (38 loc) · 922 Bytes
/
Copy pathplaywright.config.cjs
File metadata and controls
40 lines (38 loc) · 922 Bytes
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
const { defineConfig } = require('@playwright/test');
const useExternalServer = process.env.NO_WEBSERVER === '1';
module.exports = defineConfig({
testDir: './tests',
testMatch: '**/*.spec.js',
timeout: 30000,
retries: 1,
use: {
headless: true,
viewport: { width: 1280, height: 720 },
actionTimeout: 10000,
baseURL: 'http://localhost:8787',
},
// When NO_WEBSERVER=1, assume server is managed externally (e.g. by tools/e2e.sh)
...(useExternalServer ? {} : {
webServer: {
command: 'npx serve . -l 8787',
port: 8787,
reuseExistingServer: true,
timeout: 10000,
},
}),
projects: [
{
name: 'chromium',
use: { browserName: 'chromium' },
},
{
name: 'mobile-chrome',
use: {
browserName: 'chromium',
viewport: { width: 375, height: 667 },
isMobile: true,
},
grep: /Mobile/,
},
],
});