forked from openmrs/openmrs-esm-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
50 lines (47 loc) · 1.35 KB
/
playwright.config.ts
File metadata and controls
50 lines (47 loc) · 1.35 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
import { devices, type PlaywrightTestConfig } from '@playwright/test';
import * as dotenv from 'dotenv';
dotenv.config();
// Determine reporter configuration:
// - CI or E2E_REPORTER=ci: JUnit for test results parsing + HTML for artifacts
// - E2E_REPORTER=list: Simple list output (good for CLI tools like Claude Code)
// - Default: HTML report with auto-open on failure
const getReporter = (): PlaywrightTestConfig['reporter'] => {
if (process.env.CI || process.env.E2E_REPORTER === 'ci') {
return [
['junit', { outputFile: 'results.xml' }],
['html', { open: 'never' }],
];
}
if (process.env.E2E_REPORTER === 'list') {
return [['list'], ['html', { open: 'never' }]];
}
return [['html']];
};
// See https://playwright.dev/docs/test-configuration.
const config: PlaywrightTestConfig = {
testDir: './e2e/specs',
timeout: 3 * 60 * 1000,
expect: {
timeout: 40 * 1000,
},
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: 0,
reporter: getReporter(),
globalSetup: require.resolve('./e2e/core/global-setup'),
use: {
baseURL: `${process.env.E2E_BASE_URL}/spa/`,
storageState: 'e2e/storageState.json',
video: 'retain-on-failure',
trace: 'retain-on-failure',
},
projects: [
{
name: 'chromium',
use: {
...devices['Desktop Chrome'],
},
},
],
};
export default config;