@bigbinary/neeto-playwright-reporter 1.3.13 → 1.3.14

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/index.d.ts CHANGED
@@ -19,6 +19,7 @@ declare class MyReporter implements Reporter {
19
19
  tags: string[] | string;
20
20
  unreportedAttemptCount: number;
21
21
  hasRunStarted: boolean;
22
+ testAttemptIds: string[];
22
23
  constructor(options: ReporterOptionParams);
23
24
  onBegin: (config: FullConfig, rootSuite: Suite) => Promise<void>;
24
25
  onTestBegin: ({ id, title }: TestCase, { retry }: TestResult) => Promise<void>;
package/index.js CHANGED
@@ -18634,15 +18634,15 @@ class MyReporter {
18634
18634
  };
18635
18635
  this.onTestBegin = async ({ id, title }, { retry }) => {
18636
18636
  var _a, _b;
18637
+ this.retryAttemptStartedAt = new Date();
18637
18638
  this.unreportedAttemptCount++;
18638
18639
  consoleLogFormatted.invertBackground(MESSAGES.onTestBegin.startingTest(title));
18639
18640
  try {
18640
- this.retryAttemptStartedAt = new Date();
18641
18641
  while (!((_b = (_a = this.attempts) === null || _a === void 0 ? void 0 : _a[id]) === null || _b === void 0 ? void 0 : _b["0"]))
18642
18642
  await waitUntilTimeout(100); // Poll every 100 milliseconds
18643
18643
  const attemptsPayload = {
18644
18644
  status: "running",
18645
- started_at: new Date().toString(),
18645
+ started_at: this.retryAttemptStartedAt.toString(),
18646
18646
  shard: this.currentShard,
18647
18647
  };
18648
18648
  if (retry === 0) {
@@ -18657,6 +18657,7 @@ class MyReporter {
18657
18657
  [String(retry)]: attempt_id,
18658
18658
  },
18659
18659
  };
18660
+ this.testAttemptIds.push(`${history_id}-${attempt_id}`);
18660
18661
  }
18661
18662
  }
18662
18663
  catch (error) {
@@ -18698,7 +18699,8 @@ class MyReporter {
18698
18699
  return uploadToS3(file, direct_upload);
18699
18700
  }
18700
18701
  }));
18701
- while (!this.attempts[id][retry])
18702
+ while (!(this.attempts[id][retry] ||
18703
+ this.testAttemptIds.includes(`${id}-${this.attempts[id][retry]}`)))
18702
18704
  await waitUntilTimeout(100);
18703
18705
  this.testResultCalls.push(attemptsApi.update(this.ciBuildId, id, this.attempts[id][retry], testResult));
18704
18706
  }
@@ -18747,6 +18749,7 @@ class MyReporter {
18747
18749
  this.reportedTestCount = 0;
18748
18750
  this.unreportedAttemptCount = 0;
18749
18751
  this.hasRunStarted = false;
18752
+ this.testAttemptIds = [];
18750
18753
  process.on("unhandledRejection", error => {
18751
18754
  var _a, _b, _c;
18752
18755
  const data = (_a = error.response) === null || _a === void 0 ? void 0 : _a.data;