@applitools/eyes-webdriverio 5.34.8 → 5.34.12

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
@@ -3,6 +3,33 @@
3
3
  ## Unreleased
4
4
 
5
5
 
6
+ ## 5.34.12 - 2022/2/16
7
+
8
+ - fix image scaling on pages without viewport metatag
9
+ - fix safari's viewport detection on iOS devices
10
+ - updated to @applitools/eyes-api@1.1.8 (from 1.1.7)
11
+ - updated to @applitools/eyes-sdk-core@13.0.4 (from 13.0.2)
12
+ - updated to @applitools/visual-grid-client@15.8.65 (from 15.8.63)
13
+
14
+ ## 5.34.11 - 2022/2/10
15
+
16
+ - allow setting ‘setImageCut’ also after eyes.open (change done in eyes-sdk-core)
17
+ - updated to @applitools/eyes-sdk-core@13.0.2 (from 13.0.0)
18
+ - updated to @applitools/spec-driver-webdriverio@1.2.7 (from 1.2.6)
19
+ - updated to @applitools/visual-grid-client@15.8.63 (from 15.8.62)
20
+
21
+ ## 5.34.10 - 2022/1/24
22
+
23
+ - Fixed BatchInfo.addProperty bug
24
+ - updated to @applitools/eyes-api@1.1.7 (from 1.1.6)
25
+ - updated to @applitools/eyes-sdk-core@13.0.0 (from 12.24.13)
26
+ - updated to @applitools/visual-grid-client@15.8.62 (from 15.8.60)
27
+
28
+ ## 5.34.9 - 2022/1/12
29
+
30
+ - updated to @applitools/eyes-sdk-core@12.24.13 (from 12.24.12)
31
+ - updated to @applitools/visual-grid-client@15.8.60 (from 15.8.59)
32
+
6
33
  ## 5.34.8 - 2022/1/11
7
34
 
8
35
  - updated to @applitools/eyes-sdk-core@12.24.12 (from 12.24.9)
package/README.md CHANGED
@@ -54,6 +54,7 @@
54
54
  + [`browser.eyesGetConfiguration()`](#-browsereyesgetconfiguration---)
55
55
  + [`browser.eyesAddProperty(key, value)`](#-browsereyesaddproperty-key--value--)
56
56
  + [`browser.eyesClearProperties()`](#-browsereyesclearproperties---)
57
+ - [Visual locators](#visual-locators)
57
58
  - [Recipes for common tasks](#recipes-for-common-tasks)
58
59
  * [Configure Server URL](#configure-server-url)
59
60
  * [Configure Proxy](#configure-proxy)
@@ -705,6 +706,64 @@ Adds a custom key name/value property that will be associated with your tests. Y
705
706
 
706
707
  Clears any custom key name/value properties.
707
708
 
709
+ ## Visual locators
710
+
711
+ Information about what are visual locators and how to use them can be found in the documentation page [here](https://applitools.com/docs/features/visual-locators.html).
712
+
713
+ The API to locate a visual locator in Eyes-WebdriverIO has the following TypeScript signature:
714
+
715
+ ```ts
716
+ // Note: This is a formal TypeScript definition.
717
+ // The reason we use the generic type TLocator here is that is shows how the return value of eyes.locate is an object
718
+ // with the same keys as the array of locatorNames in the input to eyes.locate.
719
+ // We explain this in more detail in the example below.
720
+
721
+ interface Eyes {
722
+ locate<TLocator extends string>(settings: VisualLocatorSettings<TLocator>): Promise<Record<TLocator, Array<Region>>>
723
+ }
724
+
725
+ interface VisualLocatorSettings<TLocator extends string> {
726
+ locatorNames: Array<TLocator>;
727
+ firstOnly: boolean;
728
+ }
729
+
730
+ interface Region {
731
+ x: number;
732
+ y: number;
733
+ width: number;
734
+ height: number;
735
+ }
736
+ ```
737
+
738
+ Here is an example for using this API and applying a touch action in Appium:
739
+
740
+ ```js
741
+ // first need to call eyes.open
742
+ await eyes.open(browser, 'Test app', 'Test visual locators')
743
+
744
+ // example for using eyes.locate
745
+ const regionsMap = await eyes.locate({
746
+ locatorNames: ['locator_a', 'locator_b', 'locator_c'],
747
+ })
748
+
749
+ // now get the coordinates of one of the locators
750
+ const regionsForLocator_A = regionsMap['locator_a']
751
+
752
+ // if region is found, perform press at the middle
753
+ if (regionsForLocator_A && regionsForLocator_A.length > 0) {
754
+ const region = regionsForLocator_A[0]
755
+ const clickLocation = {
756
+ x: region.left + region.width / 2,
757
+ y: region.top + region.height / 2,
758
+ }
759
+ await browser.touchAction([
760
+ {action: 'press', x: clickLocation.x, y: clickLocation.y},
761
+ {action: 'wait', ms: 500},
762
+ 'release',
763
+ ])
764
+ }
765
+ ```
766
+
708
767
  ## Recipes for common tasks
709
768
 
710
769
  ### Configure Server URL
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/eyes-webdriverio",
3
- "version": "5.34.8",
3
+ "version": "5.34.12",
4
4
  "description": "Applitools Eyes SDK for WebdriverIO",
5
5
  "keywords": [
6
6
  "eyes-webdriverio",
@@ -99,7 +99,7 @@
99
99
  "deps": "bongo deps",
100
100
  "gh:test": "gh workflow run test.yml --ref $(git rev-parse --abbrev-ref HEAD) -f packages='wdio wdio(node:14) wdio(node:12) wdio(protocol:cdp) wdio(framework:6) wdio(framework:5)'",
101
101
  "gh:test:links": "gh workflow run test.yml --ref $(git rev-parse --abbrev-ref HEAD) -f packages='wdio wdio+cdp wdio@6 wdio@5' -f links='types test-utils sdk-shared eyes-sdk-core visual-grid-client eyes-api spec-driver-webdriverio utils driver snippets screenshoter' -f linking-depth=3",
102
- "gh:publish": "gh workflow run publish.yml --ref $(git rev-parse --abbrev-ref HEAD) -f packages='wdio'",
102
+ "gh:publish": "gh workflow run publish-webdriverio.yml --ref $(git rev-parse --abbrev-ref HEAD)",
103
103
  "preversion": "bongo preversion && yarn build",
104
104
  "version": "bongo version",
105
105
  "postversion": "bongo postversion"
@@ -110,18 +110,18 @@
110
110
  }
111
111
  },
112
112
  "dependencies": {
113
- "@applitools/eyes-api": "1.1.6",
114
- "@applitools/eyes-sdk-core": "12.24.12",
115
- "@applitools/spec-driver-webdriverio": "1.2.6",
116
- "@applitools/visual-grid-client": "15.8.59"
113
+ "@applitools/eyes-api": "1.1.8",
114
+ "@applitools/eyes-sdk-core": "13.0.4",
115
+ "@applitools/spec-driver-webdriverio": "1.2.7",
116
+ "@applitools/visual-grid-client": "15.8.65"
117
117
  },
118
118
  "devDependencies": {
119
- "@applitools/api-extractor": "1.2.6",
119
+ "@applitools/api-extractor": "1.2.7",
120
120
  "@applitools/scripts": "1.1.0",
121
121
  "@applitools/sdk-coverage-tests": "^2.3.18",
122
- "@applitools/sdk-release-kit": "^0.13.10",
122
+ "@applitools/sdk-release-kit": "^0.13.11",
123
123
  "@applitools/sdk-shared": "0.9.11",
124
- "@applitools/test-utils": "1.0.10",
124
+ "@applitools/test-utils": "1.0.12",
125
125
  "@types/mocha": "^9.0.0",
126
126
  "@typescript-eslint/eslint-plugin": "^4.15.1",
127
127
  "@typescript-eslint/parser": "^4.15.1",
@@ -142,7 +142,7 @@
142
142
  "spec-xunit-file": "0.0.1-3",
143
143
  "ts-node": "^10.2.1",
144
144
  "ttypescript": "^1.5.12",
145
- "typescript": "^4.5.1-rc",
145
+ "typescript": "^4.5.5",
146
146
  "webdriverio": "^7.16.12"
147
147
  },
148
148
  "peerDependencies": {
package/types/index.d.ts CHANGED
@@ -181,6 +181,7 @@ export type ConfigurationPlain = {
181
181
  baselineBranchName?: string;
182
182
  compareWithParentBranch?: boolean;
183
183
  ignoreBaseline?: boolean;
184
+ ignoreGitMergeBase?: boolean;
184
185
  saveFailedTests?: boolean;
185
186
  saveNewTests?: boolean;
186
187
  saveDiffs?: boolean;
@@ -313,6 +314,10 @@ export class Configuration implements Required<ConfigurationPlain> {
313
314
  set compareWithParentBranch(compareWithParentBranch: boolean);
314
315
  getCompareWithParentBranch(): boolean;
315
316
  setCompareWithParentBranch(compareWithParentBranch: boolean): Configuration;
317
+ get ignoreGitMergeBase(): boolean;
318
+ set ignoreGitMergeBase(ignoreGitMergeBase: boolean);
319
+ getIgnoreGitMergeBase(): boolean;
320
+ setIgnoreGitMergeBase(ignoreGitMergeBase: boolean): Configuration;
316
321
  get ignoreBaseline(): boolean;
317
322
  set ignoreBaseline(ignoreBaseline: boolean);
318
323
  getIgnoreBaseline(): boolean;
@@ -621,7 +626,7 @@ export enum CorsIframeHandle {
621
626
  KEEP = 'KEEP',
622
627
  SNAPSHOT = 'SNAPSHOT'
623
628
  }
624
- export type DeviceNamePlain = "Blackberry PlayBook" | "BlackBerry Z30" | "Galaxy A5" | "Galaxy Note 10" | "Galaxy Note 10 Plus" | "Galaxy Note 2" | "Galaxy Note 3" | "Galaxy Note 4" | "Galaxy Note 8" | "Galaxy Note 9" | "Galaxy S3" | "Galaxy S5" | "Galaxy S8" | "Galaxy S8 Plus" | "Galaxy S9" | "Galaxy S9 Plus" | "Galaxy S10" | "Galaxy S10 Plus" | "Galaxy S20" | "iPad" | "iPad 6th Gen" | "iPad 7th Gen" | "iPad Air 2" | "iPad Mini" | "iPad Pro" | "iPhone 11" | "iPhone 11 Pro" | "iPhone 11 Pro Max" | "iPhone 4" | "iPhone 5/SE" | "iPhone 6/7/8" | "iPhone 6/7/8 Plus" | "iPhone X" | "iPhone XR" | "iPhone XS" | "iPhone XS Max" | "Kindle Fire HDX" | "Laptop with HiDPI screen" | "Laptop with MDPI screen" | "Laptop with touch" | "LG G6" | "LG Optimus L70" | "Microsoft Lumia 550" | "Microsoft Lumia 950" | "Nexus 10" | "Nexus 4" | "Nexus 5" | "Nexus 5X" | "Nexus 6" | "Nexus 6P" | "Nexus 7" | "Nokia Lumia 520" | "Nokia N9" | "OnePlus 7T" | "OnePlus 7T Pro" | "Pixel 2" | "Pixel 2 XL" | "Pixel 3" | "Pixel 3 XL" | "Pixel 4" | "Pixel 4 XL" | "Pixel 5";
629
+ export type DeviceNamePlain = "Blackberry PlayBook" | "BlackBerry Z30" | "Galaxy A5" | "Galaxy Note 10" | "Galaxy Note 10 Plus" | "Galaxy Note 2" | "Galaxy Note 3" | "Galaxy Note 4" | "Galaxy Note 8" | "Galaxy Note 9" | "Galaxy S3" | "Galaxy S5" | "Galaxy S8" | "Galaxy S8 Plus" | "Galaxy S9" | "Galaxy S9 Plus" | "Galaxy S10" | "Galaxy S10 Plus" | "Galaxy S20" | "Galaxy Tab S7" | "iPad" | "iPad 6th Gen" | "iPad 7th Gen" | "iPad Air 2" | "iPad Mini" | "iPad Pro" | "iPhone 11" | "iPhone 11 Pro" | "iPhone 11 Pro Max" | "iPhone 4" | "iPhone 5/SE" | "iPhone 6/7/8" | "iPhone 6/7/8 Plus" | "iPhone X" | "iPhone XR" | "iPhone XS" | "iPhone XS Max" | "Kindle Fire HDX" | "Laptop with HiDPI screen" | "Laptop with MDPI screen" | "Laptop with touch" | "LG G6" | "LG Optimus L70" | "Microsoft Lumia 550" | "Microsoft Lumia 950" | "Nexus 10" | "Nexus 4" | "Nexus 5" | "Nexus 5X" | "Nexus 6" | "Nexus 6P" | "Nexus 7" | "Nokia Lumia 520" | "Nokia N9" | "OnePlus 7T" | "OnePlus 7T Pro" | "Pixel 2" | "Pixel 2 XL" | "Pixel 3" | "Pixel 3 XL" | "Pixel 4" | "Pixel 4 XL" | "Pixel 5";
625
630
  export enum DeviceName {
626
631
  Blackberry_PlayBook = 'Blackberry PlayBook',
627
632
  BlackBerry_Z30 = 'BlackBerry Z30',
@@ -642,6 +647,7 @@ export enum DeviceName {
642
647
  Galaxy_S10 = 'Galaxy S10',
643
648
  Galaxy_S10_Plus = 'Galaxy S10 Plus',
644
649
  Galaxy_S20 = 'Galaxy S20',
650
+ Galaxy_Tab_S7 = 'Galaxy Tab S7',
645
651
  iPad = 'iPad',
646
652
  iPad_6th_Gen = 'iPad 6th Gen',
647
653
  iPad_7th_Gen = 'iPad 7th Gen',
@@ -691,7 +697,7 @@ export enum FailureReport {
691
697
  IMMEDIATE = 'IMMEDIATE',
692
698
  ON_CLOSE = 'ON_CLOSE'
693
699
  }
694
- export type IosDeviceNamePlain = "iPhone 11" | "iPhone 11 Pro" | "iPhone 11 Pro Max" | "iPhone X" | "iPhone XR" | "iPhone 13 Pro Max" | "iPhone 13 Pro" | "iPhone 13" | "iPhone 12 Pro Max" | "iPhone 12 Pro" | "iPhone 12" | "iPhone 12 mini" | "iPhone Xs" | "iPhone 8" | "iPhone 7" | "iPad Pro (12.9-inch) (3rd generation)" | "iPad (7th generation)" | "iPad (9th generation)" | "iPad Air (2nd generation)";
700
+ export type IosDeviceNamePlain = "iPhone 11" | "iPhone 11 Pro" | "iPhone 11 Pro Max" | "iPhone X" | "iPhone XR" | "iPhone 13 Pro Max" | "iPhone 13 Pro" | "iPhone 13" | "iPhone 12 Pro Max" | "iPhone 12 Pro" | "iPhone 12" | "iPhone 12 mini" | "iPhone Xs" | "iPhone 8" | "iPhone 7" | "iPad Pro (12.9-inch) (3rd generation)" | "iPad (7th generation)" | "iPad (9th generation)" | "iPad Air (2nd generation)" | "iPad Air (4th generation)";
695
701
  export enum IosDeviceName {
696
702
  iPhone_13_Pro_Max = 'iPhone 13 Pro Max',
697
703
  iPhone_13_Pro = 'iPhone 13 Pro',
@@ -711,7 +717,8 @@ export enum IosDeviceName {
711
717
  iPad_Pro_3 = 'iPad Pro (12.9-inch) (3rd generation)',
712
718
  iPad_7 = 'iPad (7th generation)',
713
719
  iPad_9 = 'iPad (9th generation)',
714
- iPad_Air_2 = 'iPad Air (2nd generation)'
720
+ iPad_Air_2 = 'iPad Air (2nd generation)',
721
+ iPad_Air_4 = 'iPad Air (4th generation)'
715
722
  }
716
723
  export type IosVersionPlain = "latest" | "latest-1";
717
724
  export enum IosVersion {
@@ -825,7 +832,8 @@ export class BatchInfo implements Required<BatchInfoPlain> {
825
832
  set properties(properties: Array<PropertyDataPlain>);
826
833
  getProperties(): Array<PropertyData>;
827
834
  setProperties(properties: Array<PropertyDataPlain>): BatchInfo;
828
- addProperty(property: PropertyDataPlain): BatchInfo;
835
+ addProperty(name: string, value: string): BatchInfo;
836
+ addProperty(prop: PropertyDataPlain): BatchInfo;
829
837
  }
830
838
  export type CutProviderPlain = { top: number; right: number; bottom: number; left: number; } | { x: number; y: number; width: number; height: number; };
831
839
  export class CutProvider implements Required<{
@@ -1394,7 +1402,42 @@ export class Logger {
1394
1402
  fatal(...messages: Array<any>): void;
1395
1403
  open(): void;
1396
1404
  close(): void;
1397
- extend(label?: string, color?: string | Array<string>): Logger;
1405
+ extend(options?: Omit<{
1406
+ handler?: CustomLogHandlerPlain | FileLogHandlerPlain | ConsoleLogHandlerPlain | {
1407
+ type: "rolling file";
1408
+ dirname?: string;
1409
+ name?: string;
1410
+ maxFileLength?: number;
1411
+ maxFileNumber?: number;
1412
+ };
1413
+ format?: (message: any, options: {
1414
+ formatting?: boolean;
1415
+ label?: string;
1416
+ timestamp?: Date;
1417
+ level?: "silent" | "fatal" | "error" | "warn" | "info";
1418
+ tags?: Record<string, unknown>;
1419
+ color?: string | Array<string>;
1420
+ colors?: { timestamp?: string | Array<string>; level?: {
1421
+ silent?: string | Array<string>;
1422
+ fatal?: string | Array<string>;
1423
+ error?: string | Array<string>;
1424
+ warn?: string | Array<string>;
1425
+ info?: string | Array<string>;
1426
+ }; tags?: string | Array<string>; message?: string | Array<string>; };
1427
+ }) => string;
1428
+ label?: string;
1429
+ timestamp?: false;
1430
+ level?: number | ("silent" | "fatal" | "error" | "warn" | "info");
1431
+ colors?: boolean | { timestamp?: string | Array<string>; level?: {
1432
+ silent?: string | Array<string>;
1433
+ fatal?: string | Array<string>;
1434
+ error?: string | Array<string>;
1435
+ warn?: string | Array<string>;
1436
+ info?: string | Array<string>;
1437
+ }; tags?: string | Array<string>; message?: string | Array<string>; };
1438
+ console?: boolean | CustomLogHandlerPlain;
1439
+ }, "handler">): Logger;
1440
+ extend(label?: string): Logger;
1398
1441
  }
1399
1442
  export function closeBatch(spec: { closeBatches(options: { settings: { batchIds: Array<string>; serverUrl?: string; apiKey?: string; proxy?: ProxySettingsPlain; }; }): Promise<void>; }): (options: { batchIds: Array<string>; serverUrl?: string; apiKey?: string; proxy?: ProxySettingsPlain; }) => Promise<void>;
1400
1443
  export abstract class EyesRunner {