@bigbinary/neeto-playwright-reporter 1.3.8 → 1.3.10

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
@@ -18472,6 +18472,7 @@ const ERRORS = {
18472
18472
  onBegin: {
18473
18473
  noTestsToReport: "No tests to report",
18474
18474
  failedToGetCommitSha: "Failed to get current commit SHA.",
18475
+ failedToGetAuthor: "Failed to get current author.",
18475
18476
  failedToGetBranch: "Failed to get current branch.",
18476
18477
  failedToGetCommitMessage: "Failed to get current commit message.",
18477
18478
  failedToInitializeRun: "Failed to initialize run in reporter",
@@ -18561,6 +18562,10 @@ const getCurrentBranch = () => executeCommandLine({
18561
18562
  command: "git branch --show-current",
18562
18563
  messageOnError: ERRORS.onBegin.failedToGetBranch,
18563
18564
  });
18565
+ const getCurrentAuthor = () => executeCommandLine({
18566
+ command: "git show -s --format='%an' HEAD",
18567
+ messageOnError: ERRORS.onBegin.failedToGetBranch,
18568
+ });
18564
18569
  const getInitializerData = ({ rootDir }, rootSuite) => rootSuite.allTests().map(test => {
18565
18570
  var _a;
18566
18571
  const { title, parent, id: history_id, location: { file }, } = test;
@@ -18608,13 +18613,15 @@ class MyReporter {
18608
18613
  this.totalTestCount = rootSuite.allTests().length;
18609
18614
  if (this.totalTestCount === 0) {
18610
18615
  consoleLogFormatted.error(ERRORS.onBegin.noTestsToReport);
18611
- process.exit(0);
18616
+ return;
18612
18617
  }
18613
18618
  try {
18614
18619
  const runDetails = {
18615
18620
  commit_id: getCurrentCommitSha(),
18616
18621
  commit_name: getCurrentCommitMessage(),
18622
+ author: getCurrentAuthor(),
18617
18623
  branch: getCurrentBranch(),
18624
+ tags: typeof this.tags === "string" ? this.tags.split(",") : this.tags,
18618
18625
  ci_build_id: this.ciBuildId,
18619
18626
  configuration: config,
18620
18627
  shards: createShardObject({ currentShard: shard === null || shard === void 0 ? void 0 : shard.current }),
@@ -18687,7 +18694,9 @@ class MyReporter {
18687
18694
  videos: [],
18688
18695
  traces: [],
18689
18696
  completed_at: completedAt.toString(),
18690
- error_snippet: `# ${errorLocation === null || errorLocation === void 0 ? void 0 : errorLocation.file} (${errorLocation === null || errorLocation === void 0 ? void 0 : errorLocation.line}:${errorLocation === null || errorLocation === void 0 ? void 0 : errorLocation.column}) \n\n\n ${error === null || error === void 0 ? void 0 : error.snippet}`,
18697
+ error_snippet: errorLocation
18698
+ ? `# ${errorLocation === null || errorLocation === void 0 ? void 0 : errorLocation.file} (${errorLocation === null || errorLocation === void 0 ? void 0 : errorLocation.line}:${errorLocation === null || errorLocation === void 0 ? void 0 : errorLocation.column}) \n\n\n ${error === null || error === void 0 ? void 0 : error.snippet}`
18699
+ : null,
18691
18700
  };
18692
18701
  consoleLogFormatted.underline(title);
18693
18702
  await Promise.all(attachments.map(async ({ name, path, body, contentType, }) => {
@@ -18742,6 +18751,7 @@ class MyReporter {
18742
18751
  };
18743
18752
  initializeAxios(options);
18744
18753
  this.attempts = {};
18754
+ this.tags = options.tags;
18745
18755
  this.ciBuildId = options.ciBuildId;
18746
18756
  this.retryAttemptStartedAt = new Date();
18747
18757
  this.testResultCalls = [];