playwright-performance-regression 0.1.0-next.3 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +388 -0
- package/README.md +53 -41
- package/dist/{chunk-MUZFQKGQ.js → chunk-4WX3Z5MJ.js} +321 -30
- package/dist/{chunk-AQ2XKYNV.js → chunk-5Y34Q4DR.js} +37 -9
- package/dist/chunk-B4XTLSRN.js +1788 -0
- package/dist/{chunk-44ASXVQN.cjs → chunk-PWK5XSP2.cjs} +337 -45
- package/dist/{chunk-DYLCGMI2.js → chunk-S6UH6QPK.js} +6 -1
- package/dist/{chunk-BAOTUUTV.cjs → chunk-VREOANPX.cjs} +75 -28
- package/dist/{chunk-2JO5HVPC.cjs → chunk-W7NEFS5V.cjs} +37 -9
- package/dist/{chunk-DX36GFOZ.js → chunk-YKBX6SAT.js} +94 -57
- package/dist/cli.js +1922 -3307
- package/dist/config.cjs +58 -120
- package/dist/config.d.cts +2 -3
- package/dist/config.d.ts +2 -3
- package/dist/config.js +48 -110
- package/dist/fixture.cjs +9 -5
- package/dist/fixture.d.cts +10 -4
- package/dist/fixture.d.ts +10 -4
- package/dist/fixture.js +4 -4
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts +22 -10
- package/dist/index.d.ts +22 -10
- package/dist/index.js +1 -1
- package/dist/perf-api-2DH_keLh.d.cts +17 -0
- package/dist/perf-api-2DH_keLh.d.ts +17 -0
- package/dist/reporter.cjs +2046 -835
- package/dist/reporter.js +6741 -1737
- package/dist/test.cjs +4 -4
- package/dist/test.js +4 -4
- package/package.json +17 -3
- package/schemas/config.schema.json +29 -14
- package/schemas/outcome.schema.json +1 -1
- package/schemas/run-report.schema.json +16 -2
- package/schemas/samples.schema.json +48 -2
- package/dist/chunk-LTRHMBVY.js +0 -5592
- package/dist/perf-api-Rm1h1O_-.d.cts +0 -12
- package/dist/perf-api-Rm1h1O_-.d.ts +0 -12
package/dist/test.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
3
|
+
var chunkPWK5XSP2_cjs = require('./chunk-PWK5XSP2.cjs');
|
|
4
|
+
require('./chunk-VREOANPX.cjs');
|
|
5
|
+
require('./chunk-W7NEFS5V.cjs');
|
|
6
6
|
var test$1 = require('@playwright/test');
|
|
7
7
|
|
|
8
|
-
var test =
|
|
8
|
+
var test = chunkPWK5XSP2_cjs.withPerfFixtures(test$1.test);
|
|
9
9
|
|
|
10
10
|
Object.defineProperty(exports, "expect", {
|
|
11
11
|
enumerable: true,
|
package/dist/test.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { withPerfFixtures } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import './chunk-
|
|
4
|
-
import './chunk-
|
|
1
|
+
import { withPerfFixtures } from './chunk-4WX3Z5MJ.js';
|
|
2
|
+
import './chunk-S6UH6QPK.js';
|
|
3
|
+
import './chunk-YKBX6SAT.js';
|
|
4
|
+
import './chunk-5Y34Q4DR.js';
|
|
5
5
|
import { test as test$1 } from '@playwright/test';
|
|
6
6
|
export { expect } from '@playwright/test';
|
|
7
7
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "playwright-performance-regression",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Catch backend performance regressions from the Playwright tests you already have.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"playwright",
|
|
@@ -83,6 +83,22 @@
|
|
|
83
83
|
"main": "./dist/index.cjs",
|
|
84
84
|
"module": "./dist/index.js",
|
|
85
85
|
"types": "./dist/index.d.cts",
|
|
86
|
+
"typesVersions": {
|
|
87
|
+
"*": {
|
|
88
|
+
"config": [
|
|
89
|
+
"./dist/config.d.cts"
|
|
90
|
+
],
|
|
91
|
+
"fixture": [
|
|
92
|
+
"./dist/fixture.d.cts"
|
|
93
|
+
],
|
|
94
|
+
"test": [
|
|
95
|
+
"./dist/test.d.cts"
|
|
96
|
+
],
|
|
97
|
+
"reporter": [
|
|
98
|
+
"./dist/reporter.d.cts"
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
},
|
|
86
102
|
"bin": {
|
|
87
103
|
"playwright-performance-regression": "dist/cli.js",
|
|
88
104
|
"pw-perf": "dist/cli.js"
|
|
@@ -110,8 +126,6 @@
|
|
|
110
126
|
"check:types-generated": "node scripts/generate-types.mjs --check",
|
|
111
127
|
"gen:html": "node scripts/build-html-assets.mjs",
|
|
112
128
|
"check:html-generated": "node scripts/build-html-assets.mjs --check",
|
|
113
|
-
"gen:ci": "node scripts/build-ci-templates.mjs",
|
|
114
|
-
"check:ci-generated": "node scripts/build-ci-templates.mjs --check",
|
|
115
129
|
"gen:docs": "node scripts/build-config-docs.mjs",
|
|
116
130
|
"check:docs-generated": "node scripts/build-config-docs.mjs --check",
|
|
117
131
|
"gen:config-template": "node scripts/build-config-template.mjs",
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
"default": {},
|
|
15
15
|
"properties": {
|
|
16
16
|
"env": {
|
|
17
|
-
"description": "Environment label (D-18). Overridden by PW_PERF_ENV
|
|
17
|
+
"description": "Environment label (D-18). Overridden by PW_PERF_ENV. Null: no label, one set of thresholds files.",
|
|
18
18
|
"$ref": "common.schema.json#/$defs/envLabelOrNull",
|
|
19
19
|
"default": null
|
|
20
20
|
},
|
|
21
21
|
"passes": {
|
|
22
|
-
"description": "Passes of the test command (D-03, D-39): the command runs once per pass and every test runs once in each pass. Overridden by PW_PERF_PASSES
|
|
22
|
+
"description": "Passes of the test command (D-03, D-39): the command runs once per pass and every test runs once in each pass. Overridden by PW_PERF_PASSES for the current mode.",
|
|
23
23
|
"type": "object",
|
|
24
24
|
"additionalProperties": false,
|
|
25
25
|
"default": {},
|
|
@@ -40,13 +40,8 @@
|
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
|
-
"projects": {
|
|
44
|
-
"description": "Which Playwright projects are measured in perf mode (D-13, D-22, D-39; behaviour: 04-REQ-18). 'auto': projects whose effective browser is Chromium (use.browserName, else use.defaultBrowserType from a device descriptor, else chromium; chrome/msedge channels count as Chromium) and which are neither a dependency nor a teardown of another project. A list: exactly these project names; a listed project that is also a dependency of another listed project is measured too.",
|
|
45
|
-
"oneOf": [{"const": "auto"}, {"type": "array", "items": {"type": "string"}, "minItems": 1, "uniqueItems": true}],
|
|
46
|
-
"default": "auto"
|
|
47
|
-
},
|
|
48
43
|
"grep": {
|
|
49
|
-
"description": "Only tests whose title or tags match this regular expression run in perf mode, e.g. '@perf' (03-REQ-25). Applied case-insensitively to the measured projects
|
|
44
|
+
"description": "Only tests whose title or tags match this regular expression run in perf mode, e.g. '@perf' (03-REQ-25). Applied case-insensitively to the projects that are measured (all but setup and teardown projects, 04-REQ-18); setup and teardown projects run in full. null: all tests.",
|
|
50
45
|
"oneOf": [{"type": "null"}, {"type": "string", "minLength": 1}],
|
|
51
46
|
"default": null
|
|
52
47
|
},
|
|
@@ -56,6 +51,11 @@
|
|
|
56
51
|
"uniqueItems": true,
|
|
57
52
|
"items": {"type": "string", "minLength": 1},
|
|
58
53
|
"default": []
|
|
54
|
+
},
|
|
55
|
+
"overrideSlowMo": {
|
|
56
|
+
"description": "Sets use.launchOptions.slowMo to 0 in every measured project in perf mode (03-REQ-27, D-45). slowMo delays every browser action and distorts the measured times; off by default because some tests are unstable without it. false: slowMo stays and perf mode warns about it (CONFIG_SLOW_MO).",
|
|
57
|
+
"type": "boolean",
|
|
58
|
+
"default": false
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
},
|
|
@@ -65,6 +65,11 @@
|
|
|
65
65
|
"additionalProperties": false,
|
|
66
66
|
"default": {},
|
|
67
67
|
"properties": {
|
|
68
|
+
"api": {
|
|
69
|
+
"description": "Requests the browser makes to the backend and calls of the request fixture, page.request and context.request (keys with the prefix 'request '), as keys of kind 'api' (05, 15, 03-REQ-28). false: no request is measured, the api thresholds file is neither read nor written, and only test.step durations are measured; measure.api and measure.steps cannot both be off.",
|
|
70
|
+
"type": "boolean",
|
|
71
|
+
"default": true
|
|
72
|
+
},
|
|
68
73
|
"resourceTypes": {
|
|
69
74
|
"description": "Playwright resource types that are measured. WebSocket traffic is not available as Request events in Playwright and cannot be measured (05).",
|
|
70
75
|
"type": "array",
|
|
@@ -121,10 +126,10 @@
|
|
|
121
126
|
"default": []
|
|
122
127
|
},
|
|
123
128
|
"exclude": {
|
|
124
|
-
"description": "Requests whose URL matches any pattern are skipped. Applied after include.",
|
|
129
|
+
"description": "Requests whose URL matches any pattern are skipped. Applied after include. The default skips the HTTP transports of socket.io, SockJS, SignalR and Blazor Server (handshakes, long polling, streaming).",
|
|
125
130
|
"type": "array",
|
|
126
131
|
"items": {"$ref": "#/$defs/urlPattern"},
|
|
127
|
-
"default": ["/socket.io/"]
|
|
132
|
+
"default": ["/socket.io/", "/sockjs/", "/sockjs-node/", "/signalr/", "/_blazor/"]
|
|
128
133
|
},
|
|
129
134
|
"excludeKnownThirdParty": {
|
|
130
135
|
"description": "Skip requests to the built-in list of analytics, tag manager, monitoring and chat hosts (05).",
|
|
@@ -140,8 +145,8 @@
|
|
|
140
145
|
"default": ["2xx", "3xx"]
|
|
141
146
|
},
|
|
142
147
|
"steps": {
|
|
143
|
-
"description": "Durations of test.step steps as keys of kind 'step' (06).
|
|
144
|
-
"default":
|
|
148
|
+
"description": "Durations of test.step steps as keys of kind 'step' (06). true (default) enables with defaults, false disables, an object enables with settings (03-REQ-18).",
|
|
149
|
+
"default": true,
|
|
145
150
|
"oneOf": [
|
|
146
151
|
{"type": "boolean"},
|
|
147
152
|
{
|
|
@@ -207,6 +212,11 @@
|
|
|
207
212
|
"type": "boolean",
|
|
208
213
|
"default": true
|
|
209
214
|
},
|
|
215
|
+
"prefixed": {
|
|
216
|
+
"description": "Ids with a prefix: 2-5 capital letters, '-' and at least 3 digits (ORD-1000), or 1-8 lowercase letters, '_' and at least 2 digits or 8-32 letters and digits with a digit (inv_58) (07-REQ-08).",
|
|
217
|
+
"type": "boolean",
|
|
218
|
+
"default": true
|
|
219
|
+
},
|
|
210
220
|
"email": {"description": "E-mail addresses, replaced with ':email' (07-REQ-08).", "type": "boolean", "default": true}
|
|
211
221
|
}
|
|
212
222
|
},
|
|
@@ -735,12 +745,17 @@
|
|
|
735
745
|
"default": {},
|
|
736
746
|
"properties": {
|
|
737
747
|
"dir": {
|
|
738
|
-
"description": "Directory of report.json and
|
|
748
|
+
"description": "Directory of report.json, report.html and junit.xml, relative to the Playwright config directory. Emptied when the first test of a test or thresholds run starts; never the project directory or a folder with thresholds files.",
|
|
739
749
|
"type": "string",
|
|
740
750
|
"minLength": 1,
|
|
741
|
-
"default": "pw-perf
|
|
751
|
+
"default": "reports/pw-perf"
|
|
742
752
|
},
|
|
743
753
|
"html": {"description": "Write the HTML report.", "type": "boolean", "default": true},
|
|
754
|
+
"junit": {
|
|
755
|
+
"description": "Write junit.xml next to report.json in test mode (16).",
|
|
756
|
+
"type": "boolean",
|
|
757
|
+
"default": true
|
|
758
|
+
},
|
|
744
759
|
"rawUrls": {
|
|
745
760
|
"description": "Include raw URLs of the slowest samples in the run report (D-11).",
|
|
746
761
|
"type": "boolean",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"$id": "https://pkg.invalid/schemas/outcome.schema.json",
|
|
4
4
|
"title": "Outcome file",
|
|
5
|
-
"description": "Small file the reporter writes at the end of onEnd to
|
|
5
|
+
"description": "Small file the reporter writes at the end of onEnd to <report.dir>/outcome.json in test and thresholds modes (04-REQ-62); a CI job reads it. Removed at the start of a run.",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"additionalProperties": false,
|
|
8
8
|
"required": ["schemaVersion", "runId", "mode", "exitCode", "tests", "evaluation", "toolErrors", "paths"],
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"testBreakdown"
|
|
34
34
|
],
|
|
35
35
|
"properties": {
|
|
36
|
-
"schemaVersion": {"const":
|
|
36
|
+
"schemaVersion": {"const": 4},
|
|
37
37
|
"tool": {"$ref": "common.schema.json#/$defs/tool"},
|
|
38
38
|
"runId": {"$ref": "common.schema.json#/$defs/runId"},
|
|
39
39
|
"mode": {"$ref": "common.schema.json#/$defs/mode"},
|
|
@@ -45,6 +45,16 @@
|
|
|
45
45
|
"type": "string",
|
|
46
46
|
"minLength": 1
|
|
47
47
|
},
|
|
48
|
+
"suite": {
|
|
49
|
+
"description": "What the report is about (02-REQ-42, 11-REQ-49): the name of the package.json in configDir (source package), else the Playwright config path relative to the repository root (source config). Left out when neither is known.",
|
|
50
|
+
"type": "object",
|
|
51
|
+
"additionalProperties": false,
|
|
52
|
+
"required": ["name", "source"],
|
|
53
|
+
"properties": {
|
|
54
|
+
"name": {"type": "string", "minLength": 1},
|
|
55
|
+
"source": {"enum": ["package", "config"]}
|
|
56
|
+
}
|
|
57
|
+
},
|
|
48
58
|
"config": {
|
|
49
59
|
"description": "Effective package config after merging with defaults (00, 4.4), in JSON form (02-REQ-17, 03).",
|
|
50
60
|
"$ref": "config.schema.json"
|
|
@@ -125,7 +135,11 @@
|
|
|
125
135
|
},
|
|
126
136
|
"browserName": {"oneOf": [{"type": "string"}, {"type": "null"}]},
|
|
127
137
|
"repeatEach": {"type": "integer", "minimum": 1},
|
|
128
|
-
"retries": {"type": "integer", "minimum": 0}
|
|
138
|
+
"retries": {"type": "integer", "minimum": 0},
|
|
139
|
+
"requestOnly": {
|
|
140
|
+
"description": "true for a measured project that recorded request calls and no browser sample (02-REQ-42); left out otherwise.",
|
|
141
|
+
"const": true
|
|
142
|
+
}
|
|
129
143
|
}
|
|
130
144
|
}
|
|
131
145
|
},
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
"description": "Raw samples collected during one test execution, attached to the test result as the 'pw-perf-samples' attachment (ADR-0003). In perf mode every test in a measured project gets this attachment, even when it is empty (05-REQ-15). Written by the collector, read by the reporter. Test metadata is not included; the reporter adds it from TestCase/TestResult.",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"additionalProperties": false,
|
|
8
|
-
"required": ["schemaVersion", "collector", "requests", "diagnostics"],
|
|
8
|
+
"required": ["schemaVersion", "collector", "requests", "apiRequests", "diagnostics"],
|
|
9
9
|
"properties": {
|
|
10
|
-
"schemaVersion": {"const":
|
|
10
|
+
"schemaVersion": {"const": 3},
|
|
11
11
|
"collector": {
|
|
12
12
|
"description": "Collector that produced the batch.",
|
|
13
13
|
"type": "object",
|
|
@@ -31,6 +31,11 @@
|
|
|
31
31
|
"type": "array",
|
|
32
32
|
"items": {"$ref": "#/$defs/requestSample"}
|
|
33
33
|
},
|
|
34
|
+
"apiRequests": {
|
|
35
|
+
"description": "Calls of APIRequestContext methods (request fixture, page.request, context.request, trackRequestContext; 15) in the order they finished; calls still running when the end-of-test wait ran out come last, with status PENDING. The reporter keys them with the prefix 'request ' (15-REQ-01).",
|
|
36
|
+
"type": "array",
|
|
37
|
+
"items": {"$ref": "#/$defs/apiRequestSample"}
|
|
38
|
+
},
|
|
34
39
|
"diagnostics": {
|
|
35
40
|
"description": "Collector diagnostics caught during the test (01-REQ-13, 05 §9). Repeated issues are collapsed using 'count'. The reporter turns every diagnostic into an entry in 'warnings' (09-REQ-23); none of them is a tool error.",
|
|
36
41
|
"type": "array",
|
|
@@ -38,6 +43,47 @@
|
|
|
38
43
|
}
|
|
39
44
|
},
|
|
40
45
|
"$defs": {
|
|
46
|
+
"apiRequestSample": {
|
|
47
|
+
"description": "One call of an APIRequestContext method, timed with the worker's clock (15-REQ-05).",
|
|
48
|
+
"type": "object",
|
|
49
|
+
"additionalProperties": false,
|
|
50
|
+
"required": ["method", "url", "status", "startTime", "duration", "source"],
|
|
51
|
+
"properties": {
|
|
52
|
+
"method": {"description": "HTTP method, uppercase (fetch without a method: GET).", "type": "string", "pattern": "^[A-Z]+$"},
|
|
53
|
+
"url": {
|
|
54
|
+
"description": "Called URL: absolute as given, a relative one resolved against the test's baseURL, otherwise response.url() or the text of the call (15-REQ-05). Never written to thresholds files (P-07).",
|
|
55
|
+
"type": "string",
|
|
56
|
+
"minLength": 1
|
|
57
|
+
},
|
|
58
|
+
"status": {
|
|
59
|
+
"description": "HTTP status code; FAILED when the call threw; PENDING when it was still running after the end-of-test wait (15-REQ-08).",
|
|
60
|
+
"oneOf": [{"type": "integer", "minimum": 100, "maximum": 599}, {"const": "FAILED"}, {"const": "PENDING"}]
|
|
61
|
+
},
|
|
62
|
+
"failureText": {
|
|
63
|
+
"description": "First line of the error message of the call. Present only when status is FAILED.",
|
|
64
|
+
"type": "string",
|
|
65
|
+
"minLength": 1
|
|
66
|
+
},
|
|
67
|
+
"startTime": {"description": "Date.now() when the method was called, whole ms.", "$ref": "common.schema.json#/$defs/epochMs"},
|
|
68
|
+
"duration": {
|
|
69
|
+
"description": "From the call to the settled promise (performance.now() in the worker), including reading the whole body. Null for FAILED and PENDING.",
|
|
70
|
+
"$ref": "common.schema.json#/$defs/msOrNull"
|
|
71
|
+
},
|
|
72
|
+
"source": {
|
|
73
|
+
"description": "request: the request fixture; context: page.request or context.request; tracked: a context passed to trackRequestContext(). Informational: all give keys with the same prefix (15-REQ-05).",
|
|
74
|
+
"enum": ["request", "context", "tracked"]
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
"if": {"properties": {"status": {"const": "FAILED"}}},
|
|
78
|
+
"then": {"required": ["failureText"]},
|
|
79
|
+
"else": {"not": {"required": ["failureText"]}},
|
|
80
|
+
"allOf": [
|
|
81
|
+
{
|
|
82
|
+
"if": {"properties": {"status": {"enum": ["FAILED", "PENDING"]}}},
|
|
83
|
+
"then": {"properties": {"duration": {"type": "null"}}}
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
},
|
|
41
87
|
"requestSample": {
|
|
42
88
|
"description": "One backend request observed in a tracked browser context, after collector filters (05).",
|
|
43
89
|
"type": "object",
|