@alwaysmeticulous/cli 2.5.2 → 2.5.5
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/command-utils/command-builder.d.ts +10 -0
- package/dist/command-utils/command-builder.js +19 -0
- package/dist/command-utils/common-options.d.ts +82 -82
- package/dist/commands/bootstrap/bootstrap.command.d.ts +2 -4
- package/dist/commands/bootstrap/bootstrap.command.js +6 -6
- package/dist/commands/create-test/create-test.command.d.ts +76 -7
- package/dist/commands/create-test/create-test.command.js +48 -51
- package/dist/commands/debug-replay/debug-replay.command.d.ts +35 -13
- package/dist/commands/debug-replay/debug-replay.command.js +38 -38
- package/dist/commands/download-replay/download-replay.command.d.ts +10 -7
- package/dist/commands/download-replay/download-replay.command.js +13 -13
- package/dist/commands/download-session/download-session.command.d.ts +10 -7
- package/dist/commands/download-session/download-session.command.js +13 -13
- package/dist/commands/record/record.command.d.ts +37 -2
- package/dist/commands/record/record.command.js +40 -40
- package/dist/commands/replay/replay.command.d.ts +114 -4
- package/dist/commands/replay/replay.command.js +73 -69
- package/dist/commands/run-all-tests/run-all-tests.command.d.ts +90 -17
- package/dist/commands/run-all-tests/run-all-tests.command.js +53 -54
- package/dist/commands/screenshot-diff/screenshot-diff.command.d.ts +26 -9
- package/dist/commands/screenshot-diff/screenshot-diff.command.js +20 -22
- package/dist/commands/serve/serve.command.d.ts +10 -7
- package/dist/commands/serve/serve.command.js +13 -13
- package/dist/commands/show-project/show-project.command.d.ts +6 -6
- package/dist/commands/show-project/show-project.command.js +9 -9
- package/dist/commands/update-tests/update-tests.command.d.ts +21 -9
- package/dist/commands/update-tests/update-tests.command.js +24 -23
- package/dist/commands/upload-build/upload-build.command.d.ts +13 -8
- package/dist/commands/upload-build/upload-build.command.js +16 -16
- package/dist/deflake-tests/deflake-tests.handler.d.ts +2 -1
- package/dist/deflake-tests/deflake-tests.handler.js +2 -1
- package/dist/parallel-tests/parallel-tests.handler.js +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ArgumentsCamelCase, CommandModule, InferredOptionTypes, Options } from "yargs";
|
|
2
|
+
export declare const buildCommand: (command: string) => {
|
|
3
|
+
details: (details: Omit<CommandModule, "command" | "builder" | "handler">) => {
|
|
4
|
+
options: <O extends {
|
|
5
|
+
[key: string]: Options;
|
|
6
|
+
}>(options: O) => {
|
|
7
|
+
handler: (unwrappedHandler: (args: ArgumentsCamelCase<InferredOptionTypes<O>>) => Promise<void>) => CommandModule<unknown, InferredOptionTypes<O>>;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildCommand = void 0;
|
|
4
|
+
const sentry_utils_1 = require("../utils/sentry.utils");
|
|
5
|
+
const buildCommand = (command) => {
|
|
6
|
+
return {
|
|
7
|
+
details: (details) => ({
|
|
8
|
+
options: (options) => ({
|
|
9
|
+
handler: (unwrappedHandler) => ({
|
|
10
|
+
command,
|
|
11
|
+
...details,
|
|
12
|
+
builder: options,
|
|
13
|
+
handler: (0, sentry_utils_1.wrapHandler)(unwrappedHandler),
|
|
14
|
+
}),
|
|
15
|
+
}),
|
|
16
|
+
}),
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
exports.buildCommand = buildCommand;
|
|
@@ -1,71 +1,71 @@
|
|
|
1
1
|
export declare const OPTIONS: {
|
|
2
|
-
apiToken: {
|
|
3
|
-
string:
|
|
4
|
-
};
|
|
5
|
-
commitSha: {
|
|
6
|
-
string:
|
|
7
|
-
};
|
|
8
|
-
headless: {
|
|
9
|
-
boolean:
|
|
10
|
-
description:
|
|
11
|
-
default:
|
|
12
|
-
};
|
|
13
|
-
devTools: {
|
|
14
|
-
boolean:
|
|
15
|
-
description:
|
|
16
|
-
default:
|
|
17
|
-
};
|
|
18
|
-
bypassCSP: {
|
|
19
|
-
boolean:
|
|
20
|
-
description:
|
|
21
|
-
default:
|
|
22
|
-
};
|
|
23
|
-
padTime: {
|
|
24
|
-
boolean:
|
|
25
|
-
description:
|
|
26
|
-
default:
|
|
27
|
-
};
|
|
28
|
-
shiftTime: {
|
|
29
|
-
boolean:
|
|
30
|
-
description:
|
|
31
|
-
default:
|
|
32
|
-
};
|
|
33
|
-
networkStubbing: {
|
|
34
|
-
boolean:
|
|
35
|
-
description:
|
|
36
|
-
default:
|
|
37
|
-
};
|
|
38
|
-
skipPauses: {
|
|
39
|
-
boolean:
|
|
40
|
-
description:
|
|
41
|
-
default:
|
|
42
|
-
};
|
|
43
|
-
moveBeforeClick: {
|
|
44
|
-
boolean:
|
|
45
|
-
description:
|
|
46
|
-
default:
|
|
47
|
-
};
|
|
48
|
-
diffThreshold: {
|
|
49
|
-
number:
|
|
50
|
-
description:
|
|
51
|
-
default:
|
|
52
|
-
};
|
|
53
|
-
diffPixelThreshold: {
|
|
54
|
-
number:
|
|
55
|
-
description:
|
|
56
|
-
default:
|
|
2
|
+
readonly apiToken: {
|
|
3
|
+
readonly string: true;
|
|
4
|
+
};
|
|
5
|
+
readonly commitSha: {
|
|
6
|
+
readonly string: true;
|
|
7
|
+
};
|
|
8
|
+
readonly headless: {
|
|
9
|
+
readonly boolean: true;
|
|
10
|
+
readonly description: "Start browser in headless mode";
|
|
11
|
+
readonly default: false;
|
|
12
|
+
};
|
|
13
|
+
readonly devTools: {
|
|
14
|
+
readonly boolean: true;
|
|
15
|
+
readonly description: "Open Chrome Dev Tools";
|
|
16
|
+
readonly default: false;
|
|
17
|
+
};
|
|
18
|
+
readonly bypassCSP: {
|
|
19
|
+
readonly boolean: true;
|
|
20
|
+
readonly description: "Enables bypass CSP in the browser (danger: this could mean you tests hit your production backend)";
|
|
21
|
+
readonly default: false;
|
|
22
|
+
};
|
|
23
|
+
readonly padTime: {
|
|
24
|
+
readonly boolean: true;
|
|
25
|
+
readonly description: "Pad replay time according to recording duration. Please note this option will be ignored if running with the '--skipPauses' option.";
|
|
26
|
+
readonly default: true;
|
|
27
|
+
};
|
|
28
|
+
readonly shiftTime: {
|
|
29
|
+
readonly boolean: true;
|
|
30
|
+
readonly description: "Shift time during simulation to be set as the recording time";
|
|
31
|
+
readonly default: true;
|
|
32
|
+
};
|
|
33
|
+
readonly networkStubbing: {
|
|
34
|
+
readonly boolean: true;
|
|
35
|
+
readonly description: "Stub network requests during replay";
|
|
36
|
+
readonly default: true;
|
|
37
|
+
};
|
|
38
|
+
readonly skipPauses: {
|
|
39
|
+
readonly boolean: true;
|
|
40
|
+
readonly description: "Fast forward through any pauses to replay as fast as possible. Warning: this option is experimental and may be deprecated";
|
|
41
|
+
readonly default: false;
|
|
42
|
+
};
|
|
43
|
+
readonly moveBeforeClick: {
|
|
44
|
+
readonly boolean: true;
|
|
45
|
+
readonly description: "Simulate mouse movement before clicking";
|
|
46
|
+
readonly default: false;
|
|
47
|
+
};
|
|
48
|
+
readonly diffThreshold: {
|
|
49
|
+
readonly number: true;
|
|
50
|
+
readonly description: "Acceptable maximum proportion of changed pixels, between 0 and 1. If this proportion is exceeded then the test will fail.";
|
|
51
|
+
readonly default: 0.01;
|
|
52
|
+
};
|
|
53
|
+
readonly diffPixelThreshold: {
|
|
54
|
+
readonly number: true;
|
|
55
|
+
readonly description: "A number between 0 and 1. Color/brightness differences in individual pixels will be ignored if the difference is less than this threshold. A value of 1.0 would accept any difference in color, while a value of 0.0 would accept no difference in color.";
|
|
56
|
+
readonly default: 0.01;
|
|
57
57
|
};
|
|
58
58
|
};
|
|
59
59
|
export declare const SCREENSHOT_DIFF_OPTIONS: {
|
|
60
60
|
diffThreshold: {
|
|
61
|
-
number:
|
|
62
|
-
description:
|
|
63
|
-
default:
|
|
61
|
+
readonly number: true;
|
|
62
|
+
readonly description: "Acceptable maximum proportion of changed pixels, between 0 and 1. If this proportion is exceeded then the test will fail.";
|
|
63
|
+
readonly default: 0.01;
|
|
64
64
|
};
|
|
65
65
|
diffPixelThreshold: {
|
|
66
|
-
number:
|
|
67
|
-
description:
|
|
68
|
-
default:
|
|
66
|
+
readonly number: true;
|
|
67
|
+
readonly description: "A number between 0 and 1. Color/brightness differences in individual pixels will be ignored if the difference is less than this threshold. A value of 1.0 would accept any difference in color, while a value of 0.0 would accept no difference in color.";
|
|
68
|
+
readonly default: 0.01;
|
|
69
69
|
};
|
|
70
70
|
};
|
|
71
71
|
/**
|
|
@@ -73,38 +73,38 @@ export declare const SCREENSHOT_DIFF_OPTIONS: {
|
|
|
73
73
|
*/
|
|
74
74
|
export declare const COMMON_REPLAY_OPTIONS: {
|
|
75
75
|
headless: {
|
|
76
|
-
boolean:
|
|
77
|
-
description:
|
|
78
|
-
default:
|
|
76
|
+
readonly boolean: true;
|
|
77
|
+
readonly description: "Start browser in headless mode";
|
|
78
|
+
readonly default: false;
|
|
79
79
|
};
|
|
80
80
|
devTools: {
|
|
81
|
-
boolean:
|
|
82
|
-
description:
|
|
83
|
-
default:
|
|
81
|
+
readonly boolean: true;
|
|
82
|
+
readonly description: "Open Chrome Dev Tools";
|
|
83
|
+
readonly default: false;
|
|
84
84
|
};
|
|
85
85
|
bypassCSP: {
|
|
86
|
-
boolean:
|
|
87
|
-
description:
|
|
88
|
-
default:
|
|
86
|
+
readonly boolean: true;
|
|
87
|
+
readonly description: "Enables bypass CSP in the browser (danger: this could mean you tests hit your production backend)";
|
|
88
|
+
readonly default: false;
|
|
89
89
|
};
|
|
90
90
|
padTime: {
|
|
91
|
-
boolean:
|
|
92
|
-
description:
|
|
93
|
-
default:
|
|
91
|
+
readonly boolean: true;
|
|
92
|
+
readonly description: "Pad replay time according to recording duration. Please note this option will be ignored if running with the '--skipPauses' option.";
|
|
93
|
+
readonly default: true;
|
|
94
94
|
};
|
|
95
95
|
shiftTime: {
|
|
96
|
-
boolean:
|
|
97
|
-
description:
|
|
98
|
-
default:
|
|
96
|
+
readonly boolean: true;
|
|
97
|
+
readonly description: "Shift time during simulation to be set as the recording time";
|
|
98
|
+
readonly default: true;
|
|
99
99
|
};
|
|
100
100
|
networkStubbing: {
|
|
101
|
-
boolean:
|
|
102
|
-
description:
|
|
103
|
-
default:
|
|
101
|
+
readonly boolean: true;
|
|
102
|
+
readonly description: "Stub network requests during replay";
|
|
103
|
+
readonly default: true;
|
|
104
104
|
};
|
|
105
105
|
skipPauses: {
|
|
106
|
-
boolean:
|
|
107
|
-
description:
|
|
108
|
-
default:
|
|
106
|
+
readonly boolean: true;
|
|
107
|
+
readonly description: "Fast forward through any pauses to replay as fast as possible. Warning: this option is experimental and may be deprecated";
|
|
108
|
+
readonly default: false;
|
|
109
109
|
};
|
|
110
110
|
};
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
declare
|
|
3
|
-
export declare const bootstrap: CommandModule<unknown, Options>;
|
|
4
|
-
export {};
|
|
1
|
+
/// <reference types="yargs" />
|
|
2
|
+
export declare const bootstrap: import("yargs").CommandModule<unknown, import("yargs").InferredOptionTypes<{}>>;
|
|
@@ -7,9 +7,9 @@ exports.bootstrap = 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"));
|
|
10
|
+
const command_builder_1 = require("../../command-utils/command-builder");
|
|
10
11
|
const config_1 = require("../../config/config");
|
|
11
12
|
const npm_set_script_utils_1 = require("../../utils/npm-set-script.utils");
|
|
12
|
-
const sentry_utils_1 = require("../../utils/sentry.utils");
|
|
13
13
|
const handler = async () => {
|
|
14
14
|
const logger = loglevel_1.default.getLogger(common_1.METICULOUS_LOGGER_NAME);
|
|
15
15
|
logger.info(`Setting up ${chalk_1.default.green("meticulous.json")}...`);
|
|
@@ -25,9 +25,9 @@ const handler = async () => {
|
|
|
25
25
|
command: "meticulous run-all-tests --headless --parallelize --deflake",
|
|
26
26
|
});
|
|
27
27
|
};
|
|
28
|
-
exports.bootstrap =
|
|
29
|
-
|
|
28
|
+
exports.bootstrap = (0, command_builder_1.buildCommand)("bootstrap")
|
|
29
|
+
.details({
|
|
30
30
|
describe: "Bootstrap your project to use Meticulous",
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
})
|
|
32
|
+
.options({})
|
|
33
|
+
.handler(handler);
|
|
@@ -1,7 +1,76 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
/// <reference types="yargs" />
|
|
2
|
+
export declare const createTest: import("yargs").CommandModule<unknown, import("yargs").InferredOptionTypes<{
|
|
3
|
+
headless: {
|
|
4
|
+
default: boolean;
|
|
5
|
+
boolean: true;
|
|
6
|
+
description: "Start browser in headless mode";
|
|
7
|
+
};
|
|
8
|
+
skipPauses: {
|
|
9
|
+
description: string;
|
|
10
|
+
boolean: true;
|
|
11
|
+
default: false;
|
|
12
|
+
};
|
|
13
|
+
devTools: {
|
|
14
|
+
readonly boolean: true;
|
|
15
|
+
readonly description: "Open Chrome Dev Tools";
|
|
16
|
+
readonly default: false;
|
|
17
|
+
};
|
|
18
|
+
bypassCSP: {
|
|
19
|
+
readonly boolean: true;
|
|
20
|
+
readonly description: "Enables bypass CSP in the browser (danger: this could mean you tests hit your production backend)";
|
|
21
|
+
readonly default: false;
|
|
22
|
+
};
|
|
23
|
+
padTime: {
|
|
24
|
+
readonly boolean: true;
|
|
25
|
+
readonly description: "Pad replay time according to recording duration. Please note this option will be ignored if running with the '--skipPauses' option.";
|
|
26
|
+
readonly default: true;
|
|
27
|
+
};
|
|
28
|
+
shiftTime: {
|
|
29
|
+
readonly boolean: true;
|
|
30
|
+
readonly description: "Shift time during simulation to be set as the recording time";
|
|
31
|
+
readonly default: true;
|
|
32
|
+
};
|
|
33
|
+
networkStubbing: {
|
|
34
|
+
readonly boolean: true;
|
|
35
|
+
readonly description: "Stub network requests during replay";
|
|
36
|
+
readonly default: true;
|
|
37
|
+
};
|
|
38
|
+
apiToken: {
|
|
39
|
+
readonly string: true;
|
|
40
|
+
};
|
|
41
|
+
commitSha: {
|
|
42
|
+
readonly string: true;
|
|
43
|
+
};
|
|
44
|
+
width: {
|
|
45
|
+
number: true;
|
|
46
|
+
};
|
|
47
|
+
height: {
|
|
48
|
+
number: true;
|
|
49
|
+
};
|
|
50
|
+
uploadIntervalMs: {
|
|
51
|
+
number: true;
|
|
52
|
+
description: string;
|
|
53
|
+
};
|
|
54
|
+
incognito: {
|
|
55
|
+
boolean: true;
|
|
56
|
+
description: string;
|
|
57
|
+
default: boolean;
|
|
58
|
+
};
|
|
59
|
+
trace: {
|
|
60
|
+
boolean: true;
|
|
61
|
+
description: string;
|
|
62
|
+
};
|
|
63
|
+
screenshotSelector: {
|
|
64
|
+
string: true;
|
|
65
|
+
description: string;
|
|
66
|
+
};
|
|
67
|
+
moveBeforeClick: {
|
|
68
|
+
readonly boolean: true;
|
|
69
|
+
readonly description: "Simulate mouse movement before clicking";
|
|
70
|
+
readonly default: false;
|
|
71
|
+
};
|
|
72
|
+
cookiesFile: {
|
|
73
|
+
string: true;
|
|
74
|
+
description: string;
|
|
75
|
+
};
|
|
76
|
+
}>>;
|
|
@@ -8,9 +8,9 @@ const common_1 = require("@alwaysmeticulous/common");
|
|
|
8
8
|
const chalk_1 = __importDefault(require("chalk"));
|
|
9
9
|
const inquirer_1 = require("inquirer");
|
|
10
10
|
const loglevel_1 = __importDefault(require("loglevel"));
|
|
11
|
+
const command_builder_1 = require("../../command-utils/command-builder");
|
|
11
12
|
const common_options_1 = require("../../command-utils/common-options");
|
|
12
13
|
const config_utils_1 = require("../../utils/config.utils");
|
|
13
|
-
const sentry_utils_1 = require("../../utils/sentry.utils");
|
|
14
14
|
const record_command_1 = require("../record/record.command");
|
|
15
15
|
const replay_command_1 = require("../replay/replay.command");
|
|
16
16
|
const handleTestCreation = async (replay, sessionId) => {
|
|
@@ -119,55 +119,52 @@ headless, screenshotSelector, padTime, shiftTime, networkStubbing, moveBeforeCli
|
|
|
119
119
|
const replay = await (0, replay_command_1.rawReplayCommandHandler)(replayOptions);
|
|
120
120
|
await handleTestCreation(replay, lastSessionId);
|
|
121
121
|
};
|
|
122
|
-
exports.createTest =
|
|
123
|
-
|
|
122
|
+
exports.createTest = (0, command_builder_1.buildCommand)("create-test")
|
|
123
|
+
.details({
|
|
124
124
|
describe: "Create a new test",
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
height: {
|
|
134
|
-
number: true,
|
|
135
|
-
},
|
|
136
|
-
uploadIntervalMs: {
|
|
137
|
-
number: true,
|
|
138
|
-
description: "Meticulous recording upload interval (in milliseconds)",
|
|
139
|
-
},
|
|
140
|
-
incognito: {
|
|
141
|
-
boolean: true,
|
|
142
|
-
description: "Use an incognito browsing context",
|
|
143
|
-
default: true,
|
|
144
|
-
},
|
|
145
|
-
trace: {
|
|
146
|
-
boolean: true,
|
|
147
|
-
description: "Enable verbose logging",
|
|
148
|
-
},
|
|
149
|
-
// Replay options
|
|
150
|
-
screenshotSelector: {
|
|
151
|
-
string: true,
|
|
152
|
-
description: "Query selector to screenshot a specific DOM element instead of the whole page",
|
|
153
|
-
},
|
|
154
|
-
moveBeforeClick: {
|
|
155
|
-
boolean: true,
|
|
156
|
-
description: "Simulate mouse movement before clicking",
|
|
157
|
-
},
|
|
158
|
-
cookiesFile: {
|
|
159
|
-
string: true,
|
|
160
|
-
description: "Path to cookies to inject before simulation",
|
|
161
|
-
},
|
|
162
|
-
...common_options_1.COMMON_REPLAY_OPTIONS,
|
|
163
|
-
headless: {
|
|
164
|
-
...common_options_1.COMMON_REPLAY_OPTIONS.headless,
|
|
165
|
-
default: true,
|
|
166
|
-
},
|
|
167
|
-
skipPauses: {
|
|
168
|
-
...common_options_1.COMMON_REPLAY_OPTIONS.skipPauses,
|
|
169
|
-
description: "Fast forward through any pauses to replay as fast as possible when replaying for the first time to create the test. Warning: this option is experimental and may be deprecated",
|
|
170
|
-
},
|
|
125
|
+
})
|
|
126
|
+
.options({
|
|
127
|
+
// Common options
|
|
128
|
+
apiToken: common_options_1.OPTIONS.apiToken,
|
|
129
|
+
commitSha: common_options_1.OPTIONS.commitSha,
|
|
130
|
+
// Record options
|
|
131
|
+
width: {
|
|
132
|
+
number: true,
|
|
171
133
|
},
|
|
172
|
-
|
|
173
|
-
|
|
134
|
+
height: {
|
|
135
|
+
number: true,
|
|
136
|
+
},
|
|
137
|
+
uploadIntervalMs: {
|
|
138
|
+
number: true,
|
|
139
|
+
description: "Meticulous recording upload interval (in milliseconds)",
|
|
140
|
+
},
|
|
141
|
+
incognito: {
|
|
142
|
+
boolean: true,
|
|
143
|
+
description: "Use an incognito browsing context",
|
|
144
|
+
default: true,
|
|
145
|
+
},
|
|
146
|
+
trace: {
|
|
147
|
+
boolean: true,
|
|
148
|
+
description: "Enable verbose logging",
|
|
149
|
+
},
|
|
150
|
+
// Replay options
|
|
151
|
+
screenshotSelector: {
|
|
152
|
+
string: true,
|
|
153
|
+
description: "Query selector to screenshot a specific DOM element instead of the whole page",
|
|
154
|
+
},
|
|
155
|
+
moveBeforeClick: common_options_1.OPTIONS.moveBeforeClick,
|
|
156
|
+
cookiesFile: {
|
|
157
|
+
string: true,
|
|
158
|
+
description: "Path to cookies to inject before simulation",
|
|
159
|
+
},
|
|
160
|
+
...common_options_1.COMMON_REPLAY_OPTIONS,
|
|
161
|
+
headless: {
|
|
162
|
+
...common_options_1.COMMON_REPLAY_OPTIONS.headless,
|
|
163
|
+
default: true,
|
|
164
|
+
},
|
|
165
|
+
skipPauses: {
|
|
166
|
+
...common_options_1.COMMON_REPLAY_OPTIONS.skipPauses,
|
|
167
|
+
description: "Fast forward through any pauses to replay as fast as possible when replaying for the first time to create the test. Warning: this option is experimental and may be deprecated",
|
|
168
|
+
},
|
|
169
|
+
})
|
|
170
|
+
.handler(handler);
|
|
@@ -1,13 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
apiToken
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
/// <reference types="yargs" />
|
|
2
|
+
export declare const debugReplay: import("yargs").CommandModule<unknown, import("yargs").InferredOptionTypes<{
|
|
3
|
+
apiToken: {
|
|
4
|
+
string: true;
|
|
5
|
+
};
|
|
6
|
+
sessionId: {
|
|
7
|
+
string: true;
|
|
8
|
+
demandOption: true;
|
|
9
|
+
};
|
|
10
|
+
appUrl: {
|
|
11
|
+
string: true;
|
|
12
|
+
};
|
|
13
|
+
devTools: {
|
|
14
|
+
boolean: true;
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
shiftTime: {
|
|
18
|
+
boolean: true;
|
|
19
|
+
description: string;
|
|
20
|
+
default: boolean;
|
|
21
|
+
};
|
|
22
|
+
networkStubbing: {
|
|
23
|
+
boolean: true;
|
|
24
|
+
description: string;
|
|
25
|
+
default: boolean;
|
|
26
|
+
};
|
|
27
|
+
moveBeforeClick: {
|
|
28
|
+
boolean: true;
|
|
29
|
+
description: string;
|
|
30
|
+
};
|
|
31
|
+
cookiesFile: {
|
|
32
|
+
string: true;
|
|
33
|
+
description: string;
|
|
34
|
+
};
|
|
35
|
+
}>>;
|
|
@@ -7,9 +7,9 @@ exports.debugReplay = 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");
|
|
10
|
+
const command_builder_1 = require("../../command-utils/command-builder");
|
|
10
11
|
const replay_assets_1 = require("../../local-data/replay-assets");
|
|
11
12
|
const sessions_1 = require("../../local-data/sessions");
|
|
12
|
-
const sentry_utils_1 = require("../../utils/sentry.utils");
|
|
13
13
|
const handler = async ({ apiToken, sessionId, appUrl, devTools, shiftTime, networkStubbing, moveBeforeClick, cookiesFile, }) => {
|
|
14
14
|
const logger = loglevel_1.default.getLogger(common_1.METICULOUS_LOGGER_NAME);
|
|
15
15
|
const client = (0, client_1.createClient)({ apiToken });
|
|
@@ -58,43 +58,43 @@ const handler = async ({ apiToken, sessionId, appUrl, devTools, shiftTime, netwo
|
|
|
58
58
|
};
|
|
59
59
|
await createReplayer(createReplayerParams);
|
|
60
60
|
};
|
|
61
|
-
exports.debugReplay =
|
|
62
|
-
|
|
61
|
+
exports.debugReplay = (0, command_builder_1.buildCommand)("debug-simulation")
|
|
62
|
+
.details({
|
|
63
63
|
aliases: ["debug-replay"],
|
|
64
64
|
describe: "Replay and debug a recorded session",
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
sessionId: {
|
|
70
|
-
string: true,
|
|
71
|
-
demandOption: true,
|
|
72
|
-
},
|
|
73
|
-
appUrl: {
|
|
74
|
-
string: true,
|
|
75
|
-
},
|
|
76
|
-
devTools: {
|
|
77
|
-
boolean: true,
|
|
78
|
-
description: "Open Chrome Dev Tools",
|
|
79
|
-
},
|
|
80
|
-
shiftTime: {
|
|
81
|
-
boolean: true,
|
|
82
|
-
description: "Shift time during simulation to be set as the recording time",
|
|
83
|
-
default: true,
|
|
84
|
-
},
|
|
85
|
-
networkStubbing: {
|
|
86
|
-
boolean: true,
|
|
87
|
-
description: "Stub network requests during replay",
|
|
88
|
-
default: true,
|
|
89
|
-
},
|
|
90
|
-
moveBeforeClick: {
|
|
91
|
-
boolean: true,
|
|
92
|
-
description: "Simulate mouse movement before clicking",
|
|
93
|
-
},
|
|
94
|
-
cookiesFile: {
|
|
95
|
-
string: true,
|
|
96
|
-
description: "Path to cookies to inject before replay",
|
|
97
|
-
},
|
|
65
|
+
})
|
|
66
|
+
.options({
|
|
67
|
+
apiToken: {
|
|
68
|
+
string: true,
|
|
98
69
|
},
|
|
99
|
-
|
|
100
|
-
|
|
70
|
+
sessionId: {
|
|
71
|
+
string: true,
|
|
72
|
+
demandOption: true,
|
|
73
|
+
},
|
|
74
|
+
appUrl: {
|
|
75
|
+
string: true,
|
|
76
|
+
},
|
|
77
|
+
devTools: {
|
|
78
|
+
boolean: true,
|
|
79
|
+
description: "Open Chrome Dev Tools",
|
|
80
|
+
},
|
|
81
|
+
shiftTime: {
|
|
82
|
+
boolean: true,
|
|
83
|
+
description: "Shift time during simulation to be set as the recording time",
|
|
84
|
+
default: true,
|
|
85
|
+
},
|
|
86
|
+
networkStubbing: {
|
|
87
|
+
boolean: true,
|
|
88
|
+
description: "Stub network requests during replay",
|
|
89
|
+
default: true,
|
|
90
|
+
},
|
|
91
|
+
moveBeforeClick: {
|
|
92
|
+
boolean: true,
|
|
93
|
+
description: "Simulate mouse movement before clicking",
|
|
94
|
+
},
|
|
95
|
+
cookiesFile: {
|
|
96
|
+
string: true,
|
|
97
|
+
description: "Path to cookies to inject before replay",
|
|
98
|
+
},
|
|
99
|
+
})
|
|
100
|
+
.handler(handler);
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
apiToken
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
/// <reference types="yargs" />
|
|
2
|
+
export declare const downloadReplay: import("yargs").CommandModule<unknown, import("yargs").InferredOptionTypes<{
|
|
3
|
+
apiToken: {
|
|
4
|
+
string: true;
|
|
5
|
+
};
|
|
6
|
+
replayId: {
|
|
7
|
+
string: true;
|
|
8
|
+
demandOption: true;
|
|
9
|
+
};
|
|
10
|
+
}>>;
|
|
@@ -2,25 +2,25 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.downloadReplay = void 0;
|
|
4
4
|
const client_1 = require("../../api/client");
|
|
5
|
+
const command_builder_1 = require("../../command-utils/command-builder");
|
|
5
6
|
const replays_1 = require("../../local-data/replays");
|
|
6
|
-
const sentry_utils_1 = require("../../utils/sentry.utils");
|
|
7
7
|
const handler = async ({ apiToken, replayId, }) => {
|
|
8
8
|
const client = (0, client_1.createClient)({ apiToken });
|
|
9
9
|
await (0, replays_1.getOrFetchReplay)(client, replayId);
|
|
10
10
|
await (0, replays_1.getOrFetchReplayArchive)(client, replayId);
|
|
11
11
|
};
|
|
12
|
-
exports.downloadReplay =
|
|
13
|
-
|
|
12
|
+
exports.downloadReplay = (0, command_builder_1.buildCommand)("download-simulation")
|
|
13
|
+
.details({
|
|
14
14
|
aliases: ["download-replay"],
|
|
15
15
|
describe: "Download a simulation from Meticulous",
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
replayId: {
|
|
21
|
-
string: true,
|
|
22
|
-
demandOption: true,
|
|
23
|
-
},
|
|
16
|
+
})
|
|
17
|
+
.options({
|
|
18
|
+
apiToken: {
|
|
19
|
+
string: true,
|
|
24
20
|
},
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
replayId: {
|
|
22
|
+
string: true,
|
|
23
|
+
demandOption: true,
|
|
24
|
+
},
|
|
25
|
+
})
|
|
26
|
+
.handler(handler);
|