@alwaysmeticulous/sdk-bundles-api 2.40.3 → 2.40.4

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/index.d.ts CHANGED
@@ -2,3 +2,7 @@ export { RecordConfig, RecordSettings, RecordState } from "./record";
2
2
  export { MeticulousWindowConfig, NetworkResponseSanitizer, } from "./record/record-settings";
3
3
  export { ReplayUserInteractionsResult, ReplayUserInteractionsResultFull, ReplayUserInteractionsResultShort, BeforeUserEventOptions, } from "./replay/bundle-to-sdk/index";
4
4
  export { BootstrapReplayUserInteractionsFn, BootstrapReplayUserInteractionsOptions, OnReplayTimelineEventFn, ReplayUserInteractionsFn, ReplayUserInteractionsOptions, VirtualTimeOptions, InstallVirtualEventLoopOpts, SetupReplayNetworkStubbingFn, NetworkStubbingOptions, BrowserContextSeedingOptions, SetupBrowserContextSeedingFn, ScreenshottingOptions, } from "./replay/sdk-to-bundle";
5
+ export { ReplayAndStoreResultsOptions, AdditionalReplayOptions, ReplayTarget, SnapshottedAssetsReplayTarget, URLReplayTarget, OriginalRecordedURLReplayTarget, ReplayExecutionOptions, ReplayOrchestratorScreenshottingOptions, ScreenshottingEnabledOptions, StoryboardOptions, GeneratedBy, GeneratedByNotebookRun, GeneratedByTestRun, GeneratedByReplayCommand, } from "./replay-orchestrator/sdk-to-bundle/execute-replay";
6
+ export { ExecuteTestRunOptions } from "./replay-orchestrator/sdk-to-bundle/execute-test-run";
7
+ export { ExecuteTestRunResult, TestRunExecution, RunningTestRunExecution, FinishedTestRunExecution, TestRunProgress, DetailedTestCaseResult, } from "./replay-orchestrator/bundle-to-sdk/execute-test-run";
8
+ export { ReplayAndStoreResultsResult } from "./replay-orchestrator/bundle-to-sdk/execute-replay";
@@ -0,0 +1,8 @@
1
+ import { Replay, ScreenshotDiffResult } from "@alwaysmeticulous/api";
2
+ export interface ReplayAndStoreResultsResult {
3
+ replay: Replay;
4
+ /**
5
+ * Empty if screenshottingOptions.enabled was false.
6
+ */
7
+ screenshotDiffResultsByBaseReplayId: Record<string, ScreenshotDiffResult[]>;
8
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,24 @@
1
+ import { ScreenshotDiffResult, TestCaseResult, TestRun } from "@alwaysmeticulous/api";
2
+ export interface ExecuteTestRunResult {
3
+ testRun: FinishedTestRunExecution;
4
+ testCaseResults: DetailedTestCaseResult[];
5
+ }
6
+ export type TestRunExecution = Pick<TestRun, "id" | "url" | "status" | "project"> & {
7
+ progress: TestRunProgress;
8
+ url: string;
9
+ };
10
+ export interface RunningTestRunExecution extends TestRunExecution {
11
+ status: "Running";
12
+ }
13
+ export interface FinishedTestRunExecution extends TestRunExecution {
14
+ status: "Success" | "Failure";
15
+ }
16
+ export interface TestRunProgress {
17
+ failedTestCases: number;
18
+ flakedTestCases: number;
19
+ passedTestCases: number;
20
+ runningTestCases: number;
21
+ }
22
+ export interface DetailedTestCaseResult extends TestCaseResult {
23
+ screenshotDiffResultsByBaseReplayId: Record<string, ScreenshotDiffResult[]>;
24
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,92 @@
1
+ import { ScreenshotAssertionsOptions } from "@alwaysmeticulous/api";
2
+ export interface ReplayAndStoreResultsOptions extends AdditionalReplayOptions {
3
+ replayTarget: ReplayTarget;
4
+ executionOptions: ReplayExecutionOptions;
5
+ screenshottingOptions: ScreenshotAssertionsOptions;
6
+ generatedBy: GeneratedBy;
7
+ testRunId: string | null;
8
+ suppressScreenshotDiffLogging: boolean;
9
+ }
10
+ export interface AdditionalReplayOptions {
11
+ apiToken: string | null | undefined;
12
+ commitSha: string | null | undefined;
13
+ sessionId: string;
14
+ baseTestRunId: string | null | undefined;
15
+ cookiesFile: string | null | undefined;
16
+ debugger: boolean;
17
+ }
18
+ export type ReplayTarget = SnapshottedAssetsReplayTarget | URLReplayTarget | OriginalRecordedURLReplayTarget;
19
+ export interface SnapshottedAssetsReplayTarget {
20
+ type: "snapshotted-assets";
21
+ /**
22
+ * If present will run the session against a local server serving up previously snapshotted assets (HTML, JS, CSS etc.) from the specified prior replay, instead of against a URL.
23
+ */
24
+ simulationIdForAssets: string;
25
+ }
26
+ export interface URLReplayTarget {
27
+ type: "url";
28
+ /**
29
+ * If absent, and no URL provided in test case either, then will use the URL the session was recorded against.
30
+ */
31
+ appUrl: string;
32
+ }
33
+ export interface OriginalRecordedURLReplayTarget {
34
+ type: "original-recorded-url";
35
+ }
36
+ /**
37
+ * Options that control how a replay is executed.
38
+ */
39
+ export interface ReplayExecutionOptions {
40
+ headless: boolean;
41
+ devTools: boolean;
42
+ bypassCSP: boolean;
43
+ shiftTime: boolean;
44
+ networkStubbing: boolean;
45
+ skipPauses: boolean;
46
+ moveBeforeClick: boolean;
47
+ disableRemoteFonts: boolean;
48
+ noSandbox: boolean;
49
+ maxDurationMs: number | null;
50
+ maxEventCount: number | null;
51
+ /**
52
+ * If true disables any features that are non-essential for running tests/executing replays.
53
+ * This includes disabling recording a video of the replay, for playback in the web app.
54
+ *
55
+ * This flag is useful to reduce noise when debugging.
56
+ */
57
+ essentialFeaturesOnly: boolean;
58
+ }
59
+ export type ReplayOrchestratorScreenshottingOptions = {
60
+ enabled: false;
61
+ } | ScreenshottingEnabledOptions;
62
+ export interface ScreenshottingEnabledOptions {
63
+ enabled: true;
64
+ storyboardOptions: StoryboardOptions;
65
+ }
66
+ export type StoryboardOptions = {
67
+ enabled: false;
68
+ } | {
69
+ enabled: true;
70
+ };
71
+ export type NotebookRunId = StringId<"NotebookRunId">;
72
+ export type TestRunId = StringId<"TestRunId">;
73
+ export type GeneratedBy = GeneratedByNotebookRun | GeneratedByTestRun | GeneratedByReplayCommand;
74
+ export interface GeneratedByNotebookRun {
75
+ type: "notebook";
76
+ runId: NotebookRunId;
77
+ runName: string;
78
+ runDate: Date;
79
+ machineHostName: string;
80
+ }
81
+ export interface GeneratedByTestRun {
82
+ type: "testRun";
83
+ runId: TestRunId;
84
+ }
85
+ export interface GeneratedByReplayCommand {
86
+ type: "replayCommand";
87
+ }
88
+ type StringId<FlavorT> = Flavor<string, FlavorT>;
89
+ type Flavor<T, FlavorT> = T & {
90
+ _type?: FlavorT;
91
+ };
92
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,51 @@
1
+ import { ScreenshotAssertionsEnabledOptions, TestCaseResult, TestRunEnvironment } from "@alwaysmeticulous/api";
2
+ import { RunningTestRunExecution } from "../bundle-to-sdk/execute-test-run";
3
+ import { ReplayExecutionOptions } from "./execute-replay";
4
+ export interface ExecuteTestRunOptions {
5
+ testsFile: string | null;
6
+ executionOptions: ReplayExecutionOptions;
7
+ screenshottingOptions: ScreenshotAssertionsEnabledOptions;
8
+ apiToken: string | null;
9
+ commitSha: string;
10
+ /**
11
+ * The base commit to compare test results against for test cases that don't have a baseReplayId specified.
12
+ */
13
+ baseCommitSha: string | null;
14
+ appUrl: string | null;
15
+ /**
16
+ * If null runs in parralel with a sensible number of parrelel tasks for the given machine.
17
+ *
18
+ * Set to 1 to disable parralelism.
19
+ */
20
+ parallelTasks: number | null;
21
+ /**
22
+ * If set to a value greater than 1 then will re-run any replays that give a screenshot diff
23
+ * and mark them as a flake if the screenshot generated on one of the retryed replays differs from that
24
+ * in the first replay.
25
+ */
26
+ maxRetriesOnFailure: number;
27
+ /**
28
+ * If set to a value greater than 0 then will re-run all replays the specified number of times
29
+ * and mark them as a flake if the screenshot generated on one of the retryed replays differs from that
30
+ * in the first replay.
31
+ *
32
+ * This is useful for checking flake rates.
33
+ *
34
+ * This option is mutually exclusive with maxRetriesOnFailure.
35
+ */
36
+ rerunTestsNTimes: number;
37
+ githubSummary: boolean;
38
+ /**
39
+ * If provided it will incorportate the cachedTestRunResults in any calls to store
40
+ * test run results in the BE, but won't include the cachedTestRunResults in the returned
41
+ * ExecuteTestRunResult.
42
+ */
43
+ cachedTestRunResults?: TestCaseResult[];
44
+ /**
45
+ * Captured environment for this run
46
+ */
47
+ environment?: TestRunEnvironment;
48
+ baseTestRunId: string | null;
49
+ onTestRunCreated?: (testRun: RunningTestRunExecution) => void;
50
+ onTestFinished?: (testRun: RunningTestRunExecution) => void;
51
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alwaysmeticulous/sdk-bundles-api",
3
- "version": "2.40.3",
3
+ "version": "2.40.4",
4
4
  "description": "Meticulous common types",
5
5
  "license": "ISC",
6
6
  "main": "dist/index.js",
@@ -19,7 +19,7 @@
19
19
  "depcheck": "depcheck --ignore-patterns=dist"
20
20
  },
21
21
  "devDependencies": {
22
- "@alwaysmeticulous/api": "^2.40.3"
22
+ "@alwaysmeticulous/api": "^2.40.4"
23
23
  },
24
24
  "peerDependencies": {
25
25
  "loglevel": "^1.8.0",
@@ -50,5 +50,5 @@
50
50
  "bugs": {
51
51
  "url": "https://github.com/alwaysmeticulous/meticulous-sdk/issues"
52
52
  },
53
- "gitHead": "b7055372caa771a9d69856d53933021f134a7388"
53
+ "gitHead": "11acce96c03e23cbb556779a121710a8136d24db"
54
54
  }