@applitools/eyes-webdriverio 5.34.6 → 5.34.10

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,27 @@
3
3
  ## Unreleased
4
4
 
5
5
 
6
+ ## 5.34.10 - 2022/1/24
7
+
8
+ - Fixed BatchInfo.addProperty bug
9
+ - updated to @applitools/eyes-api@1.1.7 (from 1.1.6)
10
+ - updated to @applitools/eyes-sdk-core@13.0.0 (from 12.24.13)
11
+ - updated to @applitools/visual-grid-client@15.8.62 (from 15.8.60)
12
+
13
+ ## 5.34.9 - 2022/1/12
14
+
15
+ - updated to @applitools/eyes-sdk-core@12.24.13 (from 12.24.12)
16
+ - updated to @applitools/visual-grid-client@15.8.60 (from 15.8.59)
17
+
18
+ ## 5.34.8 - 2022/1/11
19
+
20
+ - updated to @applitools/eyes-sdk-core@12.24.12 (from 12.24.9)
21
+ - updated to @applitools/visual-grid-client@15.8.59 (from 15.8.55)
22
+
23
+ ## 5.34.7 - 2022/1/5
24
+
25
+ - updated to @applitools/spec-driver-webdriverio@1.2.6 (from 1.2.5)
26
+
6
27
  ## 5.34.6 - 2021/12/23
7
28
 
8
29
  - updated to @applitools/eyes-sdk-core@12.24.9 (from 12.24.7)
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.6",
3
+ "version": "5.34.10",
4
4
  "description": "Applitools Eyes SDK for WebdriverIO",
5
5
  "keywords": [
6
6
  "eyes-webdriverio",
@@ -85,7 +85,7 @@
85
85
  "scripts": {
86
86
  "lint": "eslint '**/*.ts'",
87
87
  "build": "ttsc --project tsconfig$([ ! -z $APPLITOOLS_WEBDRIVERIO_MAJOR_VERSION ] && echo .v$APPLITOOLS_WEBDRIVERIO_MAJOR_VERSION).json",
88
- "generate:tests": "coverage-tests generate https://raw.githubusercontent.com/applitools/sdk.coverage.tests/master/js/config.js --name 'eyes.webdriverio.javascript5'",
88
+ "generate:tests": "coverage-tests generate https://raw.githubusercontent.com/applitools/sdk.coverage.tests/universal-sdk/js/config.js --name 'eyes.webdriverio.javascript5' --tests https://raw.githubusercontent.com/applitools/sdk.coverage.tests/default-window-fully-true/coverage-tests.js",
89
89
  "test": "yarn test:service && yarn test:coverage",
90
90
  "test:service": "mocha ./test/service/unit/*.spec.js && wdio run ./test/service/wdio.conf.js && wdio run ./test/service/no-config/wdio.no-config.conf.js && wdio run ./test/service/vg/wdio.vg.conf.js",
91
91
  "test:coverage": "yarn generate:tests && APPLITOOLS_BATCH_NAME='JS Coverage Tests: eyes-webdriverio-5' APPLITOOLS_BATCH_ID=$(uuidgen) XUNIT_FILE=coverage-test-report.xml mocha --config .mocharc.cvg.js",
@@ -95,9 +95,11 @@
95
95
  "setup": "yarn docker:setup",
96
96
  "docker:setup": "node ../scripts/scripts/generate-docker-compose-config.js && docker-compose up -d",
97
97
  "docker:teardown": "docker-compose down",
98
+ "upgrade:framework": "if [ ! -z $APPLITOOLS_WEBDRIVERIO_MAJOR_VERSION ]; then packagejson=`cat package.json`; yarn upgrade --no-lockfile webdriverio@$APPLITOOLS_WEBDRIVERIO_MAJOR_VERSION; echo \"$packagejson\" > package.json; fi",
98
99
  "deps": "bongo deps",
99
- "gh:test": "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",
100
- "gh:publish": "gh workflow run publish.yml --ref $(git rev-parse --abbrev-ref HEAD) -f packages='wdio'",
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
+ "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-webdriverio.yml --ref $(git rev-parse --abbrev-ref HEAD)",
101
103
  "preversion": "bongo preversion && yarn build",
102
104
  "version": "bongo version",
103
105
  "postversion": "bongo postversion"
@@ -108,18 +110,18 @@
108
110
  }
109
111
  },
110
112
  "dependencies": {
111
- "@applitools/eyes-api": "1.1.6",
112
- "@applitools/eyes-sdk-core": "12.24.9",
113
- "@applitools/spec-driver-webdriverio": "1.2.5",
114
- "@applitools/visual-grid-client": "15.8.55"
113
+ "@applitools/eyes-api": "1.1.7",
114
+ "@applitools/eyes-sdk-core": "13.0.0",
115
+ "@applitools/spec-driver-webdriverio": "1.2.6",
116
+ "@applitools/visual-grid-client": "15.8.62"
115
117
  },
116
118
  "devDependencies": {
117
- "@applitools/api-extractor": "1.2.3",
118
- "@applitools/scripts": "1.0.1",
119
- "@applitools/sdk-coverage-tests": "^2.3.16",
120
- "@applitools/sdk-release-kit": "^0.13.4",
119
+ "@applitools/api-extractor": "1.2.7",
120
+ "@applitools/scripts": "1.1.0",
121
+ "@applitools/sdk-coverage-tests": "^2.3.18",
122
+ "@applitools/sdk-release-kit": "^0.13.11",
121
123
  "@applitools/sdk-shared": "0.9.11",
122
- "@applitools/test-utils": "1.0.10",
124
+ "@applitools/test-utils": "1.0.11",
123
125
  "@types/mocha": "^9.0.0",
124
126
  "@typescript-eslint/eslint-plugin": "^4.15.1",
125
127
  "@typescript-eslint/parser": "^4.15.1",
@@ -127,7 +129,6 @@
127
129
  "@wdio/dot-reporter": "^7.16.4",
128
130
  "@wdio/local-runner": "^7.16.5",
129
131
  "@wdio/mocha-framework": "^7.16.4",
130
- "@wdio/types": "^7.16.11",
131
132
  "chromedriver": "^95.0.0",
132
133
  "eslint": "^7.9.0",
133
134
  "eslint-config-prettier": "^7.2.0",
@@ -136,12 +137,12 @@
136
137
  "eslint-plugin-prettier": "^3.3.1",
137
138
  "geckodriver": "^1.20.0",
138
139
  "husky": "^4.3.8",
139
- "mocha": "^8.0.1",
140
+ "mocha": "^9.1.3",
140
141
  "prettier": "^2.1.2",
141
142
  "spec-xunit-file": "0.0.1-3",
142
143
  "ts-node": "^10.2.1",
143
144
  "ttypescript": "^1.5.12",
144
- "typescript": "^4.5.1-rc",
145
+ "typescript": "^4.5.5",
145
146
  "webdriverio": "^7.16.12"
146
147
  },
147
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 {