@alwaysmeticulous/cli 2.30.1 → 2.31.2
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/dist/api/test-run.api.d.ts +2 -11
- package/dist/api/types.d.ts +30 -0
- package/dist/api/types.js +2 -0
- package/dist/config/config.js +2 -1
- package/dist/index.d.ts +1 -1
- package/dist/parallel-tests/run-all-tests.d.ts +8 -10
- package/dist/parallel-tests/run-all-tests.js +4 -1
- package/dist/utils/config.utils.js +7 -1
- package/package.json +2 -2
|
@@ -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
|
-
|
|
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:
|
|
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 {};
|
package/dist/config/config.js
CHANGED
|
@@ -22,8 +22,9 @@ const getConfigFilePath = async () => {
|
|
|
22
22
|
return configFilePath;
|
|
23
23
|
};
|
|
24
24
|
const validateReplayOptions = (prevOptions) => {
|
|
25
|
-
const { screenshotSelector, diffThreshold, diffPixelThreshold, moveBeforeClick, simulationIdForAssets, } = prevOptions;
|
|
25
|
+
const { appUrl, screenshotSelector, diffThreshold, diffPixelThreshold, moveBeforeClick, simulationIdForAssets, } = prevOptions;
|
|
26
26
|
return {
|
|
27
|
+
...(appUrl != null ? { appUrl } : {}),
|
|
27
28
|
...(screenshotSelector != null ? { screenshotSelector } : {}),
|
|
28
29
|
...(diffThreshold != null ? { diffThreshold } : {}),
|
|
29
30
|
...(diffPixelThreshold != null ? { diffPixelThreshold } : {}),
|
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 {
|
|
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:
|
|
47
|
+
onTestRunCreated?: (testRun: RunAllTestsTestRun & {
|
|
44
48
|
status: "Running";
|
|
45
49
|
}) => void;
|
|
46
|
-
onTestFinished?: (testRun:
|
|
50
|
+
onTestFinished?: (testRun: RunAllTestsTestRun & {
|
|
47
51
|
status: "Running";
|
|
48
52
|
}) => void;
|
|
49
53
|
}
|
|
50
54
|
export interface RunAllTestsResult {
|
|
51
|
-
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,
|
|
@@ -12,7 +12,7 @@ const addTestCase = async (testCase) => {
|
|
|
12
12
|
};
|
|
13
13
|
exports.addTestCase = addTestCase;
|
|
14
14
|
const getReplayTargetForTestCase = ({ useAssetsSnapshottedInBaseSimulation, appUrl, testCase, }) => {
|
|
15
|
-
var _a, _b;
|
|
15
|
+
var _a, _b, _c;
|
|
16
16
|
if (((_a = testCase.options) === null || _a === void 0 ? void 0 : _a.simulationIdForAssets) != null) {
|
|
17
17
|
return {
|
|
18
18
|
type: "snapshotted-assets",
|
|
@@ -28,6 +28,12 @@ const getReplayTargetForTestCase = ({ useAssetsSnapshottedInBaseSimulation, appU
|
|
|
28
28
|
simulationIdForAssets: testCase.baseReplayId,
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
|
+
if ((_c = testCase.options) === null || _c === void 0 ? void 0 : _c.appUrl) {
|
|
32
|
+
if (appUrl) {
|
|
33
|
+
throw new Error(`Test cases "${testCase.title}" has an "appUrl" option but --appUrl is also provided.`);
|
|
34
|
+
}
|
|
35
|
+
return { type: "url", appUrl: testCase.options.appUrl };
|
|
36
|
+
}
|
|
31
37
|
if (appUrl) {
|
|
32
38
|
return { type: "url", appUrl };
|
|
33
39
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alwaysmeticulous/cli",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.31.2",
|
|
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": "
|
|
96
|
+
"gitHead": "e0df9ee41f550013df780a27e55615d32188dc2b"
|
|
97
97
|
}
|