forked from hmcts/cmc-ccd-e2e-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaywright.config.ts
67 lines (66 loc) · 2.03 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import { defineConfig, devices } from '@playwright/test';
import config from './playwright/config/config';
export default defineConfig({
testDir: './playwright/tests',
globalTeardown: './playwright/global/teardown',
forbidOnly: !!process.env.CI,
fullyParallel: true,
retries: process.env.CI ? 2 : 0,
workers: config.playwright.workers,
reporter: process.env.CI ? 'html' : 'list',
timeout: 8 * 30 * 1000,
expect: {
timeout: 20_000,
toPass: {
timeout: config.playwright.toPassTimeout,
},
},
use: {
headless: !config.showBrowserWindow,
video: 'retain-on-failure',
screenshot: 'only-on-failure',
trace: 'on-first-retry',
launchOptions: {
slowMo: !process.env.CI ? 500 : undefined,
},
},
projects: [
{
name: 'citizen-users-teardown',
testMatch: '**playwright/tests/bootstrap/users/citizen-users.teardown.ts',
},
{
name: 'citizen-users-setup',
testMatch: '**playwright/tests/bootstrap/users/citizen-users.setup.ts',
teardown: 'citizen-users-teardown',
},
{
name: 'citizen-auth-setup',
use: { ...devices['Desktop Chrome'] },
testMatch: '**playwright/tests/bootstrap/auth/citizen-auth.setup.ts',
dependencies: ['citizen-users-setup'],
teardown: 'citizen-auth-teardown',
},
{
name: 'citizen-auth-teardown',
use: { ...devices['Desktop Chrome'] },
testMatch: '**playwright/tests/bootstrap/auth/citizen-auth.teardown.ts',
},
{
name: 'caseworker-auth-setup',
use: { ...devices['Desktop Chrome'] },
testMatch: '**playwright/tests/bootstrap/auth/caseworker-auth.setup.ts',
teardown: 'caseworker-auth-teardown',
},
{
name: 'caseworker-auth-teardown',
use: { ...devices['Desktop Chrome'] },
testMatch: '**playwright/tests/bootstrap/auth/caseworker-auth.teardown.ts',
},
{
name: 'full-functional',
use: {...devices['Desktop Chrome'] },
dependencies: ['citizen-auth-setup', 'caseworker-auth-setup'],
},
],
});