-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathplaywright.config.ts
44 lines (41 loc) · 1.33 KB
/
playwright.config.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
37
38
39
40
41
42
43
44
import type {PlaywrightTestConfig} from '@playwright/test';
import {devices} from '@playwright/test';
const baseUrl = process.env.PLAYWRIGHT_BASE_URL;
const config: PlaywrightTestConfig = {
globalSetup: './tests/playwrightSetup.ts',
testDir: 'tests/suites',
timeout: 2 * 60 * 1000,
outputDir: './playwright-artifacts/test-results',
reporter: [
['html', {outputFolder: './playwright-artifacts/playwright-report'}],
['json', {outputFile: './playwright-artifacts/test-results.json'}],
],
retries: 2,
// If there is no url provided, playwright starts webServer with the app in dev mode
webServer: baseUrl
? undefined
: {
command: 'npm run dev',
port: 3000,
reuseExistingServer: true,
},
use: {
baseURL: baseUrl || 'http://localhost:3000/',
testIdAttribute: 'data-qa',
trace: 'on-first-retry',
// Always record video and take screenshots on main branch, otherwise only on failure
video: 'retain-on-failure',
screenshot: 'only-on-failure',
},
projects: [
{
name: 'chromium',
use: {...devices['Desktop Chrome']},
},
{
name: 'safari',
use: {...devices['Desktop Safari']},
},
],
};
export default config;