forked from lidofinance/csm-widget
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
55 lines (52 loc) · 1.51 KB
/
playwright.config.ts
File metadata and controls
55 lines (52 loc) · 1.51 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
import type { PlaywrightTestConfig } from '@playwright/test';
import { widgetFullConfig } from 'tests/config';
import { getReportConfig } from 'tests/config/report.config';
import { storageState } from 'tests/config/storageState';
import { prepareGrep } from 'tests/helpers/tests';
// TODO: move it pls
export const httpCredentials =
process.env.PREVIEW_STAND_LOGIN && process.env.PREVIEW_STAND_PASSWORD
? {
username: process.env.PREVIEW_STAND_LOGIN,
password: process.env.PREVIEW_STAND_PASSWORD,
}
: undefined;
const config: PlaywrightTestConfig = {
testDir: './tests',
timeout: 180 * 1000,
expect: {
timeout: 5000,
},
fullyParallel: false,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 1 : 0,
workers: 1,
reporter: getReportConfig(),
use: {
storageState,
headless: false,
actionTimeout: 15000,
screenshot: { fullPage: true, mode: 'only-on-failure' },
baseURL: widgetFullConfig.standConfig.standUrl,
trace: 'on-first-retry',
permissions: ['clipboard-read'],
contextOptions: {
reducedMotion: 'reduce',
},
httpCredentials: httpCredentials,
},
projects: [
{
name: 'widget',
testDir: './tests',
grep: prepareGrep(process.env.TEST_TAGS),
use: {
// @ts-expect-error because pw doesnt have custom types
useFork: process.env.USE_FORK === 'true',
},
},
],
globalSetup: './tests/config/globalSetup.ts',
globalTeardown: './tests/config/globalTeardown.ts',
};
export default config;