@empiricalrun/playwright-utils 0.14.9 → 0.14.11
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 +12 -0
- package/dist/reporter/custom.d.ts.map +1 -1
- package/dist/reporter/custom.js +28 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @empiricalrun/playwright-utils
|
|
2
2
|
|
|
3
|
+
## 0.14.11
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 6a838c2: chore: add logs for test run uploader job failure
|
|
8
|
+
|
|
9
|
+
## 0.14.10
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- fced6ed: chore: add logs to reporter
|
|
14
|
+
|
|
3
15
|
## 0.14.9
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom.d.ts","sourceRoot":"","sources":["../../src/reporter/custom.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAMH,OAAO,KAAK,EACV,UAAU,EACV,UAAU,EAEV,KAAK,EACL,QAAQ,IAAI,cAAc,EAC1B,SAAS,EACT,UAAU,IAAI,gBAAgB,EAE/B,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EAML,UAAU,EAMX,MAAM,2BAA2B,CAAC;AAgBnC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAiC/C,QAAA,MAAM,iBAAiB,UAAoC,CAAC;AAC5D,KAAK,oBAAoB,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAM/D,KAAK,mBAAmB,GAAG;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,oBAAoB,CAAC;IAC5B,IAA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ions = ["always", "never", "on-failure"];
|
|
|
37
37
|
const isHtmlReportOption = (type) => {
|
|
38
38
|
return htmlReportOptions.includes(type);
|
|
39
39
|
};
|
|
40
|
+
function listFilesRecursively(dir) {
|
|
41
|
+
let files = [];
|
|
42
|
+
try {
|
|
43
|
+
const items = fs_1.default.readdirSync(dir); // Read the directory
|
|
44
|
+
for (const item of items) {
|
|
45
|
+
const fullPath = path_1.default.join(dir, item);
|
|
46
|
+
// Get file stats
|
|
47
|
+
const stats = fs_1.default.statSync(fullPath);
|
|
48
|
+
if (stats.isDirectory()) {
|
|
49
|
+
// Recursively list files in subdirectory
|
|
50
|
+
files = files.concat(listFilesRecursively(fullPath));
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
// It's a file, add it to the list
|
|
54
|
+
files.push(fullPath);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
console.error(`Error reading directory ${dir}: ${error}`);
|
|
60
|
+
}
|
|
61
|
+
return files;
|
|
62
|
+
}
|
|
40
63
|
class HtmlReporter {
|
|
41
64
|
config;
|
|
42
65
|
suite;
|
|
@@ -58,9 +81,8 @@ class HtmlReporter {
|
|
|
58
81
|
const task = this.uploadWaitingQueue.shift();
|
|
59
82
|
if (task) {
|
|
60
83
|
const promise = task()
|
|
61
|
-
.catch(() => {
|
|
62
|
-
|
|
63
|
-
// console.log("Upload failed", e); // error is already logged in the upload function
|
|
84
|
+
.catch((e) => {
|
|
85
|
+
console.error("Error in processing task", e);
|
|
64
86
|
})
|
|
65
87
|
.finally(() => {
|
|
66
88
|
// console.log("Finished upload execution from waiting queue"); // we already log in the upload function on successful upload
|
|
@@ -207,6 +229,8 @@ class HtmlReporter {
|
|
|
207
229
|
second: "2-digit",
|
|
208
230
|
}).format(startTime));
|
|
209
231
|
try {
|
|
232
|
+
console.log("uploading path", this._outputFolder);
|
|
233
|
+
console.log(listFilesRecursively(this._outputFolder));
|
|
210
234
|
// await Promise.allSettled([
|
|
211
235
|
const uploadTraceTask = async () => (0, r2_uploader_1.uploadDirectory)({
|
|
212
236
|
sourceDir: this._outputFolder + "/trace",
|
|
@@ -251,7 +275,7 @@ class HtmlReporter {
|
|
|
251
275
|
console.log("Time taken to upload after tests ended: ", timeDiff, "ms");
|
|
252
276
|
}
|
|
253
277
|
catch (e) {
|
|
254
|
-
|
|
278
|
+
console.error("Error in uploading final report ", e);
|
|
255
279
|
}
|
|
256
280
|
}
|
|
257
281
|
async onExit() {
|