forked from ydb-platform/ydb-embedded-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
65 lines (62 loc) · 2.09 KB
/
playwright.config.ts
File metadata and controls
65 lines (62 loc) · 2.09 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
60
61
62
63
64
65
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: 30 * 1000,
expect: {
toHaveScreenshot: {
maxDiffPixelRatio: 0.01,
animations: 'disabled',
},
},
outputDir: './playwright-artifacts/test-results',
reporter: process.env.CI
? [['blob', {outputDir: './blob-report'}]]
: [
['html', {outputFolder: './playwright-artifacts/playwright-report'}],
['json', {outputFile: './playwright-artifacts/test-results.json'}],
],
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 2 : undefined,
// If there is no url provided, playwright starts webServer with the app in dev mode
webServer: baseUrl
? undefined
: {
command: 'npm run dev',
env: {
REACT_APP_DISABLE_CHECKS: 'true',
REACT_APP_E2E_UI_OVERRIDES: 'true',
},
port: 3000,
reuseExistingServer: !process.env.CI,
},
use: {
baseURL: baseUrl || 'http://localhost:3000/',
testIdAttribute: 'data-qa',
trace: 'on-first-retry',
// Record video only on failure by default, can be overridden via PLAYWRIGHT_VIDEO env var
video:
(process.env.PLAYWRIGHT_VIDEO as 'on' | 'off' | 'retain-on-failure' | undefined) ||
'retain-on-failure',
screenshot: 'only-on-failure',
},
projects: [
{
name: 'chromium',
use: {
...devices['Desktop Chrome'],
contextOptions: {permissions: ['clipboard-read', 'clipboard-write']},
},
},
{
name: 'safari',
use: {
...devices['Desktop Safari'],
contextOptions: {permissions: ['clipboard-read']},
},
},
],
};
export default config;