@alwaysmeticulous/cli 2.30.1 → 2.31.0

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.
@@ -1,16 +1,7 @@
1
1
  import { TestRunConfigData } from "@alwaysmeticulous/api";
2
2
  import { AxiosInstance } from "axios";
3
3
  import { TestCaseResult } from "../config/config.types";
4
- export type TestRunStatus = "Running" | "Success" | "Failure";
5
- export interface TestRun {
6
- id: string;
7
- status: TestRunStatus;
8
- resultData?: {
9
- results: TestCaseResult[];
10
- [key: string]: any;
11
- };
12
- [key: string]: any;
13
- }
4
+ import { TestRun, TestRunStatus } from "./types";
14
5
  export declare const getTestRun: (options: {
15
6
  client: AxiosInstance;
16
7
  testRunId: string;
@@ -24,7 +15,7 @@ export declare const createTestRun: (options: {
24
15
  export declare const putTestRunResults: (options: {
25
16
  client: AxiosInstance;
26
17
  testRunId: string;
27
- status: "Running" | "Success" | "Failure";
18
+ status: TestRunStatus;
28
19
  resultData: {
29
20
  [key: string]: any;
30
21
  };
@@ -0,0 +1,30 @@
1
+ import { TestCaseResult } from "../config/config.types";
2
+ interface Organization {
3
+ id: string;
4
+ name: string;
5
+ createdAt: string;
6
+ updatedAt: string;
7
+ }
8
+ interface Project {
9
+ id: string;
10
+ name: string;
11
+ recordingToken: string;
12
+ apiToken: string;
13
+ isGitHubIntegrationActive: boolean;
14
+ url: string;
15
+ organization: Organization;
16
+ createdAt: string;
17
+ updatedAt: string;
18
+ }
19
+ export type TestRunStatus = "Running" | "Success" | "Failure";
20
+ export interface TestRun {
21
+ id: string;
22
+ status: TestRunStatus;
23
+ project: Project;
24
+ resultData?: {
25
+ results: TestCaseResult[];
26
+ [key: string]: any;
27
+ };
28
+ [key: string]: any;
29
+ }
30
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/dist/index.d.ts CHANGED
@@ -9,6 +9,6 @@ export { runAllTestsCommand } from "./commands/run-all-tests/run-all-tests.comma
9
9
  export { screenshotDiffCommand } from "./commands/screenshot-diff/screenshot-diff.command";
10
10
  export { showProjectCommand } from "./commands/show-project/show-project.command";
11
11
  export { updateTestsCommand } from "./commands/update-tests/update-tests.command";
12
- export { runAllTests, RunAllTestsResult, TestRun, } from "./parallel-tests/run-all-tests";
12
+ export { runAllTests, RunAllTestsResult, RunAllTestsTestRun as TestRun, RunAllTestsTestRun, } from "./parallel-tests/run-all-tests";
13
13
  export { initLogger, setLogLevel } from "./utils/logger.utils";
14
14
  export { initSentry } from "./utils/sentry.utils";
@@ -1,9 +1,13 @@
1
1
  import { TestRunEnvironment } from "@alwaysmeticulous/api";
2
2
  import { ReplayExecutionOptions } from "@alwaysmeticulous/common";
3
- import { TestRunStatus } from "../api/test-run.api";
3
+ import { TestRun } from "../api/types";
4
4
  import { ScreenshotAssertionsEnabledOptions } from "../command-utils/common-types";
5
5
  import { DetailedTestCaseResult, TestCaseResult } from "../config/config.types";
6
6
  import { TestRunProgress } from "./run-all-tests.types";
7
+ export type RunAllTestsTestRun = Pick<TestRun, "id" | "url" | "status" | "project"> & {
8
+ progress: TestRunProgress;
9
+ url: string;
10
+ };
7
11
  export interface Options {
8
12
  testsFile: string | null;
9
13
  executionOptions: ReplayExecutionOptions;
@@ -40,25 +44,19 @@ export interface Options {
40
44
  * Captured environment for this run
41
45
  */
42
46
  environment?: TestRunEnvironment;
43
- onTestRunCreated?: (testRun: TestRun & {
47
+ onTestRunCreated?: (testRun: RunAllTestsTestRun & {
44
48
  status: "Running";
45
49
  }) => void;
46
- onTestFinished?: (testRun: TestRun & {
50
+ onTestFinished?: (testRun: RunAllTestsTestRun & {
47
51
  status: "Running";
48
52
  }) => void;
49
53
  }
50
54
  export interface RunAllTestsResult {
51
- testRun: TestRun & {
55
+ testRun: RunAllTestsTestRun & {
52
56
  status: "Success" | "Failure";
53
57
  };
54
58
  testCaseResults: DetailedTestCaseResult[];
55
59
  }
56
- export interface TestRun {
57
- id: string;
58
- url: string;
59
- status: TestRunStatus;
60
- progress: TestRunProgress;
61
- }
62
60
  /**
63
61
  * Runs all the test cases in the provided file.
64
62
  * @returns The results of the tests that were executed (note that this does not include results from any cachedTestRunResults passed in)
@@ -74,6 +74,7 @@ const runAllTests = async ({ testsFile, apiToken, commitSha, baseCommitSha, appU
74
74
  onTestRunCreated === null || onTestRunCreated === void 0 ? void 0 : onTestRunCreated({
75
75
  id: testRun.id,
76
76
  url: testRunUrl,
77
+ project: testRun.project,
77
78
  status: "Running",
78
79
  progress: {
79
80
  failedTestCases: 0,
@@ -115,6 +116,7 @@ const runAllTests = async ({ testsFile, apiToken, commitSha, baseCommitSha, appU
115
116
  onTestFinished_ === null || onTestFinished_ === void 0 ? void 0 : onTestFinished_({
116
117
  id: testRun.id,
117
118
  url: testRunUrl,
119
+ project: testRun.project,
118
120
  status: "Running",
119
121
  progress: {
120
122
  ...progress,
@@ -189,12 +191,13 @@ const runAllTests = async ({ testsFile, apiToken, commitSha, baseCommitSha, appU
189
191
  logger.info(`${title} => ${result}`);
190
192
  });
191
193
  if (githubSummary) {
192
- await (0, github_summary_utils_1.writeGitHubSummary)({ testRunUrl, results });
194
+ await (0, github_summary_utils_1.writeGitHubSummary)({ testRunUrl: testRunUrl, results });
193
195
  }
194
196
  return {
195
197
  testRun: {
196
198
  url: testRunUrl,
197
199
  id: testRun.id,
200
+ project: testRun.project,
198
201
  status: overallStatus,
199
202
  progress: {
200
203
  flakedTestCases: sortedResults.filter(({ result }) => result === "flake").length,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alwaysmeticulous/cli",
3
- "version": "2.30.1",
3
+ "version": "2.31.0",
4
4
  "description": "The Meticulous CLI",
5
5
  "license": "ISC",
6
6
  "main": "dist/index.js",
@@ -93,5 +93,5 @@
93
93
  "coverageDirectory": "../coverage",
94
94
  "testEnvironment": "node"
95
95
  },
96
- "gitHead": "e9b5274798b97abc5f83ba515a51164b2cf755ac"
96
+ "gitHead": "1b4b8369e9cde22a1c0b351f02968817c111b6f2"
97
97
  }