@alwaysmeticulous/api 2.86.0 → 2.89.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/index.d.ts CHANGED
@@ -1,13 +1,13 @@
1
1
  export { Organization } from "./organization.types";
2
2
  export { Project, ProjectConfigurationData, ProjectSettingsScreenshottingOptions, } from "./project.types";
3
- export { EndStateScreenshot, ScreenshotAfterEvent, ScreenshotDiffResult, ScreenshotDiffResultCompared, ScreenshotDiffResultDifferentSize, ScreenshotDiffResultMissingBase, ScreenshotDiffResultMissingBaseAndHead, ScreenshotDiffResultMissingHead, ScreenshotDiffResultDifference, ScreenshotDiffResultNoDifference, ScreenshotIdentifier, SingleTryScreenshotDiffResult, ScreenshotDiffRetryResult, SingleTryScreenshotDiffRetryResult, } from "./sdk-bundle-api/bundle-to-sdk/screenshot-diff-result";
3
+ export { EndStateScreenshot, ScreenshotAfterEvent, ScreenshotDiffResult, ScreenshotDiffResultCompared, ScreenshotDiffResultDifferentSize, ScreenshotDiffResultMissingBase, ScreenshotDiffResultMissingBaseAndHead, ScreenshotDiffResultMissingHead, ScreenshotDiffResultDifference, ScreenshotDiffResultNoDifference, ScreenshotIdentifier, ScreenshotVariant, SingleTryScreenshotDiffResult, ScreenshotDiffRetryResult, SingleTryScreenshotDiffRetryResult, } from "./sdk-bundle-api/bundle-to-sdk/screenshot-diff-result";
4
4
  export { TestCase, TestCaseReplayOptions, TestRunStatus, TestCaseResult, TestCaseResultStatus, } from "./replay/test-run.types";
5
5
  export { TestRunEnvironment, TestRunGitHubContext, TestRunGitHubPullRequestContext, TestRunGitHubPushContext, TestRunGitHubWorkflowDispatchContext, TestRunGitLabContext, TestRunGitLabMergeRequestContext, TestRunGitLabPushContext, } from "./sdk-bundle-api/sdk-to-bundle/test-run-environment";
6
6
  export { ReplayableEvent } from "./sdk-bundle-api/bidirectional/replayable-event";
7
7
  export { HarEntry, HarLog, HarRequest, HarResponse, } from "./sdk-bundle-api/sdk-to-bundle/har-log";
8
8
  export { Cookie, SessionData, UrlHistoryEvent, WindowData, ApplicationSpecificData, LocalStorageEntry, EarlyRequest, } from "./sdk-bundle-api/sdk-to-bundle/session-data";
9
9
  export { Replay } from "./replay/replay.types";
10
- export { ScreenshotAssertionsOptions, ScreenshotAssertionsEnabledOptions, ScreenshottingEnabledOptions, StoryboardOptions, ScreenshotDiffOptions, } from "./sdk-bundle-api/sdk-to-bundle/screenshotting-options";
10
+ export { ScreenshotAssertionsOptions, ScreenshotAssertionsEnabledOptions, ScreenshottingEnabledOptions, StoryboardOptions, ScreenshotDiffOptions, ElementToIgnore, CSSSelectorToIgnore, } from "./sdk-bundle-api/sdk-to-bundle/screenshotting-options";
11
11
  export { NetworkStubbingMode, StubAllRequests, StubNonSSRRequests, NoStubbing, CustomStubbing, RequestFilter, } from "./sdk-bundle-api/sdk-to-bundle/network-stubbing";
12
12
  export { ConsoleMessageWithStackTracePointer, VirtualTimeChange, MeticulousConsoleMessage, ApplicationConsoleMessage, ConsoleMessageCoreData, ConsoleMessageType, ConsoleMessageLocation, } from "./sdk-bundle-api/bundle-to-sdk/console-message";
13
13
  export { InjectableRequestHeader, StaticHeaderValue, DynamicHeaderValue, AllRequests, AppUrlRequestsOnly, CustomRequests, } from "./sdk-bundle-api/sdk-to-bundle/header-injection";
@@ -16,7 +16,7 @@ export interface Project {
16
16
  defaultScreenshottingOptions?: ProjectSettingsScreenshottingOptions;
17
17
  };
18
18
  }
19
- export type ProjectSettingsScreenshottingOptions = Partial<Pick<ScreenshottingEnabledOptions, "waitBeforeScreenshotsMs" | "captureFullPage">>;
19
+ export type ProjectSettingsScreenshottingOptions = Partial<Pick<ScreenshottingEnabledOptions, "waitBeforeScreenshotsMs" | "captureFullPage" | "elementsToIgnore">>;
20
20
  export interface ProjectConfigurationData {
21
21
  testCases?: TestCase[];
22
22
  }
@@ -16,12 +16,21 @@ export interface LogicVersioned {
16
16
  }
17
17
  export interface EndStateScreenshot extends LogicVersioned {
18
18
  type: "end-state";
19
+ /** If unset is normal variant */
20
+ variant?: ScreenshotVariant;
19
21
  }
20
22
  export interface ScreenshotAfterEvent extends LogicVersioned {
21
23
  type: "after-event";
22
24
  /** 0 indexed */
23
25
  eventNumber: number;
26
+ /** If unset is normal variant */
27
+ variant?: ScreenshotVariant;
24
28
  }
29
+ /**
30
+ * normal = the original screenshot to be displayed to the user
31
+ * redacted = after injecting CSS `display: hidden` rules for the CSS selectors to ignore
32
+ */
33
+ export type ScreenshotVariant = "normal" | "redacted";
25
34
  export interface ScreenshotDiffResultMissingBase {
26
35
  outcome: "missing-base";
27
36
  /** Relative path to the replay archive */
@@ -58,6 +67,17 @@ export interface ScreenshotDiffResultCompared {
58
67
  }
59
68
  export interface ScreenshotDiffResultNoDifference extends ScreenshotDiffResultCompared {
60
69
  outcome: "no-diff";
70
+ /**
71
+ * The result of comparing the redacted screenshots (i.e. screenshots taken after elements
72
+ * to ignore have been hidden/removed).
73
+ *
74
+ * Present only if there were redacted screenshots to compare, or if the original normal
75
+ * screenshots did not differ so there was no need to compare the redacted screenshots.
76
+ */
77
+ redactedScreenshotsComparisonResult?: {
78
+ mismatchPixels: number;
79
+ mismatchFraction: number;
80
+ };
61
81
  }
62
82
  export interface ScreenshotDiffResultDifference extends ScreenshotDiffResultCompared {
63
83
  outcome: "diff";
@@ -12,6 +12,7 @@ export interface ScreenshotAssertionsEnabledOptions extends ScreenshottingEnable
12
12
  export interface ScreenshottingEnabledOptions {
13
13
  enabled: true;
14
14
  storyboardOptions: StoryboardOptions;
15
+ elementsToIgnore?: ElementToIgnore[];
15
16
  waitBeforeScreenshotsMs?: number;
16
17
  captureFullPage?: boolean;
17
18
  }
@@ -24,3 +25,14 @@ export interface ScreenshotDiffOptions {
24
25
  diffThreshold: number;
25
26
  diffPixelThreshold: number;
26
27
  }
28
+ export type ElementToIgnore = CSSSelectorToIgnore;
29
+ /**
30
+ * Any elements that match this CSS selector will be hidden/removed before taking a screenshot.
31
+ *
32
+ * The diff will only be shown to the user if the both the original unredacted screenshots differ,
33
+ * and the new redacted screenshots also differ.
34
+ */
35
+ export interface CSSSelectorToIgnore {
36
+ type: "css-selector";
37
+ selector: string;
38
+ }
@@ -40,6 +40,11 @@ export interface Cookie {
40
40
  value: string;
41
41
  domain: string | null;
42
42
  expires: number | null;
43
+ path?: string;
44
+ partitioned?: boolean;
45
+ sameSite?: "strict" | "lax" | "none";
46
+ secure?: boolean;
47
+ httpOnly?: boolean;
43
48
  }
44
49
  export interface UrlHistoryEvent {
45
50
  timestamp: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alwaysmeticulous/api",
3
- "version": "2.86.0",
3
+ "version": "2.89.0",
4
4
  "description": "Meticulous API types",
5
5
  "license": "ISC",
6
6
  "main": "dist/index.js",
@@ -35,5 +35,5 @@
35
35
  "bugs": {
36
36
  "url": "https://github.com/alwaysmeticulous/meticulous-sdk/issues"
37
37
  },
38
- "gitHead": "ccd3417f7f4764443f13bb7ebb4f916e2d8f589d"
38
+ "gitHead": "ee8222d6956a9f2c7e1312476899443fd5e3450c"
39
39
  }