@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.d.ts CHANGED
@@ -16,6 +16,7 @@ declare class NeetoPlaywrightReporter implements Reporter {
16
16
  heartbeatInterval: NodeJS.Timeout | null;
17
17
  rootDir: string;
18
18
  progressBars: (Bar | void)[];
19
+ startedAttempts: Set<string>;
19
20
  constructor(options: ReporterOptionParams);
20
21
  onBegin: (config: FullConfig, rootSuite: Suite) => Promise<void>;
21
22
  onTestBegin: (test: TestCase, result: TestResult) => Promise<void>;
package/index.js CHANGED
@@ -2407,11 +2407,9 @@ class ConsoleLogFormatted {
2407
2407
  }
2408
2408
  createMethod(logLevel, ansiFormatter) {
2409
2409
  this[logLevel] = (message) => {
2410
- if (this.shouldPrintMessage(logLevel)) {
2411
- process.stdout.write("\x1B[" + 3 + "A");
2412
- process.stdout.write(`\n${ansiFormatter}${message}\x1b[0m\u001b[0m`);
2413
- process.stdout.write("\x1B[" + 3 + "B");
2414
- }
2410
+ if (!this.shouldPrintMessage(logLevel))
2411
+ return;
2412
+ process.stdout.write(`\n${ansiFormatter}${message}\x1b[0m\u001b[0m`);
2415
2413
  };
2416
2414
  }
2417
2415
  }
@@ -21355,7 +21353,7 @@ CI Build ID: ${ciBuildId}\n`;
21355
21353
  \n`,
21356
21354
  },
21357
21355
  onEnd: {
21358
- runReported: "Run completed and reported to NeetoPlaydash 🎉",
21356
+ runReported: "Run completed and reported to NeetoPlaydash 🎉\n\n",
21359
21357
  },
21360
21358
  };
21361
21359
 
@@ -21505,9 +21503,9 @@ const onTestBegin = async (self, test, { retry }) => {
21505
21503
  const startedAt = new Date().toString();
21506
21504
  const attemptIndex = joinHyphenCase(retry, repeatEachIndex);
21507
21505
  self.unreportedAttemptCount++;
21508
- consoleLogFormatted.invertBackground(MESSAGES.onTestBegin.startingTest(title, historyId));
21509
21506
  try {
21510
21507
  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]; });
21508
+ consoleLogFormatted.invertBackground(MESSAGES.onTestBegin.startingTest(title, historyId));
21511
21509
  const attemptsPayload = {
21512
21510
  status: "running",
21513
21511
  startedAt,
@@ -21523,6 +21521,7 @@ const onTestBegin = async (self, test, { retry }) => {
21523
21521
  [historyId]: { [attemptIndex]: attemptId },
21524
21522
  });
21525
21523
  }
21524
+ self.startedAttempts.add(joinHyphenCase(historyId, attemptIndex));
21526
21525
  }
21527
21526
  catch (error) {
21528
21527
  consoleLogFormatted.error(error.message);
@@ -22908,6 +22907,7 @@ const onTestEnd = async (self, testCase, { status, duration, errors, error, retr
22908
22907
  completedAt: completedAt.toString(),
22909
22908
  errorSnippet: error && generateErrorReport(error),
22910
22909
  };
22910
+ await waitUntilCondition(() => self.startedAttempts.has(joinHyphenCase(historyId, attemptIndex)));
22911
22911
  consoleLogFormatted.underline(title);
22912
22912
  const files = attachments
22913
22913
  .map(({ name, path, body, contentType }) => {
@@ -22927,7 +22927,6 @@ const onTestEnd = async (self, testCase, { status, duration, errors, error, retr
22927
22927
  return uploadToS3(files[index].file, directUpload, `${title} - ${(_b = files[index]) === null || _b === void 0 ? void 0 : _b.name}`);
22928
22928
  }));
22929
22929
  self.progressBars.push(...bars);
22930
- await waitUntilCondition(() => self.attempts[historyId][attemptIndex]);
22931
22930
  const reportToNeetoPlaydash = attemptsApi.update(ciBuildId, historyId, self.attempts[historyId][attemptIndex], testResult);
22932
22931
  self.testResultCalls.push(reportToNeetoPlaydash);
22933
22932
  await reportToNeetoPlaydash;
@@ -22940,6 +22939,7 @@ const onTestEnd = async (self, testCase, { status, duration, errors, error, retr
22940
22939
  }
22941
22940
  finally {
22942
22941
  self.unreportedAttemptCount--;
22942
+ self.startedAttempts.delete(joinHyphenCase(historyId, attemptIndex));
22943
22943
  }
22944
22944
  };
22945
22945
 
@@ -23008,6 +23008,7 @@ class NeetoPlaywrightReporter {
23008
23008
  this.rootDir = "";
23009
23009
  this.currentShard = 0;
23010
23010
  this.progressBars = [];
23011
+ this.startedAttempts = new Set();
23011
23012
  initialize(this, options);
23012
23013
  }
23013
23014
  }