@midscene/test 1.13.2 → 1.13.3

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.
@@ -17,7 +17,7 @@ var __webpack_modules__ = {
17
17
  },
18
18
  "./package.json" (module) {
19
19
  module.exports = {
20
- rE: "1.13.2"
20
+ rE: "1.13.3"
21
21
  };
22
22
  }
23
23
  };
@@ -1217,13 +1217,32 @@ Each Node's returned \`data\` is saved on that Step's result. Results are not na
1217
1217
  notRunReason: reason
1218
1218
  });
1219
1219
  const summarize = (projects)=>{
1220
- const cases = projects.flatMap((project)=>latestById(project.cases, (item)=>item.caseId));
1220
+ const healthCases = projects.flatMap((project)=>{
1221
+ const documentAttemptByRunId = new Map(project.documents.map((document)=>[
1222
+ document.documentRunId,
1223
+ document.attemptIndex ?? 0
1224
+ ]));
1225
+ return latestById(project.cases, (item)=>item.caseId).map((item)=>({
1226
+ status: item.status,
1227
+ ...item.run ? {
1228
+ run: item.run
1229
+ } : {},
1230
+ ...item.attempts ? {
1231
+ attempts: item.attempts
1232
+ } : {},
1233
+ retryCount: item.documentRunId ? documentAttemptByRunId.get(item.documentRunId) ?? 0 : 0
1234
+ }));
1235
+ });
1221
1236
  const documents = projects.flatMap((project)=>latestById(project.documents, (item)=>item.documentId));
1237
+ const health = (0, report_namespaceObject.calculateTestRunHealth)(healthCases);
1222
1238
  return {
1223
- total: cases.length,
1224
- passed: cases.filter((item)=>'success' === item.status).length,
1225
- failed: cases.filter((item)=>'failed' === item.status).length,
1226
- notRun: cases.filter((item)=>'not-run' === item.status).length,
1239
+ total: health.total,
1240
+ passed: health.passed,
1241
+ failed: health.failed,
1242
+ notRun: health.notRun,
1243
+ passedAfterRetry: health.passedAfterRetry,
1244
+ finalPassRate: health.finalPassRate,
1245
+ firstPassRate: health.firstPassRate,
1227
1246
  filtered: projects.reduce((total, project)=>total + project.filteredCaseCount, 0),
1228
1247
  collectionErrors: projects.reduce((total, project)=>total + project.collectionErrors.length, 0),
1229
1248
  documentFailures: documents.filter((document)=>'failed' === document.status).length,