@bigbinary/neeto-playwright-reporter 1.3.8 → 1.3.9

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
@@ -5,6 +5,7 @@ interface ReporterOptionParams {
5
5
  baseURL: string;
6
6
  apiKey: string;
7
7
  ciBuildId: string;
8
+ tags: string[] | string;
8
9
  }
9
10
  declare class MyReporter implements Reporter {
10
11
  attempts: Record<string, Record<string, string>>;
@@ -15,6 +16,7 @@ declare class MyReporter implements Reporter {
15
16
  testResultCalls: Promise<unknown>[];
16
17
  totalTestCount: number;
17
18
  reportedTestCount: number;
19
+ tags: string[] | string;
18
20
  unreportedAttemptCount: number;
19
21
  constructor(options: ReporterOptionParams);
20
22
  onBegin: (config: FullConfig, rootSuite: Suite) => Promise<void>;
package/index.js CHANGED
@@ -18453,6 +18453,7 @@ const ERRORS = {
18453
18453
  onBegin: {
18454
18454
  noTestsToReport: "No tests to report",
18455
18455
  failedToGetCommitSha: "Failed to get current commit SHA.",
18456
+ failedToGetAuthor: "Failed to get current author.",
18456
18457
  failedToGetBranch: "Failed to get current branch.",
18457
18458
  failedToGetCommitMessage: "Failed to get current commit message.",
18458
18459
  failedToInitializeRun: "Failed to initialize run in reporter",
@@ -18542,6 +18543,10 @@ const getCurrentBranch = () => executeCommandLine({
18542
18543
  command: "git branch --show-current",
18543
18544
  messageOnError: ERRORS.onBegin.failedToGetBranch,
18544
18545
  });
18546
+ const getCurrentAuthor = () => executeCommandLine({
18547
+ command: "git show -s --format='%an' HEAD",
18548
+ messageOnError: ERRORS.onBegin.failedToGetBranch,
18549
+ });
18545
18550
  const getInitializerData = ({ rootDir }, rootSuite) => rootSuite.allTests().map(test => {
18546
18551
  var _a;
18547
18552
  const { title, parent, id: history_id, location: { file }, } = test;
@@ -18595,7 +18600,9 @@ class MyReporter {
18595
18600
  const runDetails = {
18596
18601
  commit_id: getCurrentCommitSha(),
18597
18602
  commit_name: getCurrentCommitMessage(),
18603
+ author: getCurrentAuthor(),
18598
18604
  branch: getCurrentBranch(),
18605
+ tags: typeof this.tags === "string" ? this.tags.split(",") : this.tags,
18599
18606
  ci_build_id: this.ciBuildId,
18600
18607
  configuration: config,
18601
18608
  shards: createShardObject({ currentShard: shard === null || shard === void 0 ? void 0 : shard.current }),
@@ -18668,7 +18675,9 @@ class MyReporter {
18668
18675
  videos: [],
18669
18676
  traces: [],
18670
18677
  completed_at: completedAt.toString(),
18671
- 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}`,
18678
+ error_snippet: errorLocation
18679
+ ? `# ${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}`
18680
+ : null,
18672
18681
  };
18673
18682
  consoleLogFormatted.underline(title);
18674
18683
  await Promise.all(attachments.map(async ({ name, path, body, contentType, }) => {
@@ -18723,6 +18732,7 @@ class MyReporter {
18723
18732
  };
18724
18733
  initializeAxios(options);
18725
18734
  this.attempts = {};
18735
+ this.tags = options.tags;
18726
18736
  this.ciBuildId = options.ciBuildId;
18727
18737
  this.retryAttemptStartedAt = new Date();
18728
18738
  this.testResultCalls = [];