-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
65 lines (63 loc) · 1.72 KB
/
playwright.config.ts
File metadata and controls
65 lines (63 loc) · 1.72 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 {defineConfig, devices} from '@playwright/test';
import type {Options, ResultAccumulator} from '../lib';
import {nativeChromiumObservers, nativePresenters} from '../lib';
const PlaywrightPerformanceReporterOptions: Options = {
deleteOnFailure: false,
presenters: [
new nativePresenters.jsonChunkPresenter({outputDir: './', outputFile: 'example-json-writer.json'}),
new nativePresenters.chartPresenter({outputDir: './', outputFile: 'example-chart-presenter.html'})
],
browsers: {
chromium: {
onTest: {
metrics: [
new nativeChromiumObservers.allPerformanceMetrics()
],
},
onTestStep: {
metrics: [
new nativeChromiumObservers.allPerformanceMetrics()
],
},
sampling: {
metrics: [
{
samplingTimeoutInMilliseconds: 1000,
metric: new nativeChromiumObservers.allPerformanceMetrics(),
},
{
samplingTimeoutInMilliseconds: 1000,
metric: new nativeChromiumObservers.networkActivity({includeDetailsInSampling: false, triggerGarbageCollectionOnObserve: false}),
}
]
}
}
}
}
export default defineConfig({
testDir: './tests',
fullyParallel: false,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: 1,
reporter: [
['../lib', PlaywrightPerformanceReporterOptions]
],
use: {
trace: 'on-first-retry',
},
projects: [
{
name: 'chromium',
use: {
...devices['Desktop Chrome'],
launchOptions: {
args: [
'--remote-debugging-port=9222',
'--js-flags="--predictable-gc-schedule --gc-interval=1000"'
]
}
},
},
],
});