@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.
Files changed (34) hide show
  1. package/dist/command-utils/command-builder.d.ts +10 -0
  2. package/dist/command-utils/command-builder.js +19 -0
  3. package/dist/command-utils/common-options.d.ts +82 -82
  4. package/dist/commands/bootstrap/bootstrap.command.d.ts +2 -4
  5. package/dist/commands/bootstrap/bootstrap.command.js +6 -6
  6. package/dist/commands/create-test/create-test.command.d.ts +76 -7
  7. package/dist/commands/create-test/create-test.command.js +48 -51
  8. package/dist/commands/debug-replay/debug-replay.command.d.ts +35 -13
  9. package/dist/commands/debug-replay/debug-replay.command.js +38 -38
  10. package/dist/commands/download-replay/download-replay.command.d.ts +10 -7
  11. package/dist/commands/download-replay/download-replay.command.js +13 -13
  12. package/dist/commands/download-session/download-session.command.d.ts +10 -7
  13. package/dist/commands/download-session/download-session.command.js +13 -13
  14. package/dist/commands/record/record.command.d.ts +37 -2
  15. package/dist/commands/record/record.command.js +40 -40
  16. package/dist/commands/replay/replay.command.d.ts +114 -4
  17. package/dist/commands/replay/replay.command.js +73 -69
  18. package/dist/commands/run-all-tests/run-all-tests.command.d.ts +90 -17
  19. package/dist/commands/run-all-tests/run-all-tests.command.js +53 -54
  20. package/dist/commands/screenshot-diff/screenshot-diff.command.d.ts +26 -9
  21. package/dist/commands/screenshot-diff/screenshot-diff.command.js +20 -22
  22. package/dist/commands/serve/serve.command.d.ts +10 -7
  23. package/dist/commands/serve/serve.command.js +13 -13
  24. package/dist/commands/show-project/show-project.command.d.ts +6 -6
  25. package/dist/commands/show-project/show-project.command.js +9 -9
  26. package/dist/commands/update-tests/update-tests.command.d.ts +21 -9
  27. package/dist/commands/update-tests/update-tests.command.js +24 -23
  28. package/dist/commands/upload-build/upload-build.command.d.ts +13 -8
  29. package/dist/commands/upload-build/upload-build.command.js +16 -16
  30. package/dist/deflake-tests/deflake-tests.handler.d.ts +2 -1
  31. package/dist/deflake-tests/deflake-tests.handler.js +2 -1
  32. package/dist/parallel-tests/parallel-tests.handler.js +1 -0
  33. package/dist/tsconfig.tsbuildinfo +1 -1
  34. package/package.json +4 -4
@@ -1,7 +1,10 @@
1
- import { CommandModule } from "yargs";
2
- interface Options {
3
- apiToken?: string | null | undefined;
4
- sessionId: string;
5
- }
6
- export declare const downloadSession: CommandModule<unknown, Options>;
7
- export {};
1
+ /// <reference types="yargs" />
2
+ export declare const downloadSession: import("yargs").CommandModule<unknown, import("yargs").InferredOptionTypes<{
3
+ apiToken: {
4
+ string: true;
5
+ };
6
+ sessionId: {
7
+ string: true;
8
+ demandOption: true;
9
+ };
10
+ }>>;
@@ -2,24 +2,24 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.downloadSession = void 0;
4
4
  const client_1 = require("../../api/client");
5
+ const command_builder_1 = require("../../command-utils/command-builder");
5
6
  const sessions_1 = require("../../local-data/sessions");
6
- const sentry_utils_1 = require("../../utils/sentry.utils");
7
7
  const handler = async ({ apiToken, sessionId, }) => {
8
8
  const client = (0, client_1.createClient)({ apiToken });
9
9
  await (0, sessions_1.getOrFetchRecordedSession)(client, sessionId);
10
10
  await (0, sessions_1.getOrFetchRecordedSessionData)(client, sessionId);
11
11
  };
12
- exports.downloadSession = {
13
- command: "download-session",
12
+ exports.downloadSession = (0, command_builder_1.buildCommand)("download-session")
13
+ .details({
14
14
  describe: "Download recorded session from Meticulous",
15
- builder: {
16
- apiToken: {
17
- string: true,
18
- },
19
- sessionId: {
20
- string: true,
21
- demandOption: true,
22
- },
15
+ })
16
+ .options({
17
+ apiToken: {
18
+ string: true,
23
19
  },
24
- handler: (0, sentry_utils_1.wrapHandler)(handler),
25
- };
20
+ sessionId: {
21
+ string: true,
22
+ demandOption: true,
23
+ },
24
+ })
25
+ .handler(handler);
@@ -1,4 +1,4 @@
1
- import { CommandModule } from "yargs";
1
+ /// <reference types="yargs" />
2
2
  export interface RecordCommandHandlerOptions {
3
3
  apiToken: string | null | undefined;
4
4
  commitSha: string | null | undefined;
@@ -12,4 +12,39 @@ 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 record: CommandModule<unknown, RecordCommandHandlerOptions>;
15
+ export declare const record: import("yargs").CommandModule<unknown, import("yargs").InferredOptionTypes<{
16
+ apiToken: {
17
+ string: true;
18
+ demandOption: true;
19
+ };
20
+ commitSha: {
21
+ string: true;
22
+ };
23
+ devTools: {
24
+ boolean: true;
25
+ description: string;
26
+ };
27
+ bypassCSP: {
28
+ boolean: true;
29
+ description: string;
30
+ };
31
+ width: {
32
+ number: true;
33
+ };
34
+ height: {
35
+ number: true;
36
+ };
37
+ uploadIntervalMs: {
38
+ number: true;
39
+ description: string;
40
+ };
41
+ incognito: {
42
+ boolean: true;
43
+ description: string;
44
+ default: boolean;
45
+ };
46
+ trace: {
47
+ boolean: true;
48
+ description: string;
49
+ };
50
+ }>>;
@@ -10,9 +10,9 @@ const loglevel_1 = __importDefault(require("loglevel"));
10
10
  const client_1 = require("../../api/client");
11
11
  const project_api_1 = require("../../api/project.api");
12
12
  const session_api_1 = require("../../api/session.api");
13
+ const command_builder_1 = require("../../command-utils/command-builder");
13
14
  const replay_assets_1 = require("../../local-data/replay-assets");
14
15
  const commit_sha_utils_1 = require("../../utils/commit-sha.utils");
15
- const sentry_utils_1 = require("../../utils/sentry.utils");
16
16
  const recordCommandHandler = async ({ apiToken, commitSha: commitSha_, devTools, bypassCSP, width, height, uploadIntervalMs, incognito, trace, onDetectedSession: onDetectedSession_, }) => {
17
17
  const logger = loglevel_1.default.getLogger(common_1.METICULOUS_LOGGER_NAME);
18
18
  const debugLogger = trace ? await common_1.DebugLogger.create() : null;
@@ -99,44 +99,44 @@ const recordCommandHandler = async ({ apiToken, commitSha: commitSha_, devTools,
99
99
  });
100
100
  };
101
101
  exports.recordCommandHandler = recordCommandHandler;
102
- exports.record = {
103
- command: "record",
102
+ exports.record = (0, command_builder_1.buildCommand)("record")
103
+ .details({
104
104
  describe: "Record a session",
105
- builder: {
106
- apiToken: {
107
- string: true,
108
- demandOption: true,
109
- },
110
- commitSha: {
111
- string: true,
112
- },
113
- devTools: {
114
- boolean: true,
115
- description: "Open Chrome Dev Tools",
116
- },
117
- bypassCSP: {
118
- boolean: true,
119
- description: "Enables bypass CSP in the browser",
120
- },
121
- width: {
122
- number: true,
123
- },
124
- height: {
125
- number: true,
126
- },
127
- uploadIntervalMs: {
128
- number: true,
129
- description: "Meticulous recording upload interval (in milliseconds)",
130
- },
131
- incognito: {
132
- boolean: true,
133
- description: "Use an incognito browsing context",
134
- default: true,
135
- },
136
- trace: {
137
- boolean: true,
138
- description: "Enable verbose logging",
139
- },
105
+ })
106
+ .options({
107
+ apiToken: {
108
+ string: true,
109
+ demandOption: true,
140
110
  },
141
- handler: (0, sentry_utils_1.wrapHandler)(exports.recordCommandHandler),
142
- };
111
+ commitSha: {
112
+ string: true,
113
+ },
114
+ devTools: {
115
+ boolean: true,
116
+ description: "Open Chrome Dev Tools",
117
+ },
118
+ bypassCSP: {
119
+ boolean: true,
120
+ description: "Enables bypass CSP in the browser",
121
+ },
122
+ width: {
123
+ number: true,
124
+ },
125
+ height: {
126
+ number: true,
127
+ },
128
+ uploadIntervalMs: {
129
+ number: true,
130
+ description: "Meticulous recording upload interval (in milliseconds)",
131
+ },
132
+ incognito: {
133
+ boolean: true,
134
+ description: "Use an incognito browsing context",
135
+ default: true,
136
+ },
137
+ trace: {
138
+ boolean: true,
139
+ description: "Enable verbose logging",
140
+ },
141
+ })
142
+ .handler(exports.recordCommandHandler);
@@ -1,13 +1,14 @@
1
- import { Replay, ReplayExecutionOptions, ReplayTarget } from "@alwaysmeticulous/common";
2
- import { CommandModule } from "yargs";
1
+ /// <reference types="yargs" />
2
+ import { GeneratedBy, Replay, ReplayExecutionOptions, ReplayTarget } from "@alwaysmeticulous/common";
3
3
  import { ScreenshotAssertionsOptions, ScreenshotDiffOptions } from "../../command-utils/common-types";
4
4
  export interface ReplayOptions extends AdditionalReplayOptions {
5
5
  replayTarget: ReplayTarget;
6
6
  executionOptions: ReplayExecutionOptions;
7
7
  screenshottingOptions: ScreenshotAssertionsOptions;
8
8
  exitOnMismatch: boolean;
9
+ generatedBy: GeneratedBy;
9
10
  }
10
- export declare const replayCommandHandler: ({ replayTarget, executionOptions, screenshottingOptions, apiToken, sessionId, commitSha: commitSha_, save, exitOnMismatch, baseSimulationId: baseReplayId_, cookiesFile, }: ReplayOptions) => Promise<Replay>;
11
+ export declare const replayCommandHandler: ({ replayTarget, executionOptions, screenshottingOptions, apiToken, sessionId, commitSha: commitSha_, save, exitOnMismatch, baseSimulationId: baseReplayId_, cookiesFile, generatedBy, }: ReplayOptions) => Promise<Replay>;
11
12
  export interface RawReplayCommandHandlerOptions extends ScreenshotDiffOptions, Omit<ReplayExecutionOptions, "maxDurationMs" | "maxEventCount">, AdditionalReplayOptions {
12
13
  screenshot: boolean;
13
14
  appUrl: string | null | undefined;
@@ -26,5 +27,114 @@ interface AdditionalReplayOptions {
26
27
  cookiesFile: string | null | undefined;
27
28
  }
28
29
  export declare const rawReplayCommandHandler: ({ apiToken, commitSha, sessionId, appUrl, simulationIdForAssets, headless, devTools, bypassCSP, screenshot, screenshotSelector, baseSimulationId, diffThreshold, diffPixelThreshold, save, padTime, shiftTime, networkStubbing, moveBeforeClick, cookiesFile, skipPauses, maxDurationMs, maxEventCount, storyboard, }: RawReplayCommandHandlerOptions) => Promise<Replay>;
29
- export declare const replay: CommandModule<unknown, RawReplayCommandHandlerOptions>;
30
+ export declare const getReplayTarget: ({ appUrl, simulationIdForAssets, }: {
31
+ appUrl: string | null;
32
+ simulationIdForAssets: string | null;
33
+ }) => ReplayTarget;
34
+ export declare const replay: import("yargs").CommandModule<unknown, import("yargs").InferredOptionTypes<{
35
+ maxDurationMs: {
36
+ number: true;
37
+ description: string;
38
+ };
39
+ maxEventCount: {
40
+ number: true;
41
+ description: string;
42
+ };
43
+ storyboard: {
44
+ boolean: true;
45
+ description: string;
46
+ default: boolean;
47
+ };
48
+ 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
+ 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
+ };
58
+ headless: {
59
+ readonly boolean: true;
60
+ readonly description: "Start browser in headless mode";
61
+ readonly default: false;
62
+ };
63
+ devTools: {
64
+ readonly boolean: true;
65
+ readonly description: "Open Chrome Dev Tools";
66
+ readonly default: false;
67
+ };
68
+ bypassCSP: {
69
+ readonly boolean: true;
70
+ readonly description: "Enables bypass CSP in the browser (danger: this could mean you tests hit your production backend)";
71
+ readonly default: false;
72
+ };
73
+ padTime: {
74
+ readonly boolean: true;
75
+ readonly description: "Pad replay time according to recording duration. Please note this option will be ignored if running with the '--skipPauses' option.";
76
+ readonly default: true;
77
+ };
78
+ shiftTime: {
79
+ readonly boolean: true;
80
+ readonly description: "Shift time during simulation to be set as the recording time";
81
+ readonly default: true;
82
+ };
83
+ networkStubbing: {
84
+ readonly boolean: true;
85
+ readonly description: "Stub network requests during replay";
86
+ readonly default: true;
87
+ };
88
+ skipPauses: {
89
+ readonly boolean: true;
90
+ readonly description: "Fast forward through any pauses to replay as fast as possible. Warning: this option is experimental and may be deprecated";
91
+ readonly default: false;
92
+ };
93
+ apiToken: {
94
+ readonly string: true;
95
+ };
96
+ commitSha: {
97
+ readonly string: true;
98
+ };
99
+ sessionId: {
100
+ string: true;
101
+ demandOption: true;
102
+ };
103
+ appUrl: {
104
+ string: true;
105
+ description: string;
106
+ };
107
+ simulationIdForAssets: {
108
+ string: true;
109
+ conflicts: string;
110
+ description: string;
111
+ };
112
+ screenshot: {
113
+ boolean: true;
114
+ description: string;
115
+ default: boolean;
116
+ };
117
+ screenshotSelector: {
118
+ string: true;
119
+ description: string;
120
+ };
121
+ baseSimulationId: {
122
+ string: true;
123
+ description: string;
124
+ alias: string;
125
+ };
126
+ save: {
127
+ boolean: true;
128
+ description: string;
129
+ };
130
+ moveBeforeClick: {
131
+ boolean: true;
132
+ description: string;
133
+ default: boolean;
134
+ };
135
+ cookiesFile: {
136
+ string: true;
137
+ description: string;
138
+ };
139
+ }>>;
30
140
  export {};
@@ -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.replay = exports.rawReplayCommandHandler = exports.replayCommandHandler = void 0;
6
+ exports.replay = 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");
@@ -13,6 +13,7 @@ const client_1 = require("../../api/client");
13
13
  const replay_api_1 = require("../../api/replay.api");
14
14
  const upload_1 = require("../../api/upload");
15
15
  const archive_1 = require("../../archive/archive");
16
+ const command_builder_1 = require("../../command-utils/command-builder");
16
17
  const common_options_1 = require("../../command-utils/common-options");
17
18
  const local_data_utils_1 = require("../../local-data/local-data.utils");
18
19
  const replay_assets_1 = require("../../local-data/replay-assets");
@@ -21,10 +22,9 @@ const serve_assets_from_simulation_1 = require("../../local-data/serve-assets-fr
21
22
  const sessions_1 = require("../../local-data/sessions");
22
23
  const commit_sha_utils_1 = require("../../utils/commit-sha.utils");
23
24
  const config_utils_1 = require("../../utils/config.utils");
24
- const sentry_utils_1 = require("../../utils/sentry.utils");
25
25
  const version_utils_1 = require("../../utils/version.utils");
26
26
  const screenshot_diff_command_1 = require("../screenshot-diff/screenshot-diff.command");
27
- const replayCommandHandler = async ({ replayTarget, executionOptions, screenshottingOptions, apiToken, sessionId, commitSha: commitSha_, save, exitOnMismatch, baseSimulationId: baseReplayId_, cookiesFile, }) => {
27
+ const replayCommandHandler = async ({ replayTarget, executionOptions, screenshottingOptions, apiToken, sessionId, commitSha: commitSha_, save, exitOnMismatch, baseSimulationId: baseReplayId_, cookiesFile, generatedBy, }) => {
28
28
  const logger = loglevel_1.default.getLogger(common_1.METICULOUS_LOGGER_NAME);
29
29
  const client = (0, client_1.createClient)({ apiToken });
30
30
  // 1. Check session files
@@ -72,6 +72,7 @@ const replayCommandHandler = async ({ replayTarget, executionOptions, screenshot
72
72
  sessionData,
73
73
  recordingId: "manual-replay",
74
74
  meticulousSha: "meticulousSha",
75
+ generatedBy,
75
76
  dependencies: {
76
77
  browserUserInteractions: {
77
78
  key: "browserUserInteractions",
@@ -118,7 +119,7 @@ const replayCommandHandler = async ({ replayTarget, executionOptions, screenshot
118
119
  sessionId,
119
120
  meticulousSha,
120
121
  version: "v2",
121
- metadata: {},
122
+ metadata: { generatedBy },
122
123
  });
123
124
  const uploadUrlData = await (0, replay_api_1.getReplayPushUrl)(client, replay.id);
124
125
  if (!uploadUrlData) {
@@ -208,6 +209,7 @@ const rawReplayCommandHandler = ({ apiToken, commitSha, sessionId, appUrl, simul
208
209
  maxDurationMs: maxDurationMs !== null && maxDurationMs !== void 0 ? maxDurationMs : null,
209
210
  maxEventCount: maxEventCount !== null && maxEventCount !== void 0 ? maxEventCount : null,
210
211
  };
212
+ const generatedByOption = { type: "replayCommand" };
211
213
  const storyboardOptions = storyboard
212
214
  ? { enabled: true }
213
215
  : { enabled: false };
@@ -220,7 +222,7 @@ const rawReplayCommandHandler = ({ apiToken, commitSha, sessionId, appUrl, simul
220
222
  }
221
223
  : { enabled: false };
222
224
  return (0, exports.replayCommandHandler)({
223
- replayTarget: getReplayTarget({
225
+ replayTarget: (0, exports.getReplayTarget)({
224
226
  appUrl: appUrl !== null && appUrl !== void 0 ? appUrl : null,
225
227
  simulationIdForAssets: simulationIdForAssets !== null && simulationIdForAssets !== void 0 ? simulationIdForAssets : null,
226
228
  }),
@@ -233,6 +235,7 @@ const rawReplayCommandHandler = ({ apiToken, commitSha, sessionId, appUrl, simul
233
235
  baseSimulationId,
234
236
  save,
235
237
  exitOnMismatch: true,
238
+ generatedBy: generatedByOption,
236
239
  });
237
240
  };
238
241
  exports.rawReplayCommandHandler = rawReplayCommandHandler;
@@ -245,70 +248,71 @@ const getReplayTarget = ({ appUrl, simulationIdForAssets, }) => {
245
248
  }
246
249
  return { type: "original-recorded-url" };
247
250
  };
248
- exports.replay = {
249
- command: "simulate",
251
+ exports.getReplayTarget = getReplayTarget;
252
+ exports.replay = (0, command_builder_1.buildCommand)("simulate")
253
+ .details({
250
254
  aliases: ["replay"],
251
255
  describe: "Simulate (replay) a recorded session",
252
- builder: {
253
- apiToken: common_options_1.OPTIONS.apiToken,
254
- commitSha: common_options_1.OPTIONS.commitSha,
255
- sessionId: {
256
- string: true,
257
- demandOption: true,
258
- },
259
- appUrl: {
260
- string: true,
261
- description: "The URL to execute the test against. If left absent will use the URL the test was originally recorded against.",
262
- },
263
- simulationIdForAssets: {
264
- string: true,
265
- conflicts: "appUrl",
266
- description: "If present will run the session against a local server serving up previously snapshotted assets (HTML, JS, CSS etc.) from the specified prior simulation, instead of against a URL. An alternative to specifying an app URL.",
267
- },
268
- screenshot: {
269
- boolean: true,
270
- description: "Take a screenshot at the end of simulation",
271
- default: true,
272
- },
273
- screenshotSelector: {
274
- string: true,
275
- description: "Query selector to screenshot a specific DOM element instead of the whole page",
276
- },
277
- baseSimulationId: {
278
- string: true,
279
- description: "Base simulation id to diff the final state screenshot against",
280
- alias: "baseReplayId",
281
- },
282
- save: {
283
- boolean: true,
284
- description: "Adds the simulation to the list of test cases in meticulous.json",
285
- },
286
- moveBeforeClick: {
287
- boolean: true,
288
- description: "Simulate mouse movement before clicking",
289
- default: false,
290
- },
291
- cookiesFile: {
292
- string: true,
293
- description: "Path to cookies to inject before simulation",
294
- },
295
- ...common_options_1.COMMON_REPLAY_OPTIONS,
296
- ...common_options_1.SCREENSHOT_DIFF_OPTIONS,
297
- maxDurationMs: {
298
- number: true,
299
- description: "Maximum duration (in milliseconds) the simulation will run",
300
- },
301
- maxEventCount: {
302
- number: true,
303
- description: "Maximum number of events the simulation will run",
304
- },
305
- storyboard: {
306
- boolean: true,
307
- description: "Take a storyboard of screenshots during simulation",
308
- default: false,
309
- },
256
+ })
257
+ .options({
258
+ apiToken: common_options_1.OPTIONS.apiToken,
259
+ commitSha: common_options_1.OPTIONS.commitSha,
260
+ sessionId: {
261
+ string: true,
262
+ demandOption: true,
310
263
  },
311
- handler: (0, sentry_utils_1.wrapHandler)(async (options) => {
312
- await (0, exports.rawReplayCommandHandler)(options);
313
- }),
314
- };
264
+ appUrl: {
265
+ string: true,
266
+ description: "The URL to execute the test against. If left absent will use the URL the test was originally recorded against.",
267
+ },
268
+ simulationIdForAssets: {
269
+ string: true,
270
+ conflicts: "appUrl",
271
+ description: "If present will run the session against a local server serving up previously snapshotted assets (HTML, JS, CSS etc.) from the specified prior simulation, instead of against a URL. An alternative to specifying an app URL.",
272
+ },
273
+ screenshot: {
274
+ boolean: true,
275
+ description: "Take a screenshot at the end of simulation",
276
+ default: true,
277
+ },
278
+ screenshotSelector: {
279
+ string: true,
280
+ description: "Query selector to screenshot a specific DOM element instead of the whole page",
281
+ },
282
+ baseSimulationId: {
283
+ string: true,
284
+ description: "Base simulation id to diff the final state screenshot against",
285
+ alias: "baseReplayId",
286
+ },
287
+ save: {
288
+ boolean: true,
289
+ description: "Adds the simulation to the list of test cases in meticulous.json",
290
+ },
291
+ moveBeforeClick: {
292
+ boolean: true,
293
+ description: "Simulate mouse movement before clicking",
294
+ default: false,
295
+ },
296
+ cookiesFile: {
297
+ string: true,
298
+ description: "Path to cookies to inject before simulation",
299
+ },
300
+ ...common_options_1.COMMON_REPLAY_OPTIONS,
301
+ ...common_options_1.SCREENSHOT_DIFF_OPTIONS,
302
+ maxDurationMs: {
303
+ number: true,
304
+ description: "Maximum duration (in milliseconds) the simulation will run",
305
+ },
306
+ maxEventCount: {
307
+ number: true,
308
+ description: "Maximum number of events the simulation will run",
309
+ },
310
+ storyboard: {
311
+ boolean: true,
312
+ description: "Take a storyboard of screenshots during simulation",
313
+ default: false,
314
+ },
315
+ })
316
+ .handler(async (options) => {
317
+ await (0, exports.rawReplayCommandHandler)(options);
318
+ });
@@ -1,17 +1,90 @@
1
- import { ReplayExecutionOptions } from "@alwaysmeticulous/common";
2
- import { CommandModule } from "yargs";
3
- import { ScreenshotDiffOptions } from "../../command-utils/common-types";
4
- interface Options extends ScreenshotDiffOptions, ReplayExecutionOptions {
5
- apiToken?: string;
6
- commitSha?: string;
7
- appUrl?: string;
8
- useAssetsSnapshottedInBaseSimulation: boolean;
9
- githubSummary?: boolean;
10
- parallelize?: boolean;
11
- parallelTasks?: number | null;
12
- deflake: boolean;
13
- useCache: boolean;
14
- testsFile?: string;
15
- }
16
- export declare const runAllTests: CommandModule<unknown, Options>;
17
- export {};
1
+ /// <reference types="yargs" />
2
+ export declare const runAllTests: import("yargs").CommandModule<unknown, import("yargs").InferredOptionTypes<{
3
+ readonly diffThreshold: {
4
+ readonly number: true;
5
+ readonly description: "Acceptable maximum proportion of changed pixels, between 0 and 1. If this proportion is exceeded then the test will fail.";
6
+ readonly default: 0.01;
7
+ };
8
+ readonly diffPixelThreshold: {
9
+ readonly number: true;
10
+ 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.";
11
+ readonly default: 0.01;
12
+ };
13
+ readonly headless: {
14
+ readonly boolean: true;
15
+ readonly description: "Start browser in headless mode";
16
+ readonly default: false;
17
+ };
18
+ readonly devTools: {
19
+ readonly boolean: true;
20
+ readonly description: "Open Chrome Dev Tools";
21
+ readonly default: false;
22
+ };
23
+ readonly bypassCSP: {
24
+ readonly boolean: true;
25
+ readonly description: "Enables bypass CSP in the browser (danger: this could mean you tests hit your production backend)";
26
+ readonly default: false;
27
+ };
28
+ readonly padTime: {
29
+ readonly boolean: true;
30
+ readonly description: "Pad replay time according to recording duration. Please note this option will be ignored if running with the '--skipPauses' option.";
31
+ readonly default: true;
32
+ };
33
+ readonly shiftTime: {
34
+ readonly boolean: true;
35
+ readonly description: "Shift time during simulation to be set as the recording time";
36
+ readonly default: true;
37
+ };
38
+ readonly networkStubbing: {
39
+ readonly boolean: true;
40
+ readonly description: "Stub network requests during replay";
41
+ readonly default: true;
42
+ };
43
+ readonly skipPauses: {
44
+ readonly boolean: true;
45
+ readonly description: "Fast forward through any pauses to replay as fast as possible. Warning: this option is experimental and may be deprecated";
46
+ readonly default: false;
47
+ };
48
+ readonly apiToken: {
49
+ readonly string: true;
50
+ };
51
+ readonly commitSha: {
52
+ readonly string: true;
53
+ };
54
+ readonly appUrl: {
55
+ readonly string: true;
56
+ readonly description: "The URL to execute the tests against. If left absent here and in the test cases file, then will use the URL the test was originally recorded against.";
57
+ };
58
+ readonly useAssetsSnapshottedInBaseSimulation: {
59
+ readonly boolean: true;
60
+ readonly description: string;
61
+ readonly default: false;
62
+ };
63
+ readonly githubSummary: {
64
+ readonly boolean: true;
65
+ readonly description: "Outputs a summary page for GitHub actions";
66
+ };
67
+ readonly parallelize: {
68
+ readonly boolean: true;
69
+ readonly description: "Run tests in parallel";
70
+ };
71
+ readonly parallelTasks: {
72
+ readonly number: true;
73
+ readonly description: "Number of tasks to run in parallel";
74
+ readonly coerce: (value: number | null | undefined) => number | null | undefined;
75
+ };
76
+ readonly deflake: {
77
+ readonly boolean: true;
78
+ readonly description: "Attempt to deflake failing tests";
79
+ readonly default: false;
80
+ };
81
+ readonly useCache: {
82
+ readonly boolean: true;
83
+ readonly description: "Use result cache";
84
+ readonly default: false;
85
+ };
86
+ readonly testsFile: {
87
+ readonly string: true;
88
+ readonly description: string;
89
+ };
90
+ }>>;