-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathplaywright.config.ts
101 lines (95 loc) · 2.49 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
import { defineConfig, devices } from '@playwright/test';
import { API_KEY } from './src/env.ts';
import path from 'path';
import dotenv from 'dotenv';
dotenv.config();
export const STORAGE_STATE = path.join(__dirname, 'playwright/.auth/user.json');
export default defineConfig({
testDir: './tests',
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : 1,
reporter: [['list', { printSteps: true }]],
timeout: 800000,
expect: {timeout: 800000},
use: {
browserName: 'chromium',
baseURL: process.env.KIBANA_HOST,
trace: 'on-first-retry',
testIdAttribute: 'data-test-subj',
video: {
mode: 'off',
size: {width: 1920, height: 1200}},
permissions: ["clipboard-read"],
},
projects: [
{
name: 'stateful_auth',
testMatch: 'stateful.auth.ts',
use: {
viewport: {width: 1920, height: 1080},
}
},
{
name: 'serverless_auth',
testMatch: 'serverless.auth.ts',
use: {
testIdAttribute: 'data-test-id',
viewport: {width: 1920, height: 1080},
},
},
{
name: 'stateful_teardown',
testMatch: 'stateful.teardown.setup.ts',
use: {
viewport: {width: 1920, height: 1080},
storageState: STORAGE_STATE,
testIdAttribute: 'data-test-subj',
},
},
{
name: 'serverless_teardown',
testMatch: 'serverless.teardown.setup.ts',
use: {
viewport: {width: 1920, height: 1080},
storageState: STORAGE_STATE,
testIdAttribute: 'data-test-subj',
},
},
{
name: 'stateful',
testMatch: '**\/*.stateful.spec.ts',
use: {
...devices['Desktop Chrome'],
viewport: {width: 1920, height: 1200},
storageState: STORAGE_STATE,
},
dependencies: ['stateful_auth'],
},
{
name: 'serverless',
testMatch: '**\/*.serverless.spec.ts',
use: {
...devices['Desktop Chrome'],
viewport: {width: 1920, height: 1200},
storageState: STORAGE_STATE,
},
dependencies: ['serverless_auth'],
},
{
name: 'api',
testMatch: '**\/*.api.spec.ts',
use: {
extraHTTPHeaders: {
"accept": "application/json",
"Authorization": API_KEY,
"Content-Type": "application/json;charset=UTF-8",
"kbn-xsrf": "true",
"x-elastic-internal-origin": "kibana"
},
},
dependencies: [],
},
],
});