|
| 1 | +/** |
| 2 | + * External dependencies |
| 3 | + */ |
| 4 | +const { defineConfig, devices } = require( '@playwright/test' ); |
| 5 | +const path = require( 'path' ); |
| 6 | + |
| 7 | +const STORAGE_STATE_PATH = |
| 8 | + process.env.STORAGE_STATE_PATH || |
| 9 | + path.join( process.cwd(), 'artifacts/storage-states/admin.json' ); |
| 10 | + |
| 11 | +module.exports = defineConfig( { |
| 12 | + testDir: '.', |
| 13 | + reporter: process.env.CI ? [ [ 'github' ], [ 'list' ] ] : 'list', |
| 14 | + forbidOnly: !! process.env.CI, |
| 15 | + retries: process.env.CI ? 2 : 0, |
| 16 | + workers: 1, |
| 17 | + timeout: 60_000, |
| 18 | + expect: { |
| 19 | + timeout: 10_000, |
| 20 | + }, |
| 21 | + outputDir: path.join( process.cwd(), 'artifacts/test-results' ), |
| 22 | + globalSetup: require.resolve( './global-setup.js' ), |
| 23 | + use: { |
| 24 | + baseURL: process.env.WP_BASE_URL || 'http://localhost:8889', |
| 25 | + trace: 'retain-on-failure', |
| 26 | + screenshot: 'only-on-failure', |
| 27 | + video: 'retain-on-failure', |
| 28 | + storageState: STORAGE_STATE_PATH, |
| 29 | + actionTimeout: 10_000, |
| 30 | + navigationTimeout: 15_000, |
| 31 | + }, |
| 32 | + projects: [ |
| 33 | + { |
| 34 | + name: 'chromium', |
| 35 | + use: { ...devices[ 'Desktop Chrome' ] }, |
| 36 | + }, |
| 37 | + ], |
| 38 | +} ); |
0 commit comments