@alwaysmeticulous/cli 2.16.0 → 2.17.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.
- package/dist/api/test-run.api.d.ts +2 -1
- package/dist/commands/bootstrap/bootstrap.command.d.ts +1 -1
- package/dist/commands/bootstrap/bootstrap.command.js +2 -2
- package/dist/commands/create-test/create-test.command.d.ts +1 -1
- package/dist/commands/create-test/create-test.command.js +2 -2
- package/dist/commands/debug-replay/debug-replay.command.d.ts +1 -1
- package/dist/commands/debug-replay/debug-replay.command.js +2 -2
- package/dist/commands/download-replay/download-replay.command.d.ts +1 -1
- package/dist/commands/download-replay/download-replay.command.js +2 -2
- package/dist/commands/download-session/download-session.command.d.ts +1 -1
- package/dist/commands/download-session/download-session.command.js +2 -2
- package/dist/commands/record/record.command.d.ts +1 -1
- package/dist/commands/record/record.command.js +2 -2
- package/dist/commands/replay/replay.command.d.ts +1 -1
- package/dist/commands/replay/replay.command.js +2 -2
- package/dist/commands/run-all-tests/run-all-tests.command.d.ts +4 -2
- package/dist/commands/run-all-tests/run-all-tests.command.js +22 -120
- package/dist/commands/screenshot-diff/screenshot-diff.command.d.ts +1 -1
- package/dist/commands/screenshot-diff/screenshot-diff.command.js +3 -3
- package/dist/commands/serve/serve.command.d.ts +1 -1
- package/dist/commands/serve/serve.command.js +2 -2
- package/dist/commands/show-project/show-project.command.d.ts +1 -1
- package/dist/commands/show-project/show-project.command.js +2 -2
- package/dist/commands/update-tests/update-tests.command.d.ts +1 -1
- package/dist/commands/update-tests/update-tests.command.js +2 -2
- package/dist/index.d.ts +12 -11
- package/dist/index.js +14 -12
- package/dist/main.js +12 -12
- package/dist/parallel-tests/parallel-tests.handler.d.ts +2 -0
- package/dist/parallel-tests/parallel-tests.handler.js +10 -1
- package/dist/parallel-tests/run-all-tests.d.ts +46 -0
- package/dist/parallel-tests/run-all-tests.js +169 -0
- package/dist/parallel-tests/run-all-tests.types.d.ts +5 -0
- package/dist/parallel-tests/run-all-tests.types.js +2 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/github-summary.utils.d.ts +1 -2
- package/dist/utils/github-summary.utils.js +1 -3
- package/package.json +2 -2
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { AxiosInstance } from "axios";
|
|
2
2
|
import { TestCaseResult } from "../config/config.types";
|
|
3
|
+
export declare type TestRunStatus = "Running" | "Success" | "Failure";
|
|
3
4
|
export interface TestRun {
|
|
4
5
|
id: string;
|
|
5
|
-
status:
|
|
6
|
+
status: TestRunStatus;
|
|
6
7
|
resultData?: {
|
|
7
8
|
results: TestCaseResult[];
|
|
8
9
|
[key: string]: any;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/// <reference types="yargs" />
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const bootstrapCommand: import("yargs").CommandModule<unknown, import("yargs").InferredOptionTypes<{}>>;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.bootstrapCommand = void 0;
|
|
7
7
|
const common_1 = require("@alwaysmeticulous/common");
|
|
8
8
|
const chalk_1 = __importDefault(require("chalk"));
|
|
9
9
|
const loglevel_1 = __importDefault(require("loglevel"));
|
|
@@ -25,7 +25,7 @@ const handler = async () => {
|
|
|
25
25
|
command: "meticulous run-all-tests --headless --parallelize --deflake",
|
|
26
26
|
});
|
|
27
27
|
};
|
|
28
|
-
exports.
|
|
28
|
+
exports.bootstrapCommand = (0, command_builder_1.buildCommand)("bootstrap")
|
|
29
29
|
.details({
|
|
30
30
|
describe: "Bootstrap your project to use Meticulous",
|
|
31
31
|
})
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="yargs" />
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const createTestCommand: import("yargs").CommandModule<unknown, import("yargs").InferredOptionTypes<{
|
|
3
3
|
headless: {
|
|
4
4
|
default: boolean;
|
|
5
5
|
boolean: true;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.createTestCommand = void 0;
|
|
7
7
|
const common_1 = require("@alwaysmeticulous/common");
|
|
8
8
|
const chalk_1 = __importDefault(require("chalk"));
|
|
9
9
|
const inquirer_1 = require("inquirer");
|
|
@@ -121,7 +121,7 @@ headless, screenshotSelector, padTime, shiftTime, networkStubbing, moveBeforeCli
|
|
|
121
121
|
const replay = await (0, replay_command_1.rawReplayCommandHandler)(replayOptions);
|
|
122
122
|
await handleTestCreation(replay, lastSessionId);
|
|
123
123
|
};
|
|
124
|
-
exports.
|
|
124
|
+
exports.createTestCommand = (0, command_builder_1.buildCommand)("create-test")
|
|
125
125
|
.details({
|
|
126
126
|
describe: "Create a new test",
|
|
127
127
|
})
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="yargs" />
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const debugReplayCommand: import("yargs").CommandModule<unknown, import("yargs").InferredOptionTypes<{
|
|
3
3
|
apiToken: {
|
|
4
4
|
string: true;
|
|
5
5
|
};
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.debugReplayCommand = void 0;
|
|
7
7
|
const common_1 = require("@alwaysmeticulous/common");
|
|
8
8
|
const loglevel_1 = __importDefault(require("loglevel"));
|
|
9
9
|
const client_1 = require("../../api/client");
|
|
@@ -60,7 +60,7 @@ const handler = async ({ apiToken, sessionId, appUrl, devTools, shiftTime, netwo
|
|
|
60
60
|
};
|
|
61
61
|
await createReplayer(createReplayerParams);
|
|
62
62
|
};
|
|
63
|
-
exports.
|
|
63
|
+
exports.debugReplayCommand = (0, command_builder_1.buildCommand)("debug-simulation")
|
|
64
64
|
.details({
|
|
65
65
|
aliases: ["debug-replay"],
|
|
66
66
|
describe: "Replay and debug a recorded session",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="yargs" />
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const downloadReplayCommand: import("yargs").CommandModule<unknown, import("yargs").InferredOptionTypes<{
|
|
3
3
|
apiToken: {
|
|
4
4
|
string: true;
|
|
5
5
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.downloadReplayCommand = void 0;
|
|
4
4
|
const client_1 = require("../../api/client");
|
|
5
5
|
const command_builder_1 = require("../../command-utils/command-builder");
|
|
6
6
|
const replays_1 = require("../../local-data/replays");
|
|
@@ -9,7 +9,7 @@ const handler = async ({ apiToken, replayId, }) => {
|
|
|
9
9
|
await (0, replays_1.getOrFetchReplay)(client, replayId);
|
|
10
10
|
await (0, replays_1.getOrFetchReplayArchive)(client, replayId);
|
|
11
11
|
};
|
|
12
|
-
exports.
|
|
12
|
+
exports.downloadReplayCommand = (0, command_builder_1.buildCommand)("download-simulation")
|
|
13
13
|
.details({
|
|
14
14
|
aliases: ["download-replay"],
|
|
15
15
|
describe: "Download a simulation from Meticulous",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="yargs" />
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const downloadSessionCommand: import("yargs").CommandModule<unknown, import("yargs").InferredOptionTypes<{
|
|
3
3
|
apiToken: {
|
|
4
4
|
string: true;
|
|
5
5
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.downloadSessionCommand = void 0;
|
|
4
4
|
const client_1 = require("../../api/client");
|
|
5
5
|
const command_builder_1 = require("../../command-utils/command-builder");
|
|
6
6
|
const sessions_1 = require("../../local-data/sessions");
|
|
@@ -9,7 +9,7 @@ const handler = async ({ apiToken, sessionId, }) => {
|
|
|
9
9
|
await (0, sessions_1.getOrFetchRecordedSession)(client, sessionId);
|
|
10
10
|
await (0, sessions_1.getOrFetchRecordedSessionData)(client, sessionId);
|
|
11
11
|
};
|
|
12
|
-
exports.
|
|
12
|
+
exports.downloadSessionCommand = (0, command_builder_1.buildCommand)("download-session")
|
|
13
13
|
.details({
|
|
14
14
|
describe: "Download recorded session from Meticulous",
|
|
15
15
|
})
|
|
@@ -12,7 +12,7 @@ export interface RecordCommandHandlerOptions {
|
|
|
12
12
|
onDetectedSession?: (sessionId: string) => void;
|
|
13
13
|
}
|
|
14
14
|
export declare const recordCommandHandler: (options: RecordCommandHandlerOptions) => Promise<void>;
|
|
15
|
-
export declare const
|
|
15
|
+
export declare const recordCommand: import("yargs").CommandModule<unknown, import("yargs").InferredOptionTypes<{
|
|
16
16
|
apiToken: {
|
|
17
17
|
string: true;
|
|
18
18
|
demandOption: true;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.recordCommand = exports.recordCommandHandler = void 0;
|
|
7
7
|
const path_1 = require("path");
|
|
8
8
|
const common_1 = require("@alwaysmeticulous/common");
|
|
9
9
|
const loglevel_1 = __importDefault(require("loglevel"));
|
|
@@ -99,7 +99,7 @@ const recordCommandHandler = async ({ apiToken, commitSha: commitSha_, devTools,
|
|
|
99
99
|
});
|
|
100
100
|
};
|
|
101
101
|
exports.recordCommandHandler = recordCommandHandler;
|
|
102
|
-
exports.
|
|
102
|
+
exports.recordCommand = (0, command_builder_1.buildCommand)("record")
|
|
103
103
|
.details({
|
|
104
104
|
describe: "Record a session",
|
|
105
105
|
})
|
|
@@ -33,7 +33,7 @@ export declare const getReplayTarget: ({ appUrl, simulationIdForAssets, }: {
|
|
|
33
33
|
appUrl: string | null;
|
|
34
34
|
simulationIdForAssets: string | null;
|
|
35
35
|
}) => ReplayTarget;
|
|
36
|
-
export declare const
|
|
36
|
+
export declare const replayCommand: import("yargs").CommandModule<unknown, import("yargs").InferredOptionTypes<{
|
|
37
37
|
diffThreshold: {
|
|
38
38
|
readonly number: true;
|
|
39
39
|
readonly description: "Acceptable maximum proportion of changed pixels, between 0 and 1. If this proportion is exceeded then the test will fail.";
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.replayCommand = exports.getReplayTarget = exports.rawReplayCommandHandler = exports.replayCommandHandler = void 0;
|
|
7
7
|
const promises_1 = require("fs/promises");
|
|
8
8
|
const path_1 = require("path");
|
|
9
9
|
const common_1 = require("@alwaysmeticulous/common");
|
|
@@ -248,7 +248,7 @@ const getReplayTarget = ({ appUrl, simulationIdForAssets, }) => {
|
|
|
248
248
|
return { type: "original-recorded-url" };
|
|
249
249
|
};
|
|
250
250
|
exports.getReplayTarget = getReplayTarget;
|
|
251
|
-
exports.
|
|
251
|
+
exports.replayCommand = (0, command_builder_1.buildCommand)("simulate")
|
|
252
252
|
.details({
|
|
253
253
|
aliases: ["replay"],
|
|
254
254
|
describe: "Simulate (replay) a recorded session",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="yargs" />
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const runAllTestsCommand: import("yargs").CommandModule<unknown, import("yargs").InferredOptionTypes<{
|
|
3
3
|
readonly diffThreshold: {
|
|
4
4
|
readonly number: true;
|
|
5
5
|
readonly description: "Acceptable maximum proportion of changed pixels, between 0 and 1. If this proportion is exceeded then the test will fail.";
|
|
@@ -90,14 +90,16 @@ export declare const runAllTests: import("yargs").CommandModule<unknown, import(
|
|
|
90
90
|
readonly githubSummary: {
|
|
91
91
|
readonly boolean: true;
|
|
92
92
|
readonly description: "Outputs a summary page for GitHub actions";
|
|
93
|
+
readonly default: false;
|
|
93
94
|
};
|
|
94
95
|
readonly parallelize: {
|
|
95
96
|
readonly boolean: true;
|
|
96
97
|
readonly description: "Run tests in parallel";
|
|
98
|
+
readonly default: false;
|
|
97
99
|
};
|
|
98
100
|
readonly parallelTasks: {
|
|
99
101
|
readonly number: true;
|
|
100
|
-
readonly description: "Number of tasks to run in parallel";
|
|
102
|
+
readonly description: "Number of tasks to run in parallel (if not set a default value is used based on the number of CPUs)";
|
|
101
103
|
readonly coerce: (value: number | null | undefined) => number | null | undefined;
|
|
102
104
|
};
|
|
103
105
|
readonly deflake: {
|
|
@@ -1,28 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
7
|
-
const common_1 = require("@alwaysmeticulous/common");
|
|
8
|
-
const loglevel_1 = __importDefault(require("loglevel"));
|
|
9
|
-
const client_1 = require("../../api/client");
|
|
10
|
-
const test_run_api_1 = require("../../api/test-run.api");
|
|
3
|
+
exports.runAllTestsCommand = void 0;
|
|
11
4
|
const command_builder_1 = require("../../command-utils/command-builder");
|
|
12
5
|
const common_options_1 = require("../../command-utils/common-options");
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const replay_assets_1 = require("../../local-data/replay-assets");
|
|
16
|
-
const parallel_tests_handler_1 = require("../../parallel-tests/parallel-tests.handler");
|
|
17
|
-
const commit_sha_utils_1 = require("../../utils/commit-sha.utils");
|
|
18
|
-
const config_utils_1 = require("../../utils/config.utils");
|
|
19
|
-
const github_summary_utils_1 = require("../../utils/github-summary.utils");
|
|
20
|
-
const run_all_tests_utils_1 = require("../../utils/run-all-tests.utils");
|
|
21
|
-
const version_utils_1 = require("../../utils/version.utils");
|
|
22
|
-
const handler = async ({ apiToken, commitSha: commitSha_, baseCommitSha, appUrl, useAssetsSnapshottedInBaseSimulation, headless, devTools, bypassCSP, diffThreshold, diffPixelThreshold, padTime, shiftTime, networkStubbing, githubSummary, parallelize, parallelTasks, deflake, useCache, testsFile, disableRemoteFonts, noSandbox, skipPauses, moveBeforeClick, maxDurationMs, maxEventCount, storyboard, }) => {
|
|
23
|
-
if (appUrl != null && useAssetsSnapshottedInBaseSimulation) {
|
|
24
|
-
throw new Error("Arguments useAssetsSnapshottedInBaseSimulation and appUrl are mutually exclusive");
|
|
25
|
-
}
|
|
6
|
+
const run_all_tests_1 = require("../../parallel-tests/run-all-tests");
|
|
7
|
+
const handler = async ({ apiToken, commitSha, baseCommitSha, appUrl, useAssetsSnapshottedInBaseSimulation, headless, devTools, bypassCSP, diffThreshold, diffPixelThreshold, padTime, shiftTime, networkStubbing, githubSummary, parallelize, parallelTasks: parrelelTasks_, deflake, useCache, testsFile, disableRemoteFonts, noSandbox, skipPauses, moveBeforeClick, maxDurationMs, maxEventCount, storyboard, }) => {
|
|
26
8
|
const executionOptions = {
|
|
27
9
|
headless,
|
|
28
10
|
devTools,
|
|
@@ -46,108 +28,26 @@ const handler = async ({ apiToken, commitSha: commitSha_, baseCommitSha, appUrl,
|
|
|
46
28
|
diffOptions: { diffPixelThreshold, diffThreshold },
|
|
47
29
|
storyboardOptions,
|
|
48
30
|
};
|
|
49
|
-
const
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
const testRun = await (0, test_run_api_1.createTestRun)({
|
|
64
|
-
client,
|
|
65
|
-
commitSha,
|
|
66
|
-
meticulousSha,
|
|
67
|
-
configData: config,
|
|
68
|
-
});
|
|
69
|
-
const testRunUrl = (0, test_run_api_1.getTestRunUrl)(testRun);
|
|
70
|
-
logger.info("");
|
|
71
|
-
logger.info(`Test run URL: ${testRunUrl}`);
|
|
72
|
-
logger.info("");
|
|
73
|
-
const getResults = async () => {
|
|
74
|
-
if (parallelize) {
|
|
75
|
-
const results = await (0, parallel_tests_handler_1.runAllTestsInParallel)({
|
|
76
|
-
config,
|
|
77
|
-
client,
|
|
78
|
-
testRun,
|
|
79
|
-
executionOptions,
|
|
80
|
-
screenshottingOptions,
|
|
81
|
-
apiToken: apiToken !== null && apiToken !== void 0 ? apiToken : null,
|
|
82
|
-
commitSha,
|
|
83
|
-
appUrl: appUrl !== null && appUrl !== void 0 ? appUrl : null,
|
|
84
|
-
useAssetsSnapshottedInBaseSimulation,
|
|
85
|
-
parallelTasks: parallelTasks !== null && parallelTasks !== void 0 ? parallelTasks : null,
|
|
86
|
-
deflake,
|
|
87
|
-
cachedTestRunResults,
|
|
88
|
-
replayEventsDependencies,
|
|
89
|
-
baseCommitSha: baseCommitSha !== null && baseCommitSha !== void 0 ? baseCommitSha : null,
|
|
90
|
-
});
|
|
91
|
-
return results;
|
|
92
|
-
}
|
|
93
|
-
const results = [...cachedTestRunResults];
|
|
94
|
-
const testsToRun = await (0, run_all_tests_utils_1.getTestsToRun)({
|
|
95
|
-
testCases,
|
|
96
|
-
cachedTestRunResults,
|
|
97
|
-
client,
|
|
98
|
-
baseCommitSha: baseCommitSha !== null && baseCommitSha !== void 0 ? baseCommitSha : null,
|
|
99
|
-
});
|
|
100
|
-
for (const testCase of testsToRun) {
|
|
101
|
-
const result = await (0, deflake_tests_handler_1.deflakeReplayCommandHandler)({
|
|
102
|
-
replayTarget: (0, config_utils_1.getReplayTargetForTestCase)({
|
|
103
|
-
useAssetsSnapshottedInBaseSimulation,
|
|
104
|
-
appUrl: appUrl !== null && appUrl !== void 0 ? appUrl : null,
|
|
105
|
-
testCase,
|
|
106
|
-
}),
|
|
107
|
-
executionOptions,
|
|
108
|
-
screenshottingOptions,
|
|
109
|
-
testCase,
|
|
110
|
-
apiToken: apiToken !== null && apiToken !== void 0 ? apiToken : null,
|
|
111
|
-
commitSha,
|
|
112
|
-
deflake: deflake !== null && deflake !== void 0 ? deflake : false,
|
|
113
|
-
generatedBy: { type: "testRun", runId: testRun.id },
|
|
114
|
-
testRunId: testRun.id,
|
|
115
|
-
replayEventsDependencies,
|
|
116
|
-
});
|
|
117
|
-
results.push(result);
|
|
118
|
-
await (0, test_run_api_1.putTestRunResults)({
|
|
119
|
-
client,
|
|
120
|
-
testRunId: testRun.id,
|
|
121
|
-
status: "Running",
|
|
122
|
-
resultData: { results },
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
return (0, run_all_tests_utils_1.sortResults)({ results, testCases });
|
|
126
|
-
};
|
|
127
|
-
const results = await getResults();
|
|
128
|
-
const runAllFailure = results.find(({ result }) => result === "fail");
|
|
129
|
-
await (0, test_run_api_1.putTestRunResults)({
|
|
130
|
-
client,
|
|
131
|
-
testRunId: testRun.id,
|
|
132
|
-
status: runAllFailure ? "Failure" : "Success",
|
|
133
|
-
resultData: { results },
|
|
134
|
-
});
|
|
135
|
-
logger.info("");
|
|
136
|
-
logger.info("Results");
|
|
137
|
-
logger.info("=======");
|
|
138
|
-
logger.info(`URL: ${testRunUrl}`);
|
|
139
|
-
logger.info("=======");
|
|
140
|
-
results.forEach(({ title, result }) => {
|
|
141
|
-
logger.info(`${title} => ${result}`);
|
|
31
|
+
const parrelelTasks = parallelize ? parrelelTasks_ : 1;
|
|
32
|
+
const result = await (0, run_all_tests_1.runAllTests)({
|
|
33
|
+
testsFile: testsFile !== null && testsFile !== void 0 ? testsFile : null,
|
|
34
|
+
executionOptions,
|
|
35
|
+
screenshottingOptions,
|
|
36
|
+
apiToken: apiToken !== null && apiToken !== void 0 ? apiToken : null,
|
|
37
|
+
commitSha: commitSha !== null && commitSha !== void 0 ? commitSha : null,
|
|
38
|
+
baseCommitSha: baseCommitSha !== null && baseCommitSha !== void 0 ? baseCommitSha : null,
|
|
39
|
+
appUrl: appUrl !== null && appUrl !== void 0 ? appUrl : null,
|
|
40
|
+
useAssetsSnapshottedInBaseSimulation,
|
|
41
|
+
parallelTasks: parrelelTasks !== null && parrelelTasks !== void 0 ? parrelelTasks : null,
|
|
42
|
+
deflake,
|
|
43
|
+
useCache,
|
|
44
|
+
githubSummary,
|
|
142
45
|
});
|
|
143
|
-
if (
|
|
144
|
-
await (0, github_summary_utils_1.writeGitHubSummary)({ testRun, results });
|
|
145
|
-
}
|
|
146
|
-
if (runAllFailure) {
|
|
46
|
+
if (result.testRun.status === "Failure") {
|
|
147
47
|
process.exit(1);
|
|
148
48
|
}
|
|
149
49
|
};
|
|
150
|
-
exports.
|
|
50
|
+
exports.runAllTestsCommand = (0, command_builder_1.buildCommand)("run-all-tests")
|
|
151
51
|
.details({ describe: "Run all replay test cases" })
|
|
152
52
|
.options({
|
|
153
53
|
apiToken: common_options_1.OPTIONS.apiToken,
|
|
@@ -170,14 +70,16 @@ exports.runAllTests = (0, command_builder_1.buildCommand)("run-all-tests")
|
|
|
170
70
|
githubSummary: {
|
|
171
71
|
boolean: true,
|
|
172
72
|
description: "Outputs a summary page for GitHub actions",
|
|
73
|
+
default: false,
|
|
173
74
|
},
|
|
174
75
|
parallelize: {
|
|
175
76
|
boolean: true,
|
|
176
77
|
description: "Run tests in parallel",
|
|
78
|
+
default: false,
|
|
177
79
|
},
|
|
178
80
|
parallelTasks: {
|
|
179
81
|
number: true,
|
|
180
|
-
description: "Number of tasks to run in parallel",
|
|
82
|
+
description: "Number of tasks to run in parallel (if not set a default value is used based on the number of CPUs)",
|
|
181
83
|
coerce: (value) => {
|
|
182
84
|
if (typeof value === "number" && value <= 0) {
|
|
183
85
|
return null;
|
|
@@ -25,7 +25,7 @@ export declare class ScreenshotDiffError extends Error {
|
|
|
25
25
|
headReplayId: string;
|
|
26
26
|
} | undefined);
|
|
27
27
|
}
|
|
28
|
-
export declare const
|
|
28
|
+
export declare const screenshotDiffCommand: import("yargs").CommandModule<unknown, import("yargs").InferredOptionTypes<{
|
|
29
29
|
apiToken: {
|
|
30
30
|
string: true;
|
|
31
31
|
};
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.screenshotDiffCommand = exports.ScreenshotDiffError = exports.checkScreenshotDiffResult = exports.diffScreenshots = void 0;
|
|
7
7
|
const path_1 = require("path");
|
|
8
8
|
const common_1 = require("@alwaysmeticulous/common");
|
|
9
9
|
const loglevel_1 = __importDefault(require("loglevel"));
|
|
@@ -164,7 +164,7 @@ const getScreenshotIdentifier = (filename) => {
|
|
|
164
164
|
if (match && eventNumber != null && !isNaN(eventNumber)) {
|
|
165
165
|
return {
|
|
166
166
|
type: "after-event",
|
|
167
|
-
eventNumber
|
|
167
|
+
eventNumber,
|
|
168
168
|
};
|
|
169
169
|
}
|
|
170
170
|
}
|
|
@@ -199,7 +199,7 @@ const handler = async ({ apiToken, baseSimulationId: baseReplayId, headSimulatio
|
|
|
199
199
|
diffOptions,
|
|
200
200
|
});
|
|
201
201
|
};
|
|
202
|
-
exports.
|
|
202
|
+
exports.screenshotDiffCommand = (0, command_builder_1.buildCommand)("screenshot-diff")
|
|
203
203
|
.details({ describe: "Diff two replay screenshots" })
|
|
204
204
|
.options({
|
|
205
205
|
apiToken: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="yargs" />
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const serveCommand: import("yargs").CommandModule<unknown, import("yargs").InferredOptionTypes<{
|
|
3
3
|
apiToken: {
|
|
4
4
|
string: true;
|
|
5
5
|
};
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.serveCommand = void 0;
|
|
7
7
|
const common_1 = require("@alwaysmeticulous/common");
|
|
8
8
|
const loglevel_1 = __importDefault(require("loglevel"));
|
|
9
9
|
const client_1 = require("../../api/client");
|
|
@@ -15,7 +15,7 @@ const handler = async ({ apiToken, replayId, }) => {
|
|
|
15
15
|
const { url } = await (0, serve_assets_from_simulation_1.serveAssetsFromSimulation)(client, replayId);
|
|
16
16
|
logger.info(`Serving assets at url ${url}`);
|
|
17
17
|
};
|
|
18
|
-
exports.
|
|
18
|
+
exports.serveCommand = (0, command_builder_1.buildCommand)("serve")
|
|
19
19
|
.details({
|
|
20
20
|
describe: "Spin up a localhost server to serve the assets that were snapshotted when running a particular replay",
|
|
21
21
|
})
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="yargs" />
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const showProjectCommand: import("yargs").CommandModule<unknown, import("yargs").InferredOptionTypes<{
|
|
3
3
|
apiToken: {
|
|
4
4
|
string: true;
|
|
5
5
|
};
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.showProjectCommand = void 0;
|
|
7
7
|
const common_1 = require("@alwaysmeticulous/common");
|
|
8
8
|
const loglevel_1 = __importDefault(require("loglevel"));
|
|
9
9
|
const client_1 = require("../../api/client");
|
|
@@ -19,7 +19,7 @@ const handler = async ({ apiToken }) => {
|
|
|
19
19
|
}
|
|
20
20
|
logger.info(project);
|
|
21
21
|
};
|
|
22
|
-
exports.
|
|
22
|
+
exports.showProjectCommand = (0, command_builder_1.buildCommand)("show-project")
|
|
23
23
|
.details({
|
|
24
24
|
describe: "Shows project linked with current API token",
|
|
25
25
|
})
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="yargs" />
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const updateTestsCommand: import("yargs").CommandModule<unknown, import("yargs").InferredOptionTypes<{
|
|
3
3
|
apiToken: {
|
|
4
4
|
string: true;
|
|
5
5
|
};
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.updateTestsCommand = void 0;
|
|
7
7
|
const common_1 = require("@alwaysmeticulous/common");
|
|
8
8
|
const loglevel_1 = __importDefault(require("loglevel"));
|
|
9
9
|
const client_1 = require("../../api/client");
|
|
@@ -69,7 +69,7 @@ const handler = async ({ apiToken, testRunId, accept: accept_, acceptAll: accept
|
|
|
69
69
|
};
|
|
70
70
|
await (0, config_1.saveConfig)(newConfig);
|
|
71
71
|
};
|
|
72
|
-
exports.
|
|
72
|
+
exports.updateTestsCommand = (0, command_builder_1.buildCommand)("update-tests")
|
|
73
73
|
.details({
|
|
74
74
|
describe: "Updates test cases",
|
|
75
75
|
})
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
1
|
+
export { bootstrapCommand } from "./commands/bootstrap/bootstrap.command";
|
|
2
|
+
export { createTestCommand } from "./commands/create-test/create-test.command";
|
|
3
|
+
export { debugReplayCommand } from "./commands/debug-replay/debug-replay.command";
|
|
4
|
+
export { downloadReplayCommand } from "./commands/download-replay/download-replay.command";
|
|
5
|
+
export { downloadSessionCommand } from "./commands/download-session/download-session.command";
|
|
6
|
+
export { recordCommand } from "./commands/record/record.command";
|
|
7
|
+
export { replayCommand } from "./commands/replay/replay.command";
|
|
8
|
+
export { runAllTestsCommand } from "./commands/run-all-tests/run-all-tests.command";
|
|
9
|
+
export { screenshotDiffCommand } from "./commands/screenshot-diff/screenshot-diff.command";
|
|
10
|
+
export { showProjectCommand } from "./commands/show-project/show-project.command";
|
|
11
|
+
export { updateTestsCommand } from "./commands/update-tests/update-tests.command";
|
|
12
|
+
export { runAllTests, TestRun, RunAllTestsResult, } from "./parallel-tests/run-all-tests";
|
package/dist/index.js
CHANGED
|
@@ -1,25 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.runAllTests = exports.updateTestsCommand = exports.showProjectCommand = exports.screenshotDiffCommand = exports.runAllTestsCommand = exports.replayCommand = exports.recordCommand = exports.downloadSessionCommand = exports.downloadReplayCommand = exports.debugReplayCommand = exports.createTestCommand = exports.bootstrapCommand = void 0;
|
|
4
4
|
var bootstrap_command_1 = require("./commands/bootstrap/bootstrap.command");
|
|
5
|
-
Object.defineProperty(exports, "
|
|
5
|
+
Object.defineProperty(exports, "bootstrapCommand", { enumerable: true, get: function () { return bootstrap_command_1.bootstrapCommand; } });
|
|
6
6
|
var create_test_command_1 = require("./commands/create-test/create-test.command");
|
|
7
|
-
Object.defineProperty(exports, "
|
|
7
|
+
Object.defineProperty(exports, "createTestCommand", { enumerable: true, get: function () { return create_test_command_1.createTestCommand; } });
|
|
8
8
|
var debug_replay_command_1 = require("./commands/debug-replay/debug-replay.command");
|
|
9
|
-
Object.defineProperty(exports, "
|
|
9
|
+
Object.defineProperty(exports, "debugReplayCommand", { enumerable: true, get: function () { return debug_replay_command_1.debugReplayCommand; } });
|
|
10
10
|
var download_replay_command_1 = require("./commands/download-replay/download-replay.command");
|
|
11
|
-
Object.defineProperty(exports, "
|
|
11
|
+
Object.defineProperty(exports, "downloadReplayCommand", { enumerable: true, get: function () { return download_replay_command_1.downloadReplayCommand; } });
|
|
12
12
|
var download_session_command_1 = require("./commands/download-session/download-session.command");
|
|
13
|
-
Object.defineProperty(exports, "
|
|
13
|
+
Object.defineProperty(exports, "downloadSessionCommand", { enumerable: true, get: function () { return download_session_command_1.downloadSessionCommand; } });
|
|
14
14
|
var record_command_1 = require("./commands/record/record.command");
|
|
15
|
-
Object.defineProperty(exports, "
|
|
15
|
+
Object.defineProperty(exports, "recordCommand", { enumerable: true, get: function () { return record_command_1.recordCommand; } });
|
|
16
16
|
var replay_command_1 = require("./commands/replay/replay.command");
|
|
17
|
-
Object.defineProperty(exports, "
|
|
17
|
+
Object.defineProperty(exports, "replayCommand", { enumerable: true, get: function () { return replay_command_1.replayCommand; } });
|
|
18
18
|
var run_all_tests_command_1 = require("./commands/run-all-tests/run-all-tests.command");
|
|
19
|
-
Object.defineProperty(exports, "
|
|
19
|
+
Object.defineProperty(exports, "runAllTestsCommand", { enumerable: true, get: function () { return run_all_tests_command_1.runAllTestsCommand; } });
|
|
20
20
|
var screenshot_diff_command_1 = require("./commands/screenshot-diff/screenshot-diff.command");
|
|
21
|
-
Object.defineProperty(exports, "
|
|
21
|
+
Object.defineProperty(exports, "screenshotDiffCommand", { enumerable: true, get: function () { return screenshot_diff_command_1.screenshotDiffCommand; } });
|
|
22
22
|
var show_project_command_1 = require("./commands/show-project/show-project.command");
|
|
23
|
-
Object.defineProperty(exports, "
|
|
23
|
+
Object.defineProperty(exports, "showProjectCommand", { enumerable: true, get: function () { return show_project_command_1.showProjectCommand; } });
|
|
24
24
|
var update_tests_command_1 = require("./commands/update-tests/update-tests.command");
|
|
25
|
-
Object.defineProperty(exports, "
|
|
25
|
+
Object.defineProperty(exports, "updateTestsCommand", { enumerable: true, get: function () { return update_tests_command_1.updateTestsCommand; } });
|
|
26
|
+
var run_all_tests_1 = require("./parallel-tests/run-all-tests");
|
|
27
|
+
Object.defineProperty(exports, "runAllTests", { enumerable: true, get: function () { return run_all_tests_1.runAllTests; } });
|
package/dist/main.js
CHANGED
|
@@ -31,18 +31,18 @@ const main = () => {
|
|
|
31
31
|
.usage(`$0 <command>
|
|
32
32
|
|
|
33
33
|
Meticulous CLI`)
|
|
34
|
-
.command(bootstrap_command_1.
|
|
35
|
-
.command(create_test_command_1.
|
|
36
|
-
.command(debug_replay_command_1.
|
|
37
|
-
.command(download_replay_command_1.
|
|
38
|
-
.command(download_session_command_1.
|
|
39
|
-
.command(record_command_1.
|
|
40
|
-
.command(replay_command_1.
|
|
41
|
-
.command(run_all_tests_command_1.
|
|
42
|
-
.command(screenshot_diff_command_1.
|
|
43
|
-
.command(show_project_command_1.
|
|
44
|
-
.command(update_tests_command_1.
|
|
45
|
-
.command("serve", false, serve_command_1.
|
|
34
|
+
.command(bootstrap_command_1.bootstrapCommand)
|
|
35
|
+
.command(create_test_command_1.createTestCommand)
|
|
36
|
+
.command(debug_replay_command_1.debugReplayCommand)
|
|
37
|
+
.command(download_replay_command_1.downloadReplayCommand)
|
|
38
|
+
.command(download_session_command_1.downloadSessionCommand)
|
|
39
|
+
.command(record_command_1.recordCommand)
|
|
40
|
+
.command(replay_command_1.replayCommand)
|
|
41
|
+
.command(run_all_tests_command_1.runAllTestsCommand)
|
|
42
|
+
.command(screenshot_diff_command_1.screenshotDiffCommand)
|
|
43
|
+
.command(show_project_command_1.showProjectCommand)
|
|
44
|
+
.command(update_tests_command_1.updateTestsCommand)
|
|
45
|
+
.command("serve", false, serve_command_1.serveCommand) // This is a debugging command, so we hide it to not pollute the main menu
|
|
46
46
|
.help()
|
|
47
47
|
.strict()
|
|
48
48
|
.demandCommand()
|