-
-
Notifications
You must be signed in to change notification settings - Fork 20
/
playwright.config.base.ts
36 lines (31 loc) · 1.01 KB
/
playwright.config.base.ts
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
import { PlaywrightTestConfig } from '@playwright/test';
import * as dotenv from 'dotenv';
const ONE_SECOND = 1000;
const TEN_SECONDS = 10 * ONE_SECOND;
const THIRTY_SECONDS = 30 * ONE_SECOND;
const ONE_MINUTE = 60 * ONE_SECOND;
// Ensure tests run via VSCode debugger are run from the root of the repo
if (process.cwd().endsWith('/apps/jetstream-e2e')) {
process.chdir('../../');
}
dotenv.config();
const baseURL = process.env.CI ? 'http://localhost:3333/' : 'http://localhost:4200/';
export const baseConfig: PlaywrightTestConfig = {
retries: 3,
expect: {
timeout: THIRTY_SECONDS,
},
maxFailures: 2,
timeout: 120000,
workers: process.env.CI ? 1 : undefined,
reporter: [['html', { outputFolder: 'playwright-report', open: process.env.CI ? 'never' : 'on-failure' }]],
use: {
actionTimeout: THIRTY_SECONDS,
navigationTimeout: THIRTY_SECONDS,
baseURL,
permissions: ['notifications'],
trace: 'retain-on-failure',
screenshot: 'only-on-failure',
video: 'retain-on-failure',
},
};