lighthouse-reporting 1.6.8 → 1.6.9
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/dist/constants-CFLum58k.js +6 -0
- package/dist/constants-WB1XbOZm.cjs +23 -0
- package/dist/hooks.cjs +21 -18
- package/dist/hooks.js +13 -16
- package/dist/index.cjs +13 -14
- package/dist/index.js +1 -11
- package/dist/lighthouse-reporting.umd.cjs +280 -256
- package/dist/lighthouseReports.cjs +82 -84
- package/dist/lighthouseReports.js +78 -88
- package/dist/playwrightLighthouseTest.cjs +20 -28
- package/dist/playwrightLighthouseTest.js +14 -27
- package/dist/rolldown-runtime-D6vf50IK.cjs +28 -0
- package/dist/storybookPlaywright.cjs +27 -30
- package/dist/storybookPlaywright.js +24 -30
- package/package.json +13 -12
- package/dist/constants-ClvZzVIQ.cjs +0 -7
- package/dist/constants-CvRW9vHz.js +0 -8
- /package/dist/{lighthouse.html → src/lighthouse.html} +0 -0
|
@@ -1,257 +1,281 @@
|
|
|
1
1
|
(function(global, factory) {
|
|
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
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
2
|
+
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("os"), require("path"), require("fs-extra"), require("url"), require("net"), require("@playwright/test")) : typeof define === "function" && define.amd ? define([
|
|
3
|
+
"exports",
|
|
4
|
+
"os",
|
|
5
|
+
"path",
|
|
6
|
+
"fs-extra",
|
|
7
|
+
"url",
|
|
8
|
+
"net",
|
|
9
|
+
"@playwright/test"
|
|
10
|
+
], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.lh_rep = {}, global.os, global.path, global.fse, global.url, global.net, global["@playwright/test"]));
|
|
11
|
+
})(this, function(exports, os, path, fs_extra, url, net, _playwright_test) {
|
|
12
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
13
|
+
//#region \0rolldown/runtime.js
|
|
14
|
+
var __create = Object.create;
|
|
15
|
+
var __defProp = Object.defineProperty;
|
|
16
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
17
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
18
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
19
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
20
|
+
var __copyProps = (to, from, except, desc) => {
|
|
21
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
22
|
+
key = keys[i];
|
|
23
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
24
|
+
get: ((k) => from[k]).bind(null, key),
|
|
25
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
return to;
|
|
29
|
+
};
|
|
30
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
31
|
+
value: mod,
|
|
32
|
+
enumerable: true
|
|
33
|
+
}) : target, mod));
|
|
34
|
+
//#endregion
|
|
35
|
+
os = __toESM(os, 1);
|
|
36
|
+
path = __toESM(path, 1);
|
|
37
|
+
fs_extra = __toESM(fs_extra, 1);
|
|
38
|
+
url = __toESM(url, 1);
|
|
39
|
+
net = __toESM(net, 1);
|
|
40
|
+
//#region src/constants.ts
|
|
41
|
+
var INDEX_HTML = "index.html";
|
|
42
|
+
var PW_TMP_DIR = "pwlh";
|
|
43
|
+
//#endregion
|
|
44
|
+
//#region src/hooks.ts
|
|
45
|
+
var dirname;
|
|
46
|
+
if (typeof __dirname !== "string") {
|
|
47
|
+
const filename = url.default.fileURLToPath({}.url);
|
|
48
|
+
dirname = path.default.dirname(filename);
|
|
49
|
+
} else dirname = __dirname;
|
|
50
|
+
var reportDir = path.default.join(process.cwd(), process.env.LH_REPORT_DIR || "lighthouse");
|
|
51
|
+
var htmlTemplatePath = path.default.join(dirname, "lighthouse.html");
|
|
52
|
+
async function lighthouseSetup() {
|
|
53
|
+
await fs_extra.default.ensureDir(reportDir);
|
|
54
|
+
await fs_extra.default.copyFile(htmlTemplatePath, path.default.join(reportDir, INDEX_HTML));
|
|
55
|
+
}
|
|
56
|
+
async function lighthousePlaywrightTeardown() {
|
|
57
|
+
await fs_extra.default.remove(path.default.join(os.default.tmpdir(), PW_TMP_DIR));
|
|
58
|
+
}
|
|
59
|
+
//#endregion
|
|
60
|
+
//#region src/lighthouseReports.ts
|
|
61
|
+
var writeCsvResult = async (reportDir, name, scores, thresholds = {}, swimlanes = []) => {
|
|
62
|
+
let csvData = Object.keys(scores).join(",");
|
|
63
|
+
if (swimlanes.length > 0) csvData += "," + swimlanes.map((swimlane) => `${swimlane}_threshold`);
|
|
64
|
+
csvData += "\n";
|
|
65
|
+
csvData += Object.values(scores).join(",");
|
|
66
|
+
if (swimlanes.length > 0 && Object.keys(thresholds).length > 0) csvData += "," + swimlanes.map((swimlane) => thresholds[swimlane]);
|
|
67
|
+
await fs_extra.default.writeFile(path.default.join(reportDir, `${name}.csv`), csvData);
|
|
68
|
+
};
|
|
69
|
+
var writeHtmlListEntry = async (htmlFilePath, name, scores, thresholds, error, addReportLink) => {
|
|
70
|
+
const htmlFileData = (await fs_extra.default.readFile(htmlFilePath)).toString("utf-8").split("\n");
|
|
71
|
+
const insertIdx = htmlFileData.findIndex((v) => v.includes("// lighthouse-page-results"));
|
|
72
|
+
if (insertIdx < 0) throw new Error("Failed to write results to index.html");
|
|
73
|
+
htmlFileData.splice(insertIdx + 1, 0, JSON.stringify({
|
|
74
|
+
href: `${name}.html`,
|
|
75
|
+
name,
|
|
76
|
+
scores,
|
|
77
|
+
thresholds,
|
|
78
|
+
error,
|
|
79
|
+
addReportLink
|
|
80
|
+
}) + ",");
|
|
81
|
+
await fs_extra.default.writeFile(htmlFilePath, htmlFileData.join("\n"));
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* workaround conflicts when multiple threads write the same file
|
|
85
|
+
*/
|
|
86
|
+
var writeHtmlListEntryWithRetry = async (htmlFilePath, name, scores, thresholds, comparisonError, addReportLink = true) => {
|
|
87
|
+
let attempts = 10;
|
|
88
|
+
let error;
|
|
89
|
+
while (attempts > 0) {
|
|
90
|
+
attempts--;
|
|
91
|
+
try {
|
|
92
|
+
await writeHtmlListEntry(htmlFilePath, name, scores, thresholds, comparisonError, addReportLink);
|
|
93
|
+
return;
|
|
94
|
+
} catch (e) {
|
|
95
|
+
error = e;
|
|
96
|
+
}
|
|
97
|
+
await new Promise((resolve) => setTimeout(resolve, 10));
|
|
98
|
+
}
|
|
99
|
+
throw error;
|
|
100
|
+
};
|
|
101
|
+
var getScores = (result) => Object.entries(result.lhr.categories).reduce((prev, [key, c]) => {
|
|
102
|
+
const score = typeof c.score === "number" ? c.score : 0;
|
|
103
|
+
prev[key] = Math.floor(score * 100);
|
|
104
|
+
return prev;
|
|
105
|
+
}, {});
|
|
106
|
+
var writeScoresToJson = async (lhScoresDir, name, scores, result) => {
|
|
107
|
+
const json = Object.entries(scores).reduce((prev, [k, score]) => {
|
|
108
|
+
prev[k] = { score };
|
|
109
|
+
return prev;
|
|
110
|
+
}, {});
|
|
111
|
+
const accessibilityViolations = result.artifacts.Accessibility ? result.artifacts.Accessibility.violations.map((v) => {
|
|
112
|
+
return {
|
|
113
|
+
title: result.lhr.audits[v.id].title,
|
|
114
|
+
nodes: v.nodes.length
|
|
115
|
+
};
|
|
116
|
+
}) : [];
|
|
117
|
+
if (accessibilityViolations.length > 0) json.accessibility.issues = accessibilityViolations;
|
|
118
|
+
await fs_extra.default.writeFile(path.default.join(lhScoresDir, `${name}.json`), JSON.stringify(json, null, 2));
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* Generate average csv file. Make sure to use `writeScoresToJson` in your test!
|
|
122
|
+
* @param lhScoresDir path to folder with lighthouse json files. See `writeScoresToJson`.
|
|
123
|
+
* @param reportDir folder where `_AVERAGE_.json` will be generated
|
|
124
|
+
*/
|
|
125
|
+
var buildAverageCsv = async (lhScoresDir, reportDir) => {
|
|
126
|
+
const jsonFiles = (await fs_extra.default.readdir(lhScoresDir)).filter((f) => f.endsWith(".json"));
|
|
127
|
+
if (jsonFiles.length === 0) return;
|
|
128
|
+
const scores = {};
|
|
129
|
+
for (const fileName of jsonFiles) {
|
|
130
|
+
const score = await fs_extra.default.readJson(path.default.join(lhScoresDir, fileName));
|
|
131
|
+
Object.entries(score).forEach(([k, v]) => {
|
|
132
|
+
if (!scores[k]) scores[k] = 0;
|
|
133
|
+
scores[k] += v.score;
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
Object.entries(scores).forEach(([k, v]) => {
|
|
137
|
+
scores[k] = v / jsonFiles.length;
|
|
138
|
+
});
|
|
139
|
+
await writeCsvResult(reportDir, "_AVERAGE_", scores);
|
|
140
|
+
};
|
|
141
|
+
//#endregion
|
|
142
|
+
//#region node_modules/get-port/index.js
|
|
143
|
+
var Locked = class extends Error {
|
|
144
|
+
constructor(port) {
|
|
145
|
+
super(`${port} is locked`);
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
var lockedPorts = {
|
|
149
|
+
old: /* @__PURE__ */ new Set(),
|
|
150
|
+
young: /* @__PURE__ */ new Set()
|
|
151
|
+
};
|
|
152
|
+
var releaseOldLockedPortsIntervalMs = 1e3 * 15;
|
|
153
|
+
var reservedPorts = /* @__PURE__ */ new Set();
|
|
154
|
+
var timeout;
|
|
155
|
+
var getLocalHosts = () => {
|
|
156
|
+
const interfaces = os.default.networkInterfaces();
|
|
157
|
+
const results = /* @__PURE__ */ new Set([void 0, "0.0.0.0"]);
|
|
158
|
+
for (const _interface of Object.values(interfaces)) for (const config of _interface) results.add(config.address);
|
|
159
|
+
return results;
|
|
160
|
+
};
|
|
161
|
+
var checkAvailablePort = (options) => new Promise((resolve, reject) => {
|
|
162
|
+
const server = net.default.createServer();
|
|
163
|
+
server.unref();
|
|
164
|
+
server.on("error", reject);
|
|
165
|
+
server.listen(options, () => {
|
|
166
|
+
const { port } = server.address();
|
|
167
|
+
server.close(() => {
|
|
168
|
+
resolve(port);
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
});
|
|
172
|
+
var getAvailablePort = async (options, hosts) => {
|
|
173
|
+
if (options.host || options.port === 0) return checkAvailablePort(options);
|
|
174
|
+
for (const host of hosts) try {
|
|
175
|
+
await checkAvailablePort({
|
|
176
|
+
port: options.port,
|
|
177
|
+
host
|
|
178
|
+
});
|
|
179
|
+
} catch (error) {
|
|
180
|
+
if (!["EADDRNOTAVAIL", "EINVAL"].includes(error.code)) throw error;
|
|
181
|
+
}
|
|
182
|
+
return options.port;
|
|
183
|
+
};
|
|
184
|
+
var isLockedPort = (port) => lockedPorts.old.has(port) || lockedPorts.young.has(port) || reservedPorts.has(port);
|
|
185
|
+
var portCheckSequence = function* (ports) {
|
|
186
|
+
if (ports) yield* ports;
|
|
187
|
+
yield 0;
|
|
188
|
+
};
|
|
189
|
+
async function getPorts(options) {
|
|
190
|
+
let ports;
|
|
191
|
+
let exclude = /* @__PURE__ */ new Set();
|
|
192
|
+
if (options) {
|
|
193
|
+
if (options.port) ports = typeof options.port === "number" ? [options.port] : options.port;
|
|
194
|
+
if (options.exclude) {
|
|
195
|
+
const excludeIterable = options.exclude;
|
|
196
|
+
if (typeof excludeIterable[Symbol.iterator] !== "function") throw new TypeError("The `exclude` option must be an iterable.");
|
|
197
|
+
for (const element of excludeIterable) {
|
|
198
|
+
if (typeof element !== "number") throw new TypeError("Each item in the `exclude` option must be a number corresponding to the port you want excluded.");
|
|
199
|
+
if (!Number.isSafeInteger(element)) throw new TypeError(`Number ${element} in the exclude option is not a safe integer and can't be used`);
|
|
200
|
+
}
|
|
201
|
+
exclude = new Set(excludeIterable);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
const { reserve, ...netOptions } = options ?? {};
|
|
205
|
+
if (timeout === void 0) {
|
|
206
|
+
timeout = setTimeout(() => {
|
|
207
|
+
timeout = void 0;
|
|
208
|
+
lockedPorts.old = lockedPorts.young;
|
|
209
|
+
lockedPorts.young = /* @__PURE__ */ new Set();
|
|
210
|
+
}, releaseOldLockedPortsIntervalMs);
|
|
211
|
+
if (timeout.unref) timeout.unref();
|
|
212
|
+
}
|
|
213
|
+
const hosts = getLocalHosts();
|
|
214
|
+
for (const port of portCheckSequence(ports)) try {
|
|
215
|
+
if (exclude.has(port)) continue;
|
|
216
|
+
let availablePort = await getAvailablePort({
|
|
217
|
+
...netOptions,
|
|
218
|
+
port
|
|
219
|
+
}, hosts);
|
|
220
|
+
while (isLockedPort(availablePort)) {
|
|
221
|
+
if (port !== 0) throw new Locked(port);
|
|
222
|
+
availablePort = await getAvailablePort({
|
|
223
|
+
...netOptions,
|
|
224
|
+
port
|
|
225
|
+
}, hosts);
|
|
226
|
+
}
|
|
227
|
+
if (reserve) reservedPorts.add(availablePort);
|
|
228
|
+
else lockedPorts.young.add(availablePort);
|
|
229
|
+
return availablePort;
|
|
230
|
+
} catch (error) {
|
|
231
|
+
if (!["EADDRINUSE", "EACCES"].includes(error.code) && !(error instanceof Locked)) throw error;
|
|
232
|
+
}
|
|
233
|
+
throw new Error("No available ports found");
|
|
234
|
+
}
|
|
235
|
+
//#endregion
|
|
236
|
+
//#region src/playwrightLighthouseTest.ts
|
|
237
|
+
var playwrightLighthouseTest = _playwright_test.test.extend({
|
|
238
|
+
port: [async ({}, use) => {
|
|
239
|
+
await use(await getPorts());
|
|
240
|
+
}, { scope: "worker" }],
|
|
241
|
+
context: [async ({ port, launchOptions }, use) => {
|
|
242
|
+
const context = await _playwright_test.chromium.launchPersistentContext(path.default.join(os.default.tmpdir(), PW_TMP_DIR, `${Math.random()}`.replace(".", "")), { args: [...launchOptions.args || [], `--remote-debugging-port=${port}`] });
|
|
243
|
+
await use(context);
|
|
244
|
+
await context.close();
|
|
245
|
+
}, { scope: "test" }]
|
|
246
|
+
});
|
|
247
|
+
//#endregion
|
|
248
|
+
//#region src/storybookPlaywright.ts
|
|
249
|
+
var storybookPlaywright = {
|
|
250
|
+
getStories: (pathToStorybookIndexJson, storyFilterFn) => {
|
|
251
|
+
if (!fs_extra.default.existsSync(pathToStorybookIndexJson)) {
|
|
252
|
+
console.log(pathToStorybookIndexJson, "doesn't exist.");
|
|
253
|
+
throw new Error("Please build storybook before running tests!");
|
|
254
|
+
}
|
|
255
|
+
const storybookIndexJson = fs_extra.default.readJsonSync(pathToStorybookIndexJson);
|
|
256
|
+
const storyObject = storybookIndexJson.entries || storybookIndexJson.stories;
|
|
257
|
+
return Object.values(storyObject).filter(storyFilterFn);
|
|
258
|
+
},
|
|
259
|
+
captureScreenshot: async (story, context, screenshotOptions, options = { waitForLoadStateTimeout: 2e3 }, actionBeforeScreenshot) => {
|
|
260
|
+
const page = context.pages()[0];
|
|
261
|
+
await page.goto(`/iframe.html?id=${story.id}`);
|
|
262
|
+
await (0, _playwright_test.expect)(page.locator(".sb-show-main")).toBeVisible();
|
|
263
|
+
await (0, _playwright_test.expect)(page.locator(".sb-show-errordisplay")).not.toBeVisible();
|
|
264
|
+
try {
|
|
265
|
+
await page.waitForLoadState("networkidle", { timeout: options.waitForLoadStateTimeout });
|
|
266
|
+
} catch {}
|
|
267
|
+
if (actionBeforeScreenshot) await actionBeforeScreenshot(page);
|
|
268
|
+
await (0, _playwright_test.expect)(page).toHaveScreenshot(`${story.id}.png`, screenshotOptions);
|
|
269
|
+
}
|
|
270
|
+
};
|
|
271
|
+
//#endregion
|
|
272
|
+
exports.buildAverageCsv = buildAverageCsv;
|
|
273
|
+
exports.getScores = getScores;
|
|
274
|
+
exports.lighthousePlaywrightTeardown = lighthousePlaywrightTeardown;
|
|
275
|
+
exports.lighthouseSetup = lighthouseSetup;
|
|
276
|
+
exports.playwrightLighthouseTest = playwrightLighthouseTest;
|
|
277
|
+
exports.storybookPlaywright = storybookPlaywright;
|
|
278
|
+
exports.writeCsvResult = writeCsvResult;
|
|
279
|
+
exports.writeHtmlListEntryWithRetry = writeHtmlListEntryWithRetry;
|
|
280
|
+
exports.writeScoresToJson = writeScoresToJson;
|
|
281
|
+
});
|