2023-04-17 12:01:41 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
2023-05-05 11:03:36 +00:00
|
|
|
import { fileURLToPath } from 'url';
|
2024-05-13 12:58:26 +00:00
|
|
|
import { BASE_URL, STORAGE_STATE_PATH } from '@woocommerce/e2e-utils';
|
|
|
|
import { PlaywrightTestConfig, defineConfig, devices } from '@playwright/test';
|
2023-04-17 12:01:41 +00:00
|
|
|
|
2024-05-13 12:58:26 +00:00
|
|
|
const { CI, DEFAULT_TIMEOUT_OVERRIDE } = process.env;
|
2023-04-17 12:01:41 +00:00
|
|
|
|
2024-05-13 12:58:26 +00:00
|
|
|
const config: PlaywrightTestConfig = {
|
|
|
|
maxFailures: 0,
|
2024-03-06 16:52:37 +00:00
|
|
|
timeout: parseInt( DEFAULT_TIMEOUT_OVERRIDE || '', 10 ) || 100_000, // Defaults to 100s.
|
2024-06-11 16:57:23 +00:00
|
|
|
outputDir: `${ __dirname }/artifacts/test-results`,
|
2023-05-05 11:03:36 +00:00
|
|
|
globalSetup: fileURLToPath(
|
|
|
|
new URL( 'global-setup.ts', 'file:' + __filename ).href
|
|
|
|
),
|
2024-05-13 12:58:26 +00:00
|
|
|
testDir: './tests',
|
2023-05-05 11:03:36 +00:00
|
|
|
retries: CI ? 2 : 0,
|
2024-05-13 12:58:26 +00:00
|
|
|
// We're running our tests in serial, so we only need one worker.
|
2023-06-01 11:51:59 +00:00
|
|
|
workers: 1,
|
2024-05-13 12:58:26 +00:00
|
|
|
fullyParallel: false,
|
2024-05-14 08:23:17 +00:00
|
|
|
forbidOnly: !! CI,
|
2024-03-07 11:57:48 +00:00
|
|
|
// Don't report slow test "files", as we're running our tests in serial.
|
|
|
|
reportSlowTests: null,
|
2024-06-05 14:19:28 +00:00
|
|
|
reporter: process.env.CI
|
|
|
|
? [ [ 'github' ], [ 'list' ], [ './flaky-tests-reporter.ts' ] ]
|
|
|
|
: 'list',
|
2023-04-17 12:01:41 +00:00
|
|
|
use: {
|
2023-05-05 11:03:36 +00:00
|
|
|
baseURL: BASE_URL,
|
2023-04-17 12:01:41 +00:00
|
|
|
screenshot: 'only-on-failure',
|
|
|
|
trace: 'retain-on-failure',
|
|
|
|
video: 'on-first-retry',
|
|
|
|
viewport: { width: 1280, height: 720 },
|
2023-05-05 11:03:36 +00:00
|
|
|
storageState: STORAGE_STATE_PATH,
|
2024-03-06 16:52:37 +00:00
|
|
|
actionTimeout: 10_000,
|
2024-03-27 09:54:44 +00:00
|
|
|
navigationTimeout: 10_000,
|
2023-04-17 12:01:41 +00:00
|
|
|
},
|
|
|
|
projects: [
|
|
|
|
{
|
2024-05-13 12:58:26 +00:00
|
|
|
name: 'chromium',
|
|
|
|
use: { ...devices[ 'Desktop Chrome' ] },
|
2023-05-05 11:03:36 +00:00
|
|
|
},
|
2023-04-17 12:01:41 +00:00
|
|
|
],
|
|
|
|
};
|
|
|
|
|
|
|
|
export default defineConfig( config );
|