playwright-performance-regression 0.1.0-next.1 → 0.1.0-next.4
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 +431 -0
- package/README.md +96 -64
- package/dist/{chunk-L5C63HEF.js → chunk-CISGJCFW.js} +378 -48
- package/dist/chunk-CXE5IWZY.js +1648 -0
- package/dist/{chunk-B64P2D5A.js → chunk-E2IX265O.js} +395 -206
- package/dist/chunk-IUI4AFE5.cjs +658 -0
- package/dist/{chunk-WZVQK7CQ.cjs → chunk-KELMALEG.cjs} +408 -218
- package/dist/{chunk-GCA73FFP.cjs → chunk-LUA4WRIQ.cjs} +382 -47
- package/dist/chunk-RL27E3AB.js +595 -0
- package/dist/{chunk-DYLCGMI2.js → chunk-S6UH6QPK.js} +6 -1
- package/dist/cli.js +2761 -2339
- package/dist/config.cjs +122 -137
- package/dist/config.d.cts +3 -2
- package/dist/config.d.ts +3 -2
- package/dist/config.js +117 -132
- 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 +121 -25
- package/dist/index.d.ts +121 -25
- 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 +5713 -1237
- package/dist/reporter.js +6905 -693
- package/dist/test.cjs +4 -4
- package/dist/test.js +4 -4
- package/package.json +19 -1
- package/schemas/common.schema.json +2 -2
- package/schemas/config.schema.json +72 -26
- package/schemas/outcome.schema.json +2 -2
- package/schemas/run-report.schema.json +549 -20
- package/schemas/samples.schema.json +48 -37
- package/schemas/thresholds.schema.json +1 -1
- package/dist/chunk-3CLCMD2Q.js +0 -3411
- package/dist/chunk-4SFI55HF.cjs +0 -319
- package/dist/chunk-HBGADXLP.js +0 -254
- package/dist/perf-api-V4PeHVE0.d.cts +0 -22
- package/dist/perf-api-V4PeHVE0.d.ts +0 -22
package/dist/config.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { setRegistered } from './chunk-
|
|
2
|
-
import { readModeState, ConfigError,
|
|
3
|
-
import { resolveConfig } from './chunk-
|
|
4
|
-
export { definePerfConfig } from './chunk-
|
|
1
|
+
import { setRegistered } from './chunk-S6UH6QPK.js';
|
|
2
|
+
import { readModeState, ConfigError, version, RUN_ID_ENV, generateRunId, argvWarnings, PACKAGE_NAME } from './chunk-RL27E3AB.js';
|
|
3
|
+
import { resolveConfig } from './chunk-CISGJCFW.js';
|
|
4
|
+
export { definePerfConfig } from './chunk-CISGJCFW.js';
|
|
5
5
|
|
|
6
6
|
// src/config/reporter-path.ts
|
|
7
7
|
function currentFile() {
|
|
@@ -24,12 +24,6 @@ var PACKAGE_REPORTER = `${PACKAGE_NAME}/reporter`;
|
|
|
24
24
|
function projectName(project) {
|
|
25
25
|
return project.name ?? "";
|
|
26
26
|
}
|
|
27
|
-
function browserOf(project, config) {
|
|
28
|
-
return project?.use?.browserName ?? config.use?.browserName ?? project?.use?.defaultBrowserType ?? config.use?.defaultBrowserType ?? "chromium";
|
|
29
|
-
}
|
|
30
|
-
function quoted(names) {
|
|
31
|
-
return names.map((name) => JSON.stringify(name)).join(", ");
|
|
32
|
-
}
|
|
33
27
|
function records(value) {
|
|
34
28
|
if (value === void 0 || value === "off") return false;
|
|
35
29
|
if (typeof value === "object" && value !== null && "mode" in value) return value.mode !== "off";
|
|
@@ -41,57 +35,26 @@ function positive(value) {
|
|
|
41
35
|
function artifactsOff(use) {
|
|
42
36
|
return { ...use, trace: "off", video: "off", screenshot: "off" };
|
|
43
37
|
}
|
|
44
|
-
function
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
hint: 'Use project names from the Playwright config, or "auto".'
|
|
58
|
-
}))
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
return { ok: true, value: names.filter((name) => option.includes(name)) };
|
|
62
|
-
}
|
|
38
|
+
function andGrep(extra, own) {
|
|
39
|
+
if (own === void 0) return new RegExp(extra, "i");
|
|
40
|
+
const list = Array.isArray(own) ? own : [own];
|
|
41
|
+
const flags = /* @__PURE__ */ new Set(["i", ...list.flatMap((re) => [...re.flags])]);
|
|
42
|
+
flags.delete("g");
|
|
43
|
+
flags.delete("y");
|
|
44
|
+
const ownSource = list.map((re) => `(?:${re.source})`).join("|");
|
|
45
|
+
return new RegExp(
|
|
46
|
+
`^(?=[\\s\\S]*?(?:${extra}))(?=[\\s\\S]*?(?:${ownSource}))`,
|
|
47
|
+
[...flags].sort().join("")
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
function measurableProjects(projects) {
|
|
63
51
|
const supporting = new Set(
|
|
64
52
|
projects.flatMap((p) => [
|
|
65
53
|
...p.dependencies ?? [],
|
|
66
54
|
...p.teardown === void 0 ? [] : [p.teardown]
|
|
67
55
|
])
|
|
68
56
|
);
|
|
69
|
-
|
|
70
|
-
if (measured.length > 0) return { ok: true, value: measured };
|
|
71
|
-
return {
|
|
72
|
-
ok: false,
|
|
73
|
-
issues: [
|
|
74
|
-
{
|
|
75
|
-
code: "CONFIG_NO_MEASURED_PROJECT",
|
|
76
|
-
path: "run.projects",
|
|
77
|
-
message: 'run.projects: no project is measured; "auto" measures Chromium projects that are not a dependency or teardown of another project, and the Playwright config has none',
|
|
78
|
-
hint: 'List the projects to measure in run.projects, e.g. ["firefox"].'
|
|
79
|
-
}
|
|
80
|
-
]
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
function projectsToKeep(projects, measured) {
|
|
84
|
-
const byName = new Map(projects.map((p) => [projectName(p), p]));
|
|
85
|
-
const keep = /* @__PURE__ */ new Set();
|
|
86
|
-
const visit = (name) => {
|
|
87
|
-
const project = byName.get(name);
|
|
88
|
-
if (project === void 0 || keep.has(name)) return;
|
|
89
|
-
keep.add(name);
|
|
90
|
-
for (const dependency of project.dependencies ?? []) visit(dependency);
|
|
91
|
-
if (project.teardown !== void 0) visit(project.teardown);
|
|
92
|
-
};
|
|
93
|
-
for (const name of measured) visit(name);
|
|
94
|
-
return keep;
|
|
57
|
+
return projects.map(projectName).filter((name) => !supporting.has(name));
|
|
95
58
|
}
|
|
96
59
|
function reporterEntries(reporter) {
|
|
97
60
|
if (reporter === void 0) return [];
|
|
@@ -104,9 +67,13 @@ function planReporters(reporter, input) {
|
|
|
104
67
|
const ours = (name) => name === input.reporterPath || name === PACKAGE_REPORTER;
|
|
105
68
|
const kept = [];
|
|
106
69
|
const removed = [];
|
|
70
|
+
const replaced = [];
|
|
107
71
|
for (const entry of reporterEntries(reporter)) {
|
|
108
72
|
const [name, options] = entry;
|
|
109
|
-
if (
|
|
73
|
+
if (name === "list" && !input.keepReporters.includes(name)) {
|
|
74
|
+
if (!replaced.includes(name)) replaced.push(name);
|
|
75
|
+
kept.push(["dot"]);
|
|
76
|
+
} else if (!CONSOLE_REPORTERS.has(name) && !input.keepReporters.includes(name) && !ours(name)) {
|
|
110
77
|
removed.push(name);
|
|
111
78
|
} else if (name === "html") {
|
|
112
79
|
kept.push([name, { ...options, open: "never" }]);
|
|
@@ -114,129 +81,117 @@ function planReporters(reporter, input) {
|
|
|
114
81
|
kept.push(entry);
|
|
115
82
|
}
|
|
116
83
|
}
|
|
84
|
+
const firstDot = kept.findIndex(([name]) => name === "dot");
|
|
85
|
+
const deduped = kept.filter(([name], i) => name !== "dot" || i === firstDot);
|
|
117
86
|
const reporters = [];
|
|
118
|
-
if (!
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
reporters
|
|
122
|
-
if (!kept.some(([name]) => ours(name))) reporters.push([input.reporterPath]);
|
|
123
|
-
return { reporters, removed };
|
|
87
|
+
if (!deduped.some(([name]) => CONSOLE_REPORTERS.has(name))) reporters.push(["dot"]);
|
|
88
|
+
reporters.push(...deduped);
|
|
89
|
+
if (!deduped.some(([name]) => ours(name))) reporters.push([input.reporterPath]);
|
|
90
|
+
return { reporters, removed, replaced };
|
|
124
91
|
}
|
|
125
|
-
function
|
|
92
|
+
function effectiveLaunchOptions(config, project) {
|
|
93
|
+
return project?.use?.launchOptions ?? config.use?.launchOptions;
|
|
94
|
+
}
|
|
95
|
+
function measuredLaunchOptions(config, measured) {
|
|
96
|
+
if (config.projects === void 0) return [config.use?.launchOptions];
|
|
97
|
+
return config.projects.filter((p) => measured.has(projectName(p))).map((p) => effectiveLaunchOptions(config, p));
|
|
98
|
+
}
|
|
99
|
+
function overriddenSettings(config, kept, slowMoOverridden) {
|
|
126
100
|
const scopes = [config, ...kept];
|
|
127
|
-
const repeatChanged =
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
});
|
|
101
|
+
const repeatChanged = [config, ...kept].some(
|
|
102
|
+
(scope) => scope.repeatEach !== void 0 && scope.repeatEach !== 1
|
|
103
|
+
);
|
|
131
104
|
const changed = [
|
|
132
105
|
["workers", config.workers !== 1],
|
|
133
|
-
["retries", scopes.some((scope) => positive(scope.retries))],
|
|
134
106
|
["repeatEach", repeatChanged],
|
|
135
107
|
["maxFailures", positive(config.maxFailures)],
|
|
136
108
|
["globalTimeout", positive(config.globalTimeout)],
|
|
137
109
|
...ARTIFACTS.map((name) => [
|
|
138
110
|
name,
|
|
139
111
|
scopes.some((scope) => records(scope.use?.[name]))
|
|
140
|
-
])
|
|
112
|
+
]),
|
|
113
|
+
["slowMo", slowMoOverridden]
|
|
141
114
|
];
|
|
142
115
|
return changed.filter(([, value]) => value).map(([name]) => name);
|
|
143
116
|
}
|
|
144
|
-
function slowMoWarnings(config, kept) {
|
|
145
|
-
const places = [
|
|
146
|
-
...positive(config.use?.launchOptions?.slowMo) ? ["the global config"] : [],
|
|
147
|
-
...kept.filter((p) => positive(p.use?.launchOptions?.slowMo)).map((p) => `project ${JSON.stringify(projectName(p))}`)
|
|
148
|
-
];
|
|
149
|
-
if (places.length === 0) return [];
|
|
150
|
-
return [
|
|
151
|
-
{
|
|
152
|
-
code: "CONFIG_SLOW_MO",
|
|
153
|
-
path: "use.launchOptions.slowMo",
|
|
154
|
-
message: `use.launchOptions.slowMo: is greater than 0 in ${places.join(", ")}; it slows down every browser action and distorts the measured times`,
|
|
155
|
-
hint: "Remove slowMo from the Playwright config for the measurement run."
|
|
156
|
-
}
|
|
157
|
-
];
|
|
158
|
-
}
|
|
159
|
-
function enginesWarnings(config, projects, measured) {
|
|
160
|
-
const byName = new Map(projects.map((p) => [projectName(p), p]));
|
|
161
|
-
const engines = [...new Set(measured.map((name) => browserOf(byName.get(name), config)))];
|
|
162
|
-
if (engines.length < 2) return [];
|
|
163
|
-
return [
|
|
164
|
-
{
|
|
165
|
-
code: "CONFIG_MULTIPLE_ENGINES",
|
|
166
|
-
path: "run.projects",
|
|
167
|
-
message: `run.projects: the measured projects use more than one browser engine (${engines.join(", ")}); their samples go to the same keys`,
|
|
168
|
-
hint: "Measure one browser engine per run: list projects of one engine in run.projects."
|
|
169
|
-
}
|
|
170
|
-
];
|
|
171
|
-
}
|
|
172
117
|
function planPerfRun(config, input) {
|
|
173
118
|
const source = config;
|
|
174
119
|
const projects = source.projects ?? [{}];
|
|
175
|
-
const measured =
|
|
176
|
-
|
|
177
|
-
const measuredSet = new Set(measured.value);
|
|
178
|
-
const keep = projectsToKeep(projects, measured.value);
|
|
179
|
-
const kept = source.projects === void 0 ? [] : projects.filter((p) => keep.has(projectName(p)));
|
|
180
|
-
const removedProjects = source.projects === void 0 ? [] : projects.filter((p) => !keep.has(projectName(p))).map(projectName);
|
|
181
|
-
const { reporters, removed } = planReporters(source.reporter, input);
|
|
120
|
+
const measured = measurableProjects(projects);
|
|
121
|
+
const { reporters, removed, replaced } = planReporters(source.reporter, input);
|
|
182
122
|
const result = {
|
|
183
123
|
...source,
|
|
184
124
|
workers: 1,
|
|
185
|
-
retries: 0,
|
|
186
125
|
maxFailures: 0,
|
|
187
126
|
globalTimeout: 0,
|
|
188
127
|
use: artifactsOff(source.use),
|
|
189
128
|
reporter: reporters
|
|
190
129
|
};
|
|
191
|
-
|
|
192
|
-
|
|
130
|
+
result.repeatEach = 1;
|
|
131
|
+
const grep = input.grep ?? null;
|
|
132
|
+
const overrideSlowMo = input.overrideSlowMo ?? false;
|
|
133
|
+
const kept = source.projects ?? [];
|
|
134
|
+
const measuredSet = new Set(measured);
|
|
135
|
+
if (source.projects !== void 0) {
|
|
136
|
+
result.projects = kept.map((p) => {
|
|
137
|
+
const project = { ...p, repeatEach: 1, use: artifactsOff(p.use) };
|
|
138
|
+
const isMeasured = measuredSet.has(projectName(p));
|
|
139
|
+
if (grep !== null && isMeasured) {
|
|
140
|
+
project.grep = andGrep(grep, p.grep ?? source.grep);
|
|
141
|
+
}
|
|
142
|
+
if (overrideSlowMo && isMeasured) {
|
|
143
|
+
project.use = {
|
|
144
|
+
...project.use,
|
|
145
|
+
launchOptions: { ...effectiveLaunchOptions(source, p), slowMo: 0 }
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
return project;
|
|
149
|
+
});
|
|
193
150
|
} else {
|
|
194
|
-
result.
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
use: artifactsOff(p.use)
|
|
199
|
-
}));
|
|
151
|
+
if (grep !== null) result.grep = andGrep(grep, source.grep);
|
|
152
|
+
if (overrideSlowMo) {
|
|
153
|
+
result.use = { ...result.use, launchOptions: { ...source.use?.launchOptions, slowMo: 0 } };
|
|
154
|
+
}
|
|
200
155
|
}
|
|
156
|
+
const slowMoOverridden = overrideSlowMo && measuredLaunchOptions(source, measuredSet).some((options) => positive(options?.slowMo));
|
|
201
157
|
return {
|
|
202
158
|
ok: true,
|
|
203
159
|
value: {
|
|
204
160
|
config: result,
|
|
205
|
-
measuredProjects: measured
|
|
161
|
+
measuredProjects: measured,
|
|
206
162
|
runConditions: {
|
|
207
|
-
overridden: overriddenSettings(source, kept,
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
}
|
|
211
|
-
warnings: [
|
|
212
|
-
...enginesWarnings(source, projects, measured.value),
|
|
213
|
-
...slowMoWarnings(source, kept)
|
|
214
|
-
]
|
|
163
|
+
overridden: overriddenSettings(source, kept, slowMoOverridden),
|
|
164
|
+
removedReporters: removed,
|
|
165
|
+
replacedReporters: replaced
|
|
166
|
+
}
|
|
215
167
|
}
|
|
216
168
|
};
|
|
217
169
|
}
|
|
218
170
|
|
|
219
171
|
// src/config/with-perf.ts
|
|
220
172
|
function withPerf(config, perfConfig) {
|
|
173
|
+
const first = readModeState(process.env);
|
|
174
|
+
if (!first.ok) throw new ConfigError(first.issues);
|
|
175
|
+
if (first.value === null) return config;
|
|
176
|
+
const argvIssues = mainProcessSetup(first.value.mode);
|
|
221
177
|
const mode = readModeState(process.env);
|
|
222
|
-
if (!mode.ok) throw new
|
|
223
|
-
if (mode.value === null) return config;
|
|
178
|
+
if (!mode.ok || mode.value === null) throw new Error("withPerf: the mode state changed");
|
|
224
179
|
const state = mode.value;
|
|
225
180
|
const resolved = resolveConfig(perfConfig, {
|
|
226
|
-
mode: state.mode,
|
|
227
|
-
...state
|
|
228
|
-
...state.env === void 0 ? {} : { env: state.env }
|
|
181
|
+
mode: state.mode === "check" ? "test" : state.mode,
|
|
182
|
+
...passesOverride(state),
|
|
183
|
+
...state.env === void 0 ? {} : { env: state.env },
|
|
184
|
+
...state.thresholdsDir === void 0 ? {} : { thresholdsDir: state.thresholdsDir },
|
|
185
|
+
...state.minSamples === void 0 ? {} : { minSamples: state.minSamples }
|
|
229
186
|
});
|
|
230
187
|
if (!resolved.ok) throw new ConfigError(resolved.issues);
|
|
231
188
|
const { config: perf, snapshot, warnings } = resolved.value;
|
|
232
189
|
const plan = planPerfRun(config, {
|
|
233
|
-
projects: perf.run.projects,
|
|
234
190
|
keepReporters: perf.run.keepReporters,
|
|
235
|
-
|
|
236
|
-
|
|
191
|
+
grep: perf.run.grep,
|
|
192
|
+
overrideSlowMo: perf.run.overrideSlowMo,
|
|
237
193
|
reporterPath: reporterEntryPath()
|
|
238
194
|
});
|
|
239
|
-
if (!plan.ok) throw new ConfigError(plan.issues);
|
|
240
195
|
setRegistered({
|
|
241
196
|
config: perf,
|
|
242
197
|
snapshot,
|
|
@@ -244,9 +199,39 @@ function withPerf(config, perfConfig) {
|
|
|
244
199
|
packageVersion: version,
|
|
245
200
|
measuredProjects: plan.value.measuredProjects,
|
|
246
201
|
runConditions: plan.value.runConditions,
|
|
247
|
-
warnings: [...warnings, ...
|
|
202
|
+
warnings: [...warnings, ...argvIssues],
|
|
203
|
+
perfConfigPassed: perfConfig !== void 0
|
|
248
204
|
});
|
|
249
205
|
return plan.value.config;
|
|
250
206
|
}
|
|
207
|
+
function passesOverride(state) {
|
|
208
|
+
if (state.mode === "check") return {};
|
|
209
|
+
if (state.pass !== void 0) return { passes: state.pass.total };
|
|
210
|
+
return state.passes === void 0 ? {} : { passes: state.passes };
|
|
211
|
+
}
|
|
212
|
+
var SETUP_DONE = /* @__PURE__ */ Symbol.for("playwright-performance-regression.mainProcessSetup");
|
|
213
|
+
function mainProcessSetup(mode) {
|
|
214
|
+
if (process.env.TEST_WORKER_INDEX !== void 0) return [];
|
|
215
|
+
const store = globalThis;
|
|
216
|
+
const done = store[SETUP_DONE];
|
|
217
|
+
if (done !== void 0) return done;
|
|
218
|
+
if ((process.env[RUN_ID_ENV] ?? "") === "") {
|
|
219
|
+
process.env[RUN_ID_ENV] = generateRunId(/* @__PURE__ */ new Date(), Math.random);
|
|
220
|
+
}
|
|
221
|
+
const found = argvWarnings(process.argv, PACKAGE_NAME, mode);
|
|
222
|
+
if (found.reporter !== null && mode !== "check") throw new ConfigError([found.reporter]);
|
|
223
|
+
const report = [];
|
|
224
|
+
for (const issue of [found.reporter, found.unsupported]) {
|
|
225
|
+
if (issue === null) continue;
|
|
226
|
+
process.stderr.write(
|
|
227
|
+
`${PACKAGE_NAME}: warning ${issue.code}: ${issue.message}
|
|
228
|
+
Hint: ${issue.hint}
|
|
229
|
+
`
|
|
230
|
+
);
|
|
231
|
+
}
|
|
232
|
+
if (found.unsupported !== null) report.push(found.unsupported);
|
|
233
|
+
store[SETUP_DONE] = report;
|
|
234
|
+
return report;
|
|
235
|
+
}
|
|
251
236
|
|
|
252
237
|
export { withPerf };
|
package/dist/fixture.cjs
CHANGED
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
3
|
+
var chunkKELMALEG_cjs = require('./chunk-KELMALEG.cjs');
|
|
4
|
+
require('./chunk-IUI4AFE5.cjs');
|
|
5
|
+
require('./chunk-LUA4WRIQ.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
Object.defineProperty(exports, "trackContext", {
|
|
10
10
|
enumerable: true,
|
|
11
|
-
get: function () { return
|
|
11
|
+
get: function () { return chunkKELMALEG_cjs.trackContext; }
|
|
12
|
+
});
|
|
13
|
+
Object.defineProperty(exports, "trackRequestContext", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function () { return chunkKELMALEG_cjs.trackRequestContext; }
|
|
12
16
|
});
|
|
13
17
|
Object.defineProperty(exports, "withPerfFixtures", {
|
|
14
18
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
19
|
+
get: function () { return chunkKELMALEG_cjs.withPerfFixtures; }
|
|
16
20
|
});
|
package/dist/fixture.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { TestType, BrowserContext } from '@playwright/test';
|
|
2
|
-
import { P as PerfFixtures } from './perf-api-
|
|
3
|
-
export { a as PerfApi } from './perf-api-
|
|
1
|
+
import { TestType, BrowserContext, APIRequestContext } from '@playwright/test';
|
|
2
|
+
import { P as PerfFixtures } from './perf-api-2DH_keLh.cjs';
|
|
3
|
+
export { a as PerfApi } from './perf-api-2DH_keLh.cjs';
|
|
4
4
|
|
|
5
5
|
/** `base` with the `perf` fixture added; other fixtures and options keep their types. */
|
|
6
6
|
type PerfTestType<T> = T extends TestType<infer TestArgs, infer WorkerArgs> ? TestType<TestArgs & PerfFixtures, WorkerArgs> : never;
|
|
@@ -17,6 +17,12 @@ declare function withPerfFixtures<T extends TestType<any, any>>(base: T): PerfTe
|
|
|
17
17
|
* outside perf mode.
|
|
18
18
|
*/
|
|
19
19
|
declare function trackContext(context: BrowserContext): void;
|
|
20
|
+
/**
|
|
21
|
+
* Measures the calls of an APIRequestContext created with playwright.request.newContext(), also
|
|
22
|
+
* in a worker-scoped fixture (15-REQ-03): each call made during a test of a measured project is
|
|
23
|
+
* recorded by that test. Does nothing outside perf mode or with measure.api off.
|
|
24
|
+
*/
|
|
25
|
+
declare function trackRequestContext(requestContext: APIRequestContext): void;
|
|
20
26
|
|
|
21
|
-
export { PerfFixtures, trackContext, withPerfFixtures };
|
|
27
|
+
export { PerfFixtures, trackContext, trackRequestContext, withPerfFixtures };
|
|
22
28
|
export type { PerfTestType };
|
package/dist/fixture.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { TestType, BrowserContext } from '@playwright/test';
|
|
2
|
-
import { P as PerfFixtures } from './perf-api-
|
|
3
|
-
export { a as PerfApi } from './perf-api-
|
|
1
|
+
import { TestType, BrowserContext, APIRequestContext } from '@playwright/test';
|
|
2
|
+
import { P as PerfFixtures } from './perf-api-2DH_keLh.js';
|
|
3
|
+
export { a as PerfApi } from './perf-api-2DH_keLh.js';
|
|
4
4
|
|
|
5
5
|
/** `base` with the `perf` fixture added; other fixtures and options keep their types. */
|
|
6
6
|
type PerfTestType<T> = T extends TestType<infer TestArgs, infer WorkerArgs> ? TestType<TestArgs & PerfFixtures, WorkerArgs> : never;
|
|
@@ -17,6 +17,12 @@ declare function withPerfFixtures<T extends TestType<any, any>>(base: T): PerfTe
|
|
|
17
17
|
* outside perf mode.
|
|
18
18
|
*/
|
|
19
19
|
declare function trackContext(context: BrowserContext): void;
|
|
20
|
+
/**
|
|
21
|
+
* Measures the calls of an APIRequestContext created with playwright.request.newContext(), also
|
|
22
|
+
* in a worker-scoped fixture (15-REQ-03): each call made during a test of a measured project is
|
|
23
|
+
* recorded by that test. Does nothing outside perf mode or with measure.api off.
|
|
24
|
+
*/
|
|
25
|
+
declare function trackRequestContext(requestContext: APIRequestContext): void;
|
|
20
26
|
|
|
21
|
-
export { PerfFixtures, trackContext, withPerfFixtures };
|
|
27
|
+
export { PerfFixtures, trackContext, trackRequestContext, withPerfFixtures };
|
|
22
28
|
export type { PerfTestType };
|
package/dist/fixture.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { trackContext, withPerfFixtures } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import './chunk-
|
|
4
|
-
import './chunk-
|
|
1
|
+
export { trackContext, trackRequestContext, withPerfFixtures } from './chunk-E2IX265O.js';
|
|
2
|
+
import './chunk-S6UH6QPK.js';
|
|
3
|
+
import './chunk-RL27E3AB.js';
|
|
4
|
+
import './chunk-CISGJCFW.js';
|
package/dist/index.cjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkLUA4WRIQ_cjs = require('./chunk-LUA4WRIQ.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "definePerfConfig", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
9
|
+
get: function () { return chunkLUA4WRIQ_cjs.definePerfConfig; }
|
|
10
10
|
});
|
|
11
11
|
Object.defineProperty(exports, "perfDefaults", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkLUA4WRIQ_cjs.perfDefaults; }
|
|
14
14
|
});
|