@flakiness/sdk 2.6.0 → 2.7.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/lib/browser.js +1 -0
- package/lib/index.js +24 -13
- package/package.json +2 -2
- package/types/src/normalizeReport.d.ts.map +1 -1
- package/types/src/readReport.d.ts.map +1 -1
package/lib/browser.js
CHANGED
|
@@ -33,6 +33,7 @@ function normalizeReport(report) {
|
|
|
33
33
|
return {
|
|
34
34
|
...step,
|
|
35
35
|
duration: step.duration === 0 ? void 0 : step.duration,
|
|
36
|
+
attachments: step.attachments && step.attachments.length ? step.attachments : void 0,
|
|
36
37
|
steps: step.steps && step.steps.length ? step.steps.map(cleanupTestStep) : void 0
|
|
37
38
|
};
|
|
38
39
|
}
|
package/lib/index.js
CHANGED
|
@@ -703,6 +703,7 @@ function normalizeReport(report) {
|
|
|
703
703
|
return {
|
|
704
704
|
...step,
|
|
705
705
|
duration: step.duration === 0 ? void 0 : step.duration,
|
|
706
|
+
attachments: step.attachments && step.attachments.length ? step.attachments : void 0,
|
|
706
707
|
steps: step.steps && step.steps.length ? step.steps.map(cleanupTestStep) : void 0
|
|
707
708
|
};
|
|
708
709
|
}
|
|
@@ -1101,21 +1102,31 @@ async function readReport(reportFolder) {
|
|
|
1101
1102
|
const filenameToPath = new Map(attachmentFiles.map((file) => [path.basename(file), file]));
|
|
1102
1103
|
const attachmentIdToPath = /* @__PURE__ */ new Map();
|
|
1103
1104
|
const missingAttachments = /* @__PURE__ */ new Map();
|
|
1105
|
+
const visitAttachment = (attachment) => {
|
|
1106
|
+
const attachmentPath = filenameToPath.get(attachment.id);
|
|
1107
|
+
if (!attachmentPath) {
|
|
1108
|
+
missingAttachments.set(attachment.id, attachment);
|
|
1109
|
+
} else {
|
|
1110
|
+
attachmentIdToPath.set(attachment.id, {
|
|
1111
|
+
contentType: attachment.contentType,
|
|
1112
|
+
id: attachment.id,
|
|
1113
|
+
path: attachmentPath,
|
|
1114
|
+
type: "file"
|
|
1115
|
+
});
|
|
1116
|
+
}
|
|
1117
|
+
};
|
|
1118
|
+
const visitStep = (step) => {
|
|
1119
|
+
for (const attachment of step.attachments ?? [])
|
|
1120
|
+
visitAttachment(attachment);
|
|
1121
|
+
for (const childStep of step.steps ?? [])
|
|
1122
|
+
visitStep(childStep);
|
|
1123
|
+
};
|
|
1104
1124
|
visitTests(report, (test) => {
|
|
1105
1125
|
for (const attempt of test.attempts) {
|
|
1106
|
-
for (const attachment of attempt.attachments ?? [])
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
} else {
|
|
1111
|
-
attachmentIdToPath.set(attachment.id, {
|
|
1112
|
-
contentType: attachment.contentType,
|
|
1113
|
-
id: attachment.id,
|
|
1114
|
-
path: attachmentPath,
|
|
1115
|
-
type: "file"
|
|
1116
|
-
});
|
|
1117
|
-
}
|
|
1118
|
-
}
|
|
1126
|
+
for (const attachment of attempt.attachments ?? [])
|
|
1127
|
+
visitAttachment(attachment);
|
|
1128
|
+
for (const step of attempt.steps ?? [])
|
|
1129
|
+
visitStep(step);
|
|
1119
1130
|
}
|
|
1120
1131
|
});
|
|
1121
1132
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flakiness/sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"node": "^20.17.0 || >=22.9.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@flakiness/flakiness-report": "^0.
|
|
31
|
+
"@flakiness/flakiness-report": "^0.31.0",
|
|
32
32
|
"@flakiness/playwright": "^1.3.3",
|
|
33
33
|
"@playwright/test": "^1.58.2",
|
|
34
34
|
"@types/debug": "^4.1.12",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalizeReport.d.ts","sourceRoot":"","sources":["../../src/normalizeReport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAyB9D;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,eAAe,CAAC,MAAM,GAAG,eAAe,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"normalizeReport.d.ts","sourceRoot":"","sources":["../../src/normalizeReport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAyB9D;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,eAAe,CAAC,MAAM,GAAG,eAAe,CAAC,MAAM,CAoDtF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"readReport.d.ts","sourceRoot":"","sources":["../../src/readReport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAG9D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,wBAAsB,UAAU,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC;IAC9D,MAAM,EAAE,eAAe,CAAC,MAAM,CAAC;IAC/B,WAAW,EAAE,cAAc,EAAE,CAAC;IAC9B,kBAAkB,EAAE,eAAe,CAAC,UAAU,EAAE,CAAC;CAClD,CAAC,
|
|
1
|
+
{"version":3,"file":"readReport.d.ts","sourceRoot":"","sources":["../../src/readReport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAG9D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,wBAAsB,UAAU,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC;IAC9D,MAAM,EAAE,eAAe,CAAC,MAAM,CAAC;IAC/B,WAAW,EAAE,cAAc,EAAE,CAAC;IAC9B,kBAAkB,EAAE,eAAe,CAAC,UAAU,EAAE,CAAC;CAClD,CAAC,CAoDD"}
|