@alwaysmeticulous/cli 2.40.4 → 2.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /// <reference types="yargs" />
2
- import { ScreenshotDiffResult, Replay, ScreenshotDiffOptions } from "@alwaysmeticulous/api";
2
+ import { Replay, ScreenshotDiffOptions, ScreenshotDiffResult } from "@alwaysmeticulous/api";
3
3
  import { ReplayExecutionOptions, ReplayTarget } from "@alwaysmeticulous/sdk-bundles-api";
4
4
  export interface ReplayAndStoreResultsResult {
5
5
  replay: Replay;
@@ -8,23 +8,21 @@ export interface ReplayAndStoreResultsResult {
8
8
  */
9
9
  screenshotDiffResultsByBaseReplayId: Record<string, ScreenshotDiffResult[]>;
10
10
  }
11
- export interface RawReplayCommandHandlerOptions extends ScreenshotDiffOptions, Omit<ReplayExecutionOptions, "maxDurationMs" | "maxEventCount">, Omit<AdditionalReplayOptions, "baseTestRunId"> {
11
+ export interface RawReplayCommandHandlerOptions extends ScreenshotDiffOptions, Omit<ReplayExecutionOptions, "maxDurationMs" | "maxEventCount"> {
12
12
  screenshot: boolean;
13
13
  appUrl: string | null | undefined;
14
14
  simulationIdForAssets: string | null | undefined;
15
15
  maxDurationMs: number | null | undefined;
16
16
  maxEventCount: number | null | undefined;
17
17
  storyboard: boolean;
18
- }
19
- interface AdditionalReplayOptions {
20
18
  apiToken: string | null | undefined;
21
19
  commitSha: string | null | undefined;
22
20
  sessionId: string;
23
- baseTestRunId: string | null | undefined;
24
21
  cookiesFile: string | null | undefined;
25
22
  debugger: boolean;
23
+ baseReplayId: string | null | undefined;
26
24
  }
27
- export declare const rawReplayCommandHandler: ({ apiToken, commitSha, sessionId, appUrl, simulationIdForAssets, headless, devTools, bypassCSP, screenshot, diffThreshold, diffPixelThreshold, shiftTime, networkStubbing, moveBeforeClick, cookiesFile, disableRemoteFonts, noSandbox, skipPauses, maxDurationMs, maxEventCount, storyboard, essentialFeaturesOnly, debugger: enableStepThroughDebugger, }: RawReplayCommandHandlerOptions) => Promise<Replay>;
25
+ export declare const rawReplayCommandHandler: ({ apiToken, commitSha, sessionId, appUrl, simulationIdForAssets, headless, devTools, bypassCSP, screenshot, baseReplayId, diffThreshold, diffPixelThreshold, shiftTime, networkStubbing, moveBeforeClick, cookiesFile, disableRemoteFonts, noSandbox, skipPauses, maxDurationMs, maxEventCount, storyboard, essentialFeaturesOnly, debugger: enableStepThroughDebugger, }: RawReplayCommandHandlerOptions) => Promise<Replay>;
28
26
  export declare const getReplayTarget: ({ appUrl, simulationIdForAssets, }: {
29
27
  appUrl: string | null;
30
28
  simulationIdForAssets: string | null;
@@ -136,5 +134,9 @@ export declare const replayCommand: import("yargs").CommandModule<unknown, impor
136
134
  string: true;
137
135
  description: string;
138
136
  };
137
+ baseReplayId: {
138
+ string: true;
139
+ description: string;
140
+ alias: string;
141
+ };
139
142
  }>>;
140
- export {};
@@ -4,7 +4,10 @@ exports.replayCommand = exports.getReplayTarget = exports.rawReplayCommandHandle
4
4
  const replay_orchestrator_1 = require("@alwaysmeticulous/replay-orchestrator");
5
5
  const command_builder_1 = require("../../command-utils/command-builder");
6
6
  const common_options_1 = require("../../command-utils/common-options");
7
- const rawReplayCommandHandler = async ({ apiToken, commitSha, sessionId, appUrl, simulationIdForAssets, headless, devTools, bypassCSP, screenshot, diffThreshold, diffPixelThreshold, shiftTime, networkStubbing, moveBeforeClick, cookiesFile, disableRemoteFonts, noSandbox, skipPauses, maxDurationMs, maxEventCount, storyboard, essentialFeaturesOnly, debugger: enableStepThroughDebugger, }) => {
7
+ const rawReplayCommandHandler = async ({ apiToken, commitSha, sessionId, appUrl, simulationIdForAssets, headless, devTools, bypassCSP, screenshot, baseReplayId, diffThreshold, diffPixelThreshold, shiftTime, networkStubbing, moveBeforeClick, cookiesFile, disableRemoteFonts, noSandbox, skipPauses, maxDurationMs, maxEventCount, storyboard, essentialFeaturesOnly, debugger: enableStepThroughDebugger, }) => {
8
+ if (!screenshot && storyboard) {
9
+ throw new Error("Cannot take storyboard screenshots without taking end state screenshots. Please set '--screenshot' to true, or '--storyboard' to false.");
10
+ }
8
11
  const executionOptions = {
9
12
  headless,
10
13
  devTools,
@@ -26,8 +29,16 @@ const rawReplayCommandHandler = async ({ apiToken, commitSha, sessionId, appUrl,
26
29
  const screenshottingOptions = screenshot
27
30
  ? {
28
31
  enabled: true,
29
- diffOptions: { diffPixelThreshold, diffThreshold },
30
32
  storyboardOptions,
33
+ compareTo: baseReplayId != null
34
+ ? {
35
+ type: "specific-replay",
36
+ replayId: baseReplayId,
37
+ diffOptions: { diffThreshold, diffPixelThreshold },
38
+ }
39
+ : {
40
+ type: "do-not-compare",
41
+ },
31
42
  }
32
43
  : { enabled: false };
33
44
  const { replay } = await (0, replay_orchestrator_1.replayAndStoreResults)({
@@ -42,7 +53,6 @@ const rawReplayCommandHandler = async ({ apiToken, commitSha, sessionId, appUrl,
42
53
  cookiesFile,
43
54
  sessionId,
44
55
  generatedBy: generatedByOption,
45
- baseTestRunId: null,
46
56
  testRunId: null,
47
57
  debugger: enableStepThroughDebugger,
48
58
  suppressScreenshotDiffLogging: false,
@@ -96,6 +106,11 @@ exports.replayCommand = (0, command_builder_1.buildCommand)("simulate")
96
106
  string: true,
97
107
  description: "Path to cookies to inject before simulation",
98
108
  },
109
+ baseReplayId: {
110
+ string: true,
111
+ description: "Base simulation id to diff the screenshots against",
112
+ alias: "baseSimulationId",
113
+ },
99
114
  ...common_options_1.COMMON_REPLAY_OPTIONS,
100
115
  ...common_options_1.SCREENSHOT_DIFF_OPTIONS,
101
116
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alwaysmeticulous/cli",
3
- "version": "2.40.4",
3
+ "version": "2.41.0",
4
4
  "description": "The Meticulous CLI",
5
5
  "license": "ISC",
6
6
  "main": "dist/index.js",
@@ -27,13 +27,13 @@
27
27
  "depcheck": "depcheck --ignore-patterns=dist"
28
28
  },
29
29
  "dependencies": {
30
- "@alwaysmeticulous/api": "^2.40.4",
31
- "@alwaysmeticulous/client": "^2.40.4",
32
- "@alwaysmeticulous/common": "^2.40.4",
33
- "@alwaysmeticulous/downloading-helpers": "^2.40.4",
34
- "@alwaysmeticulous/record": "^2.40.4",
35
- "@alwaysmeticulous/replay-orchestrator": "^2.40.4",
36
- "@alwaysmeticulous/sdk-bundles-api": "^2.40.4",
30
+ "@alwaysmeticulous/api": "^2.41.0",
31
+ "@alwaysmeticulous/client": "^2.41.0",
32
+ "@alwaysmeticulous/common": "^2.41.0",
33
+ "@alwaysmeticulous/downloading-helpers": "^2.41.0",
34
+ "@alwaysmeticulous/record": "^2.41.0",
35
+ "@alwaysmeticulous/replay-orchestrator": "^2.41.0",
36
+ "@alwaysmeticulous/sdk-bundles-api": "^2.41.0",
37
37
  "@alwaysmeticulous/sentry": "^2.40.0",
38
38
  "@sentry/node": "^7.36.0",
39
39
  "axios": "^1.2.6",
@@ -77,5 +77,5 @@
77
77
  "coverageDirectory": "../coverage",
78
78
  "testEnvironment": "node"
79
79
  },
80
- "gitHead": "11acce96c03e23cbb556779a121710a8136d24db"
80
+ "gitHead": "778895a7cd6a010538e338f9b2da225e71c53f48"
81
81
  }