-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
35 lines (29 loc) · 1.03 KB
/
playwright.config.ts
File metadata and controls
35 lines (29 loc) · 1.03 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
/**
* External dependencies
*/
import { defineConfig, type PlaywrightTestConfig } from '@playwright/test';
import path from 'path';
const artifactsPath = path.join( process.cwd(), 'tests/_output/e2e' );
// Ensure WP artifacts (and storage-state) are written into tests/_output/e2e
process.env[ 'WP_ARTIFACTS_PATH' ] = artifactsPath;
// Ensure STORAGE_STATE_PATH points into tests/_output/e2e as well
process.env[ 'STORAGE_STATE_PATH' ] = path.join(
artifactsPath,
'storage-states',
'admin.json'
);
const baseConfig =
require( '@wordpress/scripts/config/playwright.config.js' ) as PlaywrightTestConfig;
// Disable Playwright's automatic webServer orchestration to prevent port
// conflicts, as the CI workflow/local scripts manually manage the wp-env lifecycle.
const { webServer, ...baseConfigWithoutWebServer } = baseConfig;
const config = defineConfig( {
...baseConfigWithoutWebServer,
testDir: './tests/e2e',
outputDir: './tests/_output/e2e',
use: {
...baseConfigWithoutWebServer.use,
headless: true,
},
} );
export default config;