-
Notifications
You must be signed in to change notification settings - Fork 92
/
playwright.config.ts
91 lines (85 loc) · 2.38 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
/*---------------------------------------------------------------------------------------------
* Copyright (C) 2024 Posit Software, PBC. All rights reserved.
* Licensed under the Elastic License 2.0. See LICENSE.txt for license information.
*--------------------------------------------------------------------------------------------*/
import { defineConfig } from '@playwright/test';
import { CustomTestOptions } from './test/e2e/areas/_test.setup';
import type { GitHubActionOptions } from '@midleman/github-actions-reporter';
import { currentsReporter } from '@currents/playwright';
/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig<CustomTestOptions>({
globalSetup: './test/e2e/areas/_global.setup.ts',
testDir: './test/e2e',
testIgnore: '**/example.test.ts',
testMatch: '*.test.ts',
fullyParallel: false, // Run individual tests w/in a spec in parallel
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 1 : 0,
workers: 3, // Number of parallel workers
timeout: 2 * 60 * 1000,
reportSlowTests: {
max: 10,
threshold: 60 * 1000, // 1 minute
},
expect: {
timeout: 15000,
},
reporter: process.env.CI
? [
// eslint-disable-next-line local/code-no-dangerous-type-assertions
['@midleman/github-actions-reporter', <GitHubActionOptions>{
title: '',
useDetails: true,
showError: true,
showAnnotations: false,
includeResults: ['fail', 'flaky']
}],
['junit', { outputFile: 'test-results/junit.xml' }],
['list'], ['html'], ['blob'],
currentsReporter({
ciBuildId: process.env.CURRENTS_CI_BUILD_ID || Date.now().toString(),
recordKey: process.env.CURRENTS_RECORD_KEY || '',
projectId: 'ZOs5z2',
disableTitleTags: true,
}),
]
: [
['list'],
['html', { open: 'on-failure' }],
],
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
headless: false,
trace: 'off', // we are manually handling tracing in _test.setup.ts
actionTimeout: 15000,
navigationTimeout: 15000,
},
projects: [
{
name: 'e2e-electron',
use: {
web: false,
artifactDir: 'e2e-electron'
},
},
{
name: 'e2e-browser',
use: {
web: true,
artifactDir: 'e2e-browser',
headless: false,
},
grep: /@web/
},
{
name: 'e2e-windows',
use: {
web: false,
artifactDir: 'e2e-windows',
},
grep: /@win/
},
],
});