-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathplaywright.config.js
More file actions
53 lines (47 loc) · 1.32 KB
/
Copy pathplaywright.config.js
File metadata and controls
53 lines (47 loc) · 1.32 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
/**
* @file Playwright configuration for hyper-element tests.
* Supports two test modes:
* - source-coverage: Tests against src/ via ESM for coverage collection
* - bundle-verify: Tests against built bundle to verify build integrity
*/
const { defineConfig, devices } = require('@playwright/test');
// Determine test mode from environment
const testMode = process.env.TEST_MODE || 'source';
module.exports = defineConfig({
testDir: './examples/kitchensink',
testMatch: '*.spec.js',
fullyParallel: false,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: 1, // Single worker to ensure coverage merges correctly
reporter: [['html'], ['list']],
use: {
baseURL: 'http://localhost:5555',
trace: 'on-first-retry',
},
projects: [
{
name: 'source-coverage',
use: {
...devices['Desktop Chrome'],
channel: 'chrome',
},
metadata: { testMode: 'src' },
},
{
name: 'bundle-verify',
use: {
...devices['Desktop Chrome'],
channel: 'chrome',
},
metadata: { testMode: 'bundle' },
},
],
webServer: {
// http-server doesn't respect .gitignore, so build/ is accessible
command: 'npx http-server . -p 5555 -c-1',
url: 'http://localhost:5555',
reuseExistingServer: false,
timeout: 30000,
},
});