@bigbinary/neeto-playwright-reporter 1.5.3 → 1.5.5

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.cjs.js CHANGED
@@ -2427,11 +2427,9 @@ class ConsoleLogFormatted {
2427
2427
  }
2428
2428
  createMethod(logLevel, ansiFormatter) {
2429
2429
  this[logLevel] = (message) => {
2430
- if (this.shouldPrintMessage(logLevel)) {
2431
- process.stdout.write("\x1B[" + 3 + "A");
2432
- process.stdout.write(`\n${ansiFormatter}${message}\x1b[0m\u001b[0m`);
2433
- process.stdout.write("\x1B[" + 3 + "B");
2434
- }
2430
+ if (!this.shouldPrintMessage(logLevel))
2431
+ return;
2432
+ process.stdout.write(`\n${ansiFormatter}${message}\x1b[0m\u001b[0m`);
2435
2433
  };
2436
2434
  }
2437
2435
  }
@@ -21375,7 +21373,7 @@ CI Build ID: ${ciBuildId}\n`;
21375
21373
  \n`,
21376
21374
  },
21377
21375
  onEnd: {
21378
- runReported: "Run completed and reported to NeetoPlaydash 🎉",
21376
+ runReported: "Run completed and reported to NeetoPlaydash 🎉\n\n",
21379
21377
  },
21380
21378
  };
21381
21379
 
@@ -21525,9 +21523,9 @@ const onTestBegin = async (self, test, { retry }) => {
21525
21523
  const startedAt = new Date().toString();
21526
21524
  const attemptIndex = joinHyphenCase(retry, repeatEachIndex);
21527
21525
  self.unreportedAttemptCount++;
21528
- consoleLogFormatted.invertBackground(MESSAGES.onTestBegin.startingTest(title, historyId));
21529
21526
  try {
21530
21527
  await waitUntilCondition(() => { var _a, _b; return (_b = (_a = self.attempts) === null || _a === void 0 ? void 0 : _a[historyId]) === null || _b === void 0 ? void 0 : _b[FIRST_ATTEMPT_INDEX]; });
21528
+ consoleLogFormatted.invertBackground(MESSAGES.onTestBegin.startingTest(title, historyId));
21531
21529
  const attemptsPayload = {
21532
21530
  status: "running",
21533
21531
  startedAt,
@@ -21543,6 +21541,7 @@ const onTestBegin = async (self, test, { retry }) => {
21543
21541
  [historyId]: { [attemptIndex]: attemptId },
21544
21542
  });
21545
21543
  }
21544
+ self.startedAttempts.add(joinHyphenCase(historyId, attemptIndex));
21546
21545
  }
21547
21546
  catch (error) {
21548
21547
  consoleLogFormatted.error(error.message);
@@ -22928,6 +22927,7 @@ const onTestEnd = async (self, testCase, { status, duration, errors, error, retr
22928
22927
  completedAt: completedAt.toString(),
22929
22928
  errorSnippet: error && generateErrorReport(error),
22930
22929
  };
22930
+ await waitUntilCondition(() => self.startedAttempts.has(joinHyphenCase(historyId, attemptIndex)));
22931
22931
  consoleLogFormatted.underline(title);
22932
22932
  const files = attachments
22933
22933
  .map(({ name, path, body, contentType }) => {
@@ -22947,7 +22947,6 @@ const onTestEnd = async (self, testCase, { status, duration, errors, error, retr
22947
22947
  return uploadToS3(files[index].file, directUpload, `${title} - ${(_b = files[index]) === null || _b === void 0 ? void 0 : _b.name}`);
22948
22948
  }));
22949
22949
  self.progressBars.push(...bars);
22950
- await waitUntilCondition(() => self.attempts[historyId][attemptIndex]);
22951
22950
  const reportToNeetoPlaydash = attemptsApi.update(ciBuildId, historyId, self.attempts[historyId][attemptIndex], testResult);
22952
22951
  self.testResultCalls.push(reportToNeetoPlaydash);
22953
22952
  await reportToNeetoPlaydash;
@@ -22960,6 +22959,7 @@ const onTestEnd = async (self, testCase, { status, duration, errors, error, retr
22960
22959
  }
22961
22960
  finally {
22962
22961
  self.unreportedAttemptCount--;
22962
+ self.startedAttempts.delete(joinHyphenCase(historyId, attemptIndex));
22963
22963
  }
22964
22964
  };
22965
22965
 
@@ -23028,6 +23028,7 @@ class NeetoPlaywrightReporter {
23028
23028
  this.rootDir = "";
23029
23029
  this.currentShard = 0;
23030
23030
  this.progressBars = [];
23031
+ this.startedAttempts = new Set();
23031
23032
  initialize(this, options);
23032
23033
  }
23033
23034
  }