@applitools/eyes 1.36.20 → 1.38.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/CHANGELOG.md CHANGED
@@ -1,5 +1,61 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.38.0](https://github.com/Applitools-Dev/sdk/compare/js/eyes@1.37.0...js/eyes@1.38.0) (2026-01-19)
4
+
5
+
6
+ ### Features
7
+
8
+ * multi-page support - FLD-3827 ([#3410](https://github.com/Applitools-Dev/sdk/issues/3410)) ([a55b982](https://github.com/Applitools-Dev/sdk/commit/a55b9827c2218c11da5ed61b38bf12a70ce4c8db))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * @applitools/dom-snapshot bumped to 4.15.6
14
+
15
+ * @applitools/driver bumped to 1.25.0
16
+ #### Features
17
+
18
+ * multi-page support - FLD-3827 ([#3410](https://github.com/Applitools-Dev/sdk/issues/3410)) ([a55b982](https://github.com/Applitools-Dev/sdk/commit/a55b9827c2218c11da5ed61b38bf12a70ce4c8db))
19
+ * @applitools/spec-driver-webdriver bumped to 1.5.5
20
+
21
+ * @applitools/spec-driver-selenium bumped to 1.7.11
22
+
23
+ * @applitools/spec-driver-puppeteer bumped to 1.7.0
24
+ #### Features
25
+
26
+ * multi-page support - FLD-3827 ([#3410](https://github.com/Applitools-Dev/sdk/issues/3410)) ([a55b982](https://github.com/Applitools-Dev/sdk/commit/a55b9827c2218c11da5ed61b38bf12a70ce4c8db))
27
+
28
+
29
+
30
+ * @applitools/screenshoter bumped to 3.12.12
31
+
32
+ * @applitools/nml-client bumped to 1.11.15
33
+
34
+ * @applitools/ec-client bumped to 1.12.17
35
+
36
+ * @applitools/core bumped to 4.55.0
37
+ #### Features
38
+
39
+ * multi-page support - FLD-3827 ([#3410](https://github.com/Applitools-Dev/sdk/issues/3410)) ([a55b982](https://github.com/Applitools-Dev/sdk/commit/a55b9827c2218c11da5ed61b38bf12a70ce4c8db))
40
+
41
+
42
+
43
+
44
+ ## [1.37.0](https://github.com/Applitools-Dev/sdk/compare/js/eyes@1.36.20...js/eyes@1.37.0) (2026-01-14)
45
+
46
+
47
+ ### Features
48
+
49
+ * expose buildId in BatchInfo type | FLD-4020 ([#3466](https://github.com/Applitools-Dev/sdk/issues/3466)) ([7868ba0](https://github.com/Applitools-Dev/sdk/commit/7868ba08de9a9d348c42d8eac5a953dce44844d0))
50
+
51
+
52
+ ### Dependencies
53
+
54
+ * @applitools/core bumped to 4.54.3
55
+ #### Bug Fixes
56
+
57
+ * `close`/`getResults` race condition ([#3450](https://github.com/Applitools-Dev/sdk/issues/3450)) ([2e5437d](https://github.com/Applitools-Dev/sdk/commit/2e5437dcfde6fda58d76227659ee249bfa3885a7))
58
+
3
59
  ## [1.36.20](https://github.com/Applitools-Dev/sdk/compare/js/eyes@1.36.19...js/eyes@1.36.20) (2026-01-11)
4
60
 
5
61
 
package/dist/Eyes.js CHANGED
@@ -291,7 +291,11 @@ class Eyes {
291
291
  }
292
292
  async checkRegion(imageOrRegion, regionOrName, nameOrTimeout, ignoreMismatch = false) {
293
293
  return utils.types.has(imageOrRegion, ['x', 'y', 'width', 'height'])
294
- ? this.check({ region: imageOrRegion, name: regionOrName, timeout: nameOrTimeout })
294
+ ? this.check({
295
+ region: imageOrRegion,
296
+ name: regionOrName,
297
+ timeout: nameOrTimeout,
298
+ })
295
299
  : this.check({ image: imageOrRegion }, { region: regionOrName, name: nameOrTimeout, ignoreMismatch });
296
300
  }
297
301
  /** @deprecated */
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -37,6 +37,7 @@ class BatchInfoData {
37
37
  utils.guard.isString(batch.sequenceName, { name: 'sequenceName', strict: false });
38
38
  utils.guard.isBoolean(batch.notifyOnCompletion, { name: 'notifyOnCompletion', strict: false });
39
39
  utils.guard.isArray(batch.properties, { name: 'properties', strict: false });
40
+ utils.guard.isString(batch.buildId, { name: 'buildId', strict: false });
40
41
  this._batch = {
41
42
  id: (_b = (_a = batch.id) !== null && _a !== void 0 ? _a : utils.general.getEnvValue('BATCH_ID')) !== null && _b !== void 0 ? _b : `generated-${utils.general.guid()}`,
42
43
  name: (_c = batch.name) !== null && _c !== void 0 ? _c : utils.general.getEnvValue('BATCH_NAME'),
@@ -44,6 +45,7 @@ class BatchInfoData {
44
45
  startedAt: (_e = batch.startedAt) !== null && _e !== void 0 ? _e : new Date(),
45
46
  notifyOnCompletion: (_g = (_f = batch.notifyOnCompletion) !== null && _f !== void 0 ? _f : utils.general.getEnvValue('BATCH_NOTIFY', 'boolean')) !== null && _g !== void 0 ? _g : false,
46
47
  properties: batch.properties,
48
+ buildId: batch.buildId,
47
49
  };
48
50
  }
49
51
  get id() {
@@ -137,6 +139,20 @@ class BatchInfoData {
137
139
  this.properties.push(property);
138
140
  return this;
139
141
  }
142
+ get buildId() {
143
+ return this._batch.buildId;
144
+ }
145
+ set buildId(buildId) {
146
+ utils.guard.isString(buildId, { name: 'buildId', strict: false });
147
+ this._batch.buildId = buildId;
148
+ }
149
+ getBuildId() {
150
+ return this.buildId;
151
+ }
152
+ setBuildId(buildId) {
153
+ this.buildId = buildId;
154
+ return this;
155
+ }
140
156
  /** @internal */
141
157
  toObject() {
142
158
  return this._batch;
@@ -458,6 +458,12 @@ class CheckSettingsAutomationFluent extends CheckSettingsBaseFluent {
458
458
  return self;
459
459
  }
460
460
  region(region) {
461
+ // Extract page if present (opt-in for multi-page contexts)
462
+ if (utils.types.isPlainObject(region) && utils.types.has(region, 'page')) {
463
+ const { page, ...regionWithoutPage } = region;
464
+ this._settings.page = page;
465
+ region = regionWithoutPage;
466
+ }
461
467
  if (this._isSelectorReference(region) &&
462
468
  this._isSelectorReference(this._settings.region) &&
463
469
  utils.types.has(this._settings.region, 'selector')) {
@@ -489,9 +495,20 @@ class CheckSettingsAutomationFluent extends CheckSettingsBaseFluent {
489
495
  return this;
490
496
  }
491
497
  frame(contextOrFrame, scrollRootElement) {
498
+ // Extract page if present in object form
499
+ let page;
500
+ if (utils.types.isPlainObject(contextOrFrame) && utils.types.has(contextOrFrame, 'page')) {
501
+ page = contextOrFrame.page;
502
+ }
503
+ // Normalize to ContextReference
492
504
  const context = this._isFrameReference(contextOrFrame) || this._isSelectorReference(contextOrFrame)
493
505
  ? { frame: contextOrFrame, scrollRootElement }
494
506
  : contextOrFrame;
507
+ // Set page if provided (opt-in for multi-page contexts)
508
+ if (page) {
509
+ ;
510
+ this._settings.page = page;
511
+ }
495
512
  if (!this._settings.frames)
496
513
  this._settings.frames = [];
497
514
  this._settings.frames.push(context);
@@ -616,7 +633,7 @@ class CheckSettingsAutomationFluent extends CheckSettingsBaseFluent {
616
633
  toJSON() {
617
634
  var _a, _b, _c, _d, _e, _f, _g, _h;
618
635
  return {
619
- target: undefined,
636
+ target: this._settings.page,
620
637
  settings: utils.general.removeUndefinedProps({
621
638
  name: this._settings.name,
622
639
  region: this._settings.region ? this.toCoreRegion(this._settings.region) : this._settings.region,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/eyes",
3
- "version": "1.36.20",
3
+ "version": "1.38.0",
4
4
  "keywords": [
5
5
  "applitools",
6
6
  "eyes",
@@ -30,6 +30,10 @@
30
30
  "types": "./types/index.d.ts",
31
31
  "default": "./dist/index.js"
32
32
  },
33
+ "./SettingsWithPage": {
34
+ "types": "./types/SettingsWithPage.d.ts",
35
+ "default": "./dist/SettingsWithPage.js"
36
+ },
33
37
  "./dist/*": "./dist/*.js",
34
38
  "./package.json": "./package.json"
35
39
  },
@@ -46,7 +50,7 @@
46
50
  "test": "run --top-level mocha './test/**/*.spec.ts'"
47
51
  },
48
52
  "dependencies": {
49
- "@applitools/core": "4.54.2",
53
+ "@applitools/core": "4.55.0",
50
54
  "@applitools/logger": "2.2.7",
51
55
  "@applitools/utils": "1.14.1",
52
56
  "chalk": "4.1.2",
package/types/Eyes.d.ts CHANGED
@@ -26,7 +26,8 @@ import { ValidationResult } from './output/ValidationResult';
26
26
  import { SessionEventHandler, SessionEventHandlers } from './SessionEventHandlers';
27
27
  import { EyesRunner } from './Runners';
28
28
  import { Logger } from './Logger';
29
- export declare class Eyes<TSpec extends Core.SpecType = Core.SpecType> {
29
+ export { CheckSettingsOptIn } from './input/CheckSettings';
30
+ export declare class Eyes<TSpec extends Core.SpecType = Core.SpecType, TCheckSettingsWithAutomation extends CheckSettingsAutomation<TSpec> = CheckSettingsAutomation<TSpec>> {
30
31
  protected static readonly _sdk: SDK<Core.SpecType>;
31
32
  protected get _sdk(): SDK<TSpec>;
32
33
  private _logger;
@@ -102,7 +103,7 @@ export declare class Eyes<TSpec extends Core.SpecType = Core.SpecType> {
102
103
  open(appName?: string, testName?: string, viewportSize?: RectangleSize, sessionType?: SessionType): Promise<void>;
103
104
  check(name: string, checkSettings: CheckSettingsImageFluent | CheckSettingsAutomationFluent<TSpec>): Promise<MatchResultData>;
104
105
  check(target: Image, checkSettings?: CheckSettingsImage): Promise<MatchResultData>;
105
- check(checkSettings?: CheckSettingsAutomation<TSpec>): Promise<MatchResultData>;
106
+ check(checkSettings?: TCheckSettingsWithAutomation): Promise<MatchResultData>;
106
107
  /** @deprecated */
107
108
  checkWindow(name?: string, timeout?: number, fully?: boolean): Promise<MatchResultData>;
108
109
  /** @deprecated */
@@ -0,0 +1 @@
1
+ export { CheckSettingsOptIn as CheckSettings, RegionReferenceWithPage as RegionReference } from './input/CheckSettings';
@@ -6,6 +6,7 @@ export type BatchInfo = {
6
6
  startedAt?: Date | string;
7
7
  notifyOnCompletion?: boolean;
8
8
  properties?: PropertyData[];
9
+ buildId?: string;
9
10
  };
10
11
  export declare class BatchInfoData implements Required<BatchInfo> {
11
12
  private _batch;
@@ -38,6 +39,10 @@ export declare class BatchInfoData implements Required<BatchInfo> {
38
39
  setProperties(properties: PropertyData[]): this;
39
40
  addProperty(name: string, value: string): this;
40
41
  addProperty(prop: PropertyData): this;
42
+ get buildId(): string;
43
+ set buildId(buildId: string);
44
+ getBuildId(): string;
45
+ setBuildId(buildId: string): this;
41
46
  /** @internal */
42
47
  toObject(): BatchInfo;
43
48
  /** @internal */
@@ -82,7 +82,7 @@ type LayoutBreakpoints = boolean | number[] | {
82
82
  heightBreakpoints: boolean;
83
83
  reload?: boolean;
84
84
  };
85
- export type CheckSettingsAutomation<TSpec extends Core.SpecType> = CheckSettingsBase<RegionReference<TSpec>> & {
85
+ export type CheckSettingsAutomation<TSpec extends Core.SpecType, TRegionReference = RegionReference<TSpec>> = CheckSettingsBase<TRegionReference> & {
86
86
  frames?: (ContextReference<TSpec> | FrameReference<TSpec>)[];
87
87
  webview?: boolean | string;
88
88
  scrollRootElement?: ElementReference<TSpec>;
@@ -108,6 +108,31 @@ export type CheckSettingsAutomation<TSpec extends Core.SpecType> = CheckSettings
108
108
  waitBeforeCapture?: number | (() => Promise<void>);
109
109
  lazyLoad?: boolean | LazyLoadOptions;
110
110
  };
111
+ /**
112
+ * All available opt-in properties for CheckSettings.
113
+ * Platforms can selectively include these properties as needed.
114
+ *
115
+ * @template TSpec - The spec type for the platform
116
+ */
117
+ type CheckSettingsWithPage<TSpec extends Core.SpecType> = {
118
+ page?: TSpec['driver'];
119
+ };
120
+ export type RegionReferenceWithPage<TSpec extends Core.SpecType> = (Region & {
121
+ page?: TSpec['driver'];
122
+ }) | {
123
+ selector: TSpec['selector'] | string;
124
+ page?: TSpec['driver'];
125
+ } | ElementReference<TSpec>;
126
+ /**
127
+ * Opt-in properties for multi-page context support.
128
+ * Platforms that support multi-page contexts (Playwright, Puppeteer) should include this.
129
+ *
130
+ * @template TSpec - The spec type for the platform
131
+ * @template TKeys - Optional array of property keys to include. If not specified, only 'page' is included.
132
+ *
133
+ */
134
+ export type CheckSettingsOptIn<TSpec extends Core.SpecType, TKeys extends readonly (keyof CheckSettingsWithPage<TSpec>)[] = ['page']> = Pick<CheckSettingsWithPage<TSpec>, TKeys[number]>;
135
+ export type CheckSettingsAutomationWithOptIn<TSpec extends Core.SpecType> = CheckSettingsAutomation<TSpec, RegionReferenceWithPage<TSpec>> & CheckSettingsOptIn<TSpec, ['page']>;
111
136
  export declare class CheckSettingsBaseFluent<TRegion = never> {
112
137
  protected _settings: CheckSettingsBase<TRegion>;
113
138
  protected parent?: this;
@@ -192,16 +217,17 @@ export declare class CheckSettingsImageFluent extends CheckSettingsBaseFluent {
192
217
  settings: Core.CheckSettings<never, 'classic'>;
193
218
  };
194
219
  }
195
- export declare class CheckSettingsAutomationFluent<TSpec extends Core.SpecType = Core.SpecType> extends CheckSettingsBaseFluent<RegionReference<TSpec>> {
220
+ export declare class CheckSettingsAutomationFluent<TSpec extends Core.SpecType = Core.SpecType, TCheckSettingsWithAutomation extends CheckSettingsAutomation<TSpec> = CheckSettingsAutomation<TSpec>> extends CheckSettingsBaseFluent<RegionReference<TSpec>> {
196
221
  protected _settings: CheckSettingsAutomation<TSpec>;
197
222
  protected static readonly _spec: Core.SpecDriver<Core.SpecType>;
198
223
  protected _spec: Core.SpecDriver<TSpec>;
199
224
  protected _isElementReference(value: any): value is ElementReference<TSpec>;
200
225
  protected _isSelectorReference(selector: any): selector is SelectorReference<TSpec>;
201
226
  protected _isFrameReference(value: any): value is FrameReference<TSpec>;
202
- constructor(settings?: CheckSettingsAutomation<TSpec> | CheckSettingsAutomationFluent<TSpec>);
227
+ constructor(settings?: CheckSettingsAutomationFluent<TSpec>);
228
+ constructor(settings?: TCheckSettingsWithAutomation);
203
229
  /** @internal */
204
- constructor(settings?: CheckSettingsAutomation<TSpec> | CheckSettingsAutomationFluent<TSpec>, spec?: Core.SpecDriver<TSpec>, parent?: CheckSettingsAutomationFluent<TSpec>);
230
+ constructor(settings?: TCheckSettingsWithAutomation | CheckSettingsAutomationFluent<TSpec>, spec?: Core.SpecDriver<TSpec>, parent?: CheckSettingsAutomationFluent<TSpec>);
205
231
  region(region: RegionReference<TSpec>): this;
206
232
  shadow(selector: SelectorReference<TSpec>): typeof this;
207
233
  frame(context: ContextReference<TSpec>): this;
@@ -252,7 +278,7 @@ export declare class CheckSettingsAutomationFluent<TSpec extends Core.SpecType =
252
278
  };
253
279
  /** @internal */
254
280
  toJSON(): {
255
- target: undefined;
281
+ target: TSpec['driver'] | undefined;
256
282
  settings: Core.CheckSettings<TSpec, 'classic'> & Core.CheckSettings<TSpec, 'ufg'>;
257
283
  };
258
284
  }
@@ -264,7 +290,7 @@ export type TargetImage = {
264
290
  url(imageUrl: URL | string): CheckSettingsImageFluent;
265
291
  };
266
292
  export declare const TargetImage: TargetImage;
267
- export type TargetAutomation<TSpec extends Core.SpecType = Core.SpecType> = {
293
+ export type TargetAutomationBase<TSpec extends Core.SpecType = Core.SpecType> = {
268
294
  /** @internal */
269
295
  spec: Core.SpecDriver<TSpec>;
270
296
  window(): CheckSettingsAutomationFluent<TSpec>;
@@ -274,7 +300,8 @@ export type TargetAutomation<TSpec extends Core.SpecType = Core.SpecType> = {
274
300
  shadow(selector: SelectorReference<TSpec>): CheckSettingsAutomationFluent<TSpec>;
275
301
  webview(webview?: string | boolean): CheckSettingsAutomationFluent<TSpec>;
276
302
  };
277
- export declare const TargetAutomation: TargetAutomation<Core.SpecType>;
303
+ export type TargetAutomation<TSpec extends Core.SpecType = Core.SpecType> = TargetAutomationBase<TSpec>;
304
+ export declare const TargetAutomation: TargetAutomationBase<Core.SpecType>;
278
305
  export type Target<TSpec extends Core.SpecType = Core.SpecType> = TargetImage & TargetAutomation<TSpec>;
279
306
  export declare const Target: Target<Core.SpecType>;
280
307
  export {};