-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.elementor.config.js
More file actions
59 lines (55 loc) · 1.78 KB
/
Copy pathplaywright.elementor.config.js
File metadata and controls
59 lines (55 loc) · 1.78 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
/**
* Playwright config for Cimo's Elementor upload smoke.
*
* Installs Elementor from WordPress.org via Playground networking (separate
* port/blueprint so the free suite stays offline-friendly).
*/
const path = require( 'path' )
const { defineConfig, devices } = require( '@playwright/test' )
const PORT = process.env.WP_PORT || '9412'
const baseURL = process.env.WP_BASE_URL || `http://127.0.0.1:${ PORT }`
process.env.WP_BASE_URL = baseURL
process.env.WP_USERNAME = process.env.WP_USERNAME || 'admin'
process.env.WP_PASSWORD = process.env.WP_PASSWORD || 'password'
const STORAGE_STATE_PATH = path.join( __dirname, 'e2e/.auth/admin.elementor.json' )
process.env.STORAGE_STATE_PATH = STORAGE_STATE_PATH
const PLAYGROUND_BLUEPRINT = path.join(
__dirname,
'e2e/playground-blueprint.elementor.json'
)
module.exports = defineConfig( {
testDir: './e2e/tests/elementor',
globalSetup: require.resolve( './e2e/config/global-setup.js' ),
fullyParallel: false,
forbidOnly: !! process.env.CI,
retries: process.env.CI ? 1 : 0,
workers: 1,
timeout: 240_000,
reporter: process.env.CI
? [ [ 'github' ], [ 'html', { open: 'never' } ] ]
: [ [ 'list' ], [ 'html', { outputFolder: 'playwright-report-elementor', open: 'never' } ] ],
reportSlowTests: null,
webServer: {
command: [
'npx @wp-playground/cli server',
'--mount=.:/wordpress/wp-content/plugins/cimo',
`--blueprint=${ PLAYGROUND_BLUEPRINT }`,
'--php=8.2',
`--port=${ PORT }`,
].join( ' ' ),
port: Number( PORT ),
reuseExistingServer: ! process.env.CI,
timeout: 360 * 1000,
stdout: 'pipe',
stderr: 'pipe',
},
use: {
baseURL,
storageState: STORAGE_STATE_PATH,
ignoreHTTPSErrors: true,
screenshot: 'only-on-failure',
trace: 'retain-on-failure',
video: 'retain-on-failure',
...devices[ 'Desktop Chrome' ],
},
} )