@applitools/eyes-webdriverio 5.40.2 → 5.41.1

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
@@ -10,6 +10,18 @@
10
10
 
11
11
 
12
12
 
13
+ ## 5.41.1 - 2023/2/6
14
+
15
+ ### Features
16
+ ### Bug fixes
17
+ - Fix instability when getting information to connect to the NML
18
+
19
+ ## 5.41.0 - 2023/2/1
20
+
21
+ ### Features
22
+ - Add NML support for Android
23
+ ### Bug fixes
24
+
13
25
  ## 5.40.2 - 2023/1/27
14
26
 
15
27
  ### Features
package/dist/legacy.js CHANGED
@@ -17,6 +17,7 @@ class By {
17
17
  static attributeValue(attr, value) {
18
18
  return new By(`*[${attr}="${value}"]`);
19
19
  }
20
+ // @ts-ignore
20
21
  static name(name) {
21
22
  return By.attributeValue('name', name);
22
23
  }
package/dist/service.js CHANGED
@@ -33,8 +33,10 @@ if (!process.env.APPLITOOLS_WEBDRIVERIO_MAJOR_VERSION) {
33
33
  process.env.APPLITOOLS_WEBDRIVERIO_MAJOR_VERSION = major;
34
34
  }
35
35
  catch {
36
+ // NOTE: ignore error
36
37
  }
37
38
  }
39
+ // TODO have to be removed
38
40
  const sdk = (0, core_1.makeCore)({
39
41
  agentId: `eyes-webdriverio-service/${require('../package.json').version}`,
40
42
  spec,
@@ -75,6 +77,7 @@ class EyesService {
75
77
  await this._eyesOpen();
76
78
  return this._eyes.check(title, checkSettings);
77
79
  });
80
+ // deprecated, alias of eyesCheck
78
81
  browser.addCommand('eyesCheckWindow', async (...args) => {
79
82
  return browser.eyesCheck(...args);
80
83
  });
@@ -88,6 +91,7 @@ class EyesService {
88
91
  this._eyes.getConfiguration().clearProperties();
89
92
  });
90
93
  browser.addCommand('eyesGetTestResults', async () => {
94
+ // because `afterTest` executes after `afterEach`, this is the way to get results in `afterEach` or `it`
91
95
  await this._eyesClose();
92
96
  return this._testResults;
93
97
  });
@@ -107,9 +111,9 @@ class EyesService {
107
111
  beforeTest(test) {
108
112
  var _a, _b, _c;
109
113
  const configuration = this._eyes.getConfiguration();
110
- configuration.setTestName((_a = test.title) !== null && _a !== void 0 ? _a : test.description);
114
+ configuration.setTestName((_a = test.title) !== null && _a !== void 0 ? _a : test.description); // test.title is for mocha, and test.description is for jasmine
111
115
  if (!this._appName) {
112
- configuration.setAppName((_b = test.parent) !== null && _b !== void 0 ? _b : (_c = test.fullName) === null || _c === void 0 ? void 0 : _c.replace(` ${test.description}`, ''));
116
+ configuration.setAppName((_b = test.parent) !== null && _b !== void 0 ? _b : (_c = test.fullName) === null || _c === void 0 ? void 0 : _c.replace(` ${test.description}`, '')); // test.parent is for mocha, and test.id is for jasmine
113
117
  }
114
118
  if (!configuration.getViewportSize()) {
115
119
  configuration.setViewportSize({ width: 800, height: 600 });
@@ -117,6 +121,8 @@ class EyesService {
117
121
  this._eyes.setConfiguration(configuration);
118
122
  }
119
123
  async afterTest() {
124
+ // the next line is required because if we set an element in one test, then the following test
125
+ // will say that the element is not attached to the page (because different browsers are used)
120
126
  this._eyes.getConfiguration().setScrollRootElement(null);
121
127
  await this._eyesClose();
122
128
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/eyes-webdriverio",
3
- "version": "5.40.2",
3
+ "version": "5.41.1",
4
4
  "description": "Applitools Eyes SDK for WebdriverIO",
5
5
  "keywords": [
6
6
  "eyes-webdriverio",
@@ -88,73 +88,54 @@
88
88
  "types"
89
89
  ],
90
90
  "scripts": {
91
- "lint": "eslint '**/*.ts'",
92
- "build": "ttsc --project tsconfig.build.v$([ ! -z $APPLITOOLS_WEBDRIVERIO_VERSION ] && echo ${APPLITOOLS_WEBDRIVERIO_VERSION%%.*} || echo 8).json",
91
+ "lint": "node ../../node_modules/.bin/eslint '**/*.ts'",
92
+ "build": "node ../../node_modules/.bin/ttsc --project tsconfig.build.v$([ ! -z $APPLITOOLS_WEBDRIVERIO_VERSION ] && echo ${APPLITOOLS_WEBDRIVERIO_VERSION%%.*} || echo 8).json",
93
93
  "generate:tests": "coverage-tests generate https://raw.githubusercontent.com/applitools/sdk.coverage.tests/universal-sdk/js/config.js --name 'eyes.webdriverio.javascript5'",
94
94
  "test": "yarn test:service && yarn test:coverage",
95
95
  "test:sanity": "echo 'create sanity suite'",
96
96
  "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",
97
- "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",
97
+ "test:coverage": "yarn generate:tests && APPLITOOLS_BATCH_NAME='JS Coverage Tests: eyes-webdriverio-5' APPLITOOLS_BATCH_ID=$(uuidgen) mocha --config .mocharc.cvg.js",
98
98
  "test:coverage:wd": "APPLITOOLS_WEBDRIVERIO_PROTOCOL=wd yarn test:coverage",
99
99
  "test:coverage:cdp": "APPLITOOLS_WEBDRIVERIO_PROTOCOL=cdp yarn test:coverage",
100
100
  "report": "coverage-tests report https://raw.githubusercontent.com/applitools/sdk.coverage.tests/master/js/config.js --name 'eyes.webdriverio.javascript5'",
101
101
  "setup": "yarn docker:setup",
102
- "docker:setup": "node ../scripts/scripts/generate-docker-compose-config.js && docker-compose up -d",
102
+ "docker:setup": "node ../../scripts/generate-docker-compose-config.js && docker-compose up -d",
103
103
  "docker:teardown": "docker-compose down",
104
104
  "upgrade:framework": "if [ ! -z $APPLITOOLS_WEBDRIVERIO_VERSION ]; then packagejson=`cat package.json`; NODE_VERSION=${NODE_VERSION:-$(node -v)} yarn upgrade --no-lockfile webdriverio@$APPLITOOLS_WEBDRIVERIO_VERSION webdriver@$APPLITOOLS_WEBDRIVERIO_VERSION @types/node@${NODE_VERSION%%.*}; echo \"$packagejson\" > package.json; fi",
105
105
  "deps": "bongo deps",
106
106
  "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)'",
107
- "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'",
107
+ "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 eyes-sdk-core visual-grid-client eyes-api spec-driver-webdriverio utils driver snippets screenshoter'",
108
108
  "gh:publish": "gh workflow run publish-webdriverio.yml --ref $(git rev-parse --abbrev-ref HEAD)",
109
- "preversion": "bongo preversion --verifyPendingChanges && yarn build",
109
+ "preversion": "bongo preversion --verifyPendingChanges",
110
110
  "version": "bongo version --withPendingChanges",
111
111
  "postversion": "bongo postversion"
112
112
  },
113
- "husky": {
114
- "hooks": {
115
- "pre-push": "yarn bongo lint"
116
- }
117
- },
118
113
  "dependencies": {
119
- "@applitools/core": "1.4.5",
120
- "@applitools/eyes-api": "1.13.0",
121
- "@applitools/spec-driver-webdriverio": "1.4.21"
114
+ "@applitools/core": "1.4.7",
115
+ "@applitools/eyes-api": "1.13.2",
116
+ "@applitools/spec-driver-webdriverio": "1.4.23"
122
117
  },
123
118
  "devDependencies": {
124
119
  "@applitools/api-extractor": "1.2.11",
125
120
  "@applitools/bongo": "^2.2.2",
126
- "@applitools/scripts": "1.2.0",
127
121
  "@applitools/sdk-coverage-tests": "^2.7.10",
128
- "@applitools/sdk-shared": "0.9.15",
129
- "@applitools/test-utils": "1.5.9",
122
+ "@applitools/test-utils": "1.5.12",
130
123
  "@types/mocha": "^9.1.1",
131
124
  "@types/node": "16",
132
- "@typescript-eslint/eslint-plugin": "^5.27.0",
133
- "@typescript-eslint/parser": "^5.27.0",
134
125
  "@wdio/cli": "^8.2.2",
135
126
  "@wdio/dot-reporter": "^8.0.14",
136
127
  "@wdio/globals": "^8.2.2",
137
128
  "@wdio/local-runner": "^8.2.2",
138
129
  "@wdio/mocha-framework": "^8.2.1",
139
130
  "chromedriver": "^109.0.0",
140
- "eslint": "^8.16.0",
141
- "eslint-config-prettier": "^8.5.0",
142
- "eslint-plugin-mocha-no-only": "^1.1.1",
143
- "eslint-plugin-node": "^11.1.0",
144
- "eslint-plugin-prettier": "^4.0.0",
145
131
  "expect-webdriverio": "^4.0.1",
146
132
  "geckodriver": "^1.20.0",
147
- "husky": "^4.3.8",
148
133
  "mocha": "^9.2.2",
149
- "prettier": "^2.6.2",
150
- "spec-xunit-file": "0.0.1-3",
151
- "ts-node": "^10.8.0",
152
- "ttypescript": "^1.5.13",
153
- "typescript": "^4.9.4",
134
+ "mocha-multi": "^1.1.7",
154
135
  "webdriverio": "^8.2.2"
155
136
  },
156
137
  "peerDependencies": {
157
- "webdriverio": "5.0.0 - 8.x.x"
138
+ "webdriverio": ">=5.0.0"
158
139
  },
159
140
  "engines": {
160
141
  "node": ">=12.13.0"
package/types/index.d.ts CHANGED
@@ -204,7 +204,7 @@ export type ConfigurationPlain = {
204
204
  disableBrowserFetching?: undefined | boolean;
205
205
  };
206
206
  export class Configuration implements Required<ConfigurationPlain> {
207
- constructor(config?: undefined | ConfigurationPlain, spec?: undefined | { isElement(element: any): element is Element; isSelector(selector: any): selector is Selector; });
207
+ constructor(config?: undefined | ConfigurationPlain, spec?: undefined | {});
208
208
  get appName(): string;
209
209
  set appName(appName: string);
210
210
  getAppName(): string;
@@ -249,7 +249,7 @@ export class Configuration implements Required<ConfigurationPlain> {
249
249
  set proxy(proxy: ProxySettingsPlain);
250
250
  getProxy(): ProxySettings;
251
251
  setProxy(proxy: ProxySettingsPlain): Configuration;
252
- setProxy(url: string, username?: undefined | string, password?: undefined | string, isHttpOnly?: undefined | boolean): Configuration;
252
+ setProxy(url: string, username?: undefined | string, password?: undefined | string, deprecatedIsHttpOnly?: undefined | boolean): Configuration;
253
253
  setProxy(isEnabled: false): Configuration;
254
254
  get autProxy(): ProxySettingsPlain & { mode?: undefined | "Allow" | "Block"; domains?: undefined | Array<string>; };
255
255
  set autProxy(autProxy: ProxySettingsPlain & { mode?: undefined | "Allow" | "Block"; domains?: undefined | Array<string>; });
@@ -435,7 +435,7 @@ export type CheckSettingsAutomationPlain = CheckSettingsImagePlain & {
435
435
  lazyLoad?: undefined | boolean | { scrollLength?: undefined | number; waitingTime?: undefined | number; maxAmountToScroll?: undefined | number; };
436
436
  };
437
437
  export class CheckSettingsAutomation {
438
- constructor(settings?: undefined | CheckSettingsAutomation | CheckSettingsAutomationPlain, spec?: undefined | { isElement(value: any): value is Element; isSelector(value: any): value is Selector; });
438
+ constructor(settings?: undefined | CheckSettingsAutomation | CheckSettingsAutomationPlain, spec?: undefined | {});
439
439
  region(region: RegionPlain | (Element | (string | Selector | { selector: string | Selector; type?: undefined | string; shadow?: undefined | EyesSelector<Selector>; frame?: undefined | EyesSelector<Selector>; }))): CheckSettingsAutomation;
440
440
  shadow(selector: string | Selector | { selector: string | Selector; type?: undefined | string; shadow?: undefined | EyesSelector<Selector>; frame?: undefined | EyesSelector<Selector>; }): CheckSettingsAutomation;
441
441
  frame(context: { frame: number | (Element | (string | Selector | { selector: string | Selector; type?: undefined | string; shadow?: undefined | EyesSelector<Selector>; frame?: undefined | EyesSelector<Selector>; })); scrollRootElement?: undefined | (Element | (string | Selector | { selector: string | Selector; type?: undefined | string; shadow?: undefined | EyesSelector<Selector>; frame?: undefined | EyesSelector<Selector>; })); }): CheckSettingsAutomation;
@@ -754,7 +754,7 @@ export enum TestResultsStatus {
754
754
  export class EyesError extends Error {
755
755
  }
756
756
  export class TestFailedError extends EyesError {
757
- constructor(message: string, results?: undefined | TestResultsPlain);
757
+ constructor(message: string, results: TestResultsPlain);
758
758
  constructor(results: TestResultsPlain);
759
759
  get testResults(): TestResultsPlain;
760
760
  getTestResults(): TestResults;
@@ -1196,10 +1196,10 @@ export class PropertyData implements Required<PropertyDataPlain> {
1196
1196
  getValue(): string;
1197
1197
  setValue(value: string): void;
1198
1198
  }
1199
- export type ProxySettingsPlain = { url: string; username?: undefined | string; password?: undefined | string; isHttpOnly?: undefined | boolean; };
1199
+ export type ProxySettingsPlain = { url: string; username?: undefined | string; password?: undefined | string; };
1200
1200
  export class ProxySettings implements Required<ProxySettingsPlain> {
1201
1201
  constructor(proxy: ProxySettingsPlain);
1202
- constructor(url: string, username?: undefined | string, password?: undefined | string, isHttpOnly?: undefined | boolean);
1202
+ constructor(url: string, username?: undefined | string, password?: undefined | string, deprecatedIsHttpOnly?: undefined | boolean);
1203
1203
  get url(): string;
1204
1204
  getUri(): string;
1205
1205
  getUrl(): string;
@@ -1426,7 +1426,7 @@ export class TestResults implements Required<TestResultsPlain> {
1426
1426
  isPassed(): boolean;
1427
1427
  delete(): Promise<void>;
1428
1428
  }
1429
- export type TestResultContainerPlain = { readonly exception: Error; readonly testResults: TestResultsPlain; readonly browserInfo: DesktopBrowserInfo | ChromeEmulationInfo | { deviceName: DeviceNamePlain; screenOrientation?: undefined | "landscape" | "portrait"; } | IOSDeviceInfo | AndroidDeviceInfo; };
1429
+ export type TestResultContainerPlain = { readonly exception?: undefined | Error; readonly testResults?: undefined | TestResultsPlain; readonly browserInfo?: undefined | (DesktopBrowserInfo | ChromeEmulationInfo | { deviceName: DeviceNamePlain; screenOrientation?: undefined | "landscape" | "portrait"; } | IOSDeviceInfo | AndroidDeviceInfo); };
1430
1430
  export class TestResultContainer implements Required<TestResultContainerPlain> {
1431
1431
  get testResults(): TestResultsPlain;
1432
1432
  getTestResults(): TestResults;
@@ -1482,7 +1482,7 @@ export class ClassicRunner extends EyesRunner {
1482
1482
  }
1483
1483
  export class VisualGridRunner extends EyesRunner {
1484
1484
  constructor(options?: undefined | RunnerOptionsPlain);
1485
- get testConcurrency(): number;
1485
+ get testConcurrency(): undefined | number;
1486
1486
  }
1487
1487
  export abstract class SessionEventHandler {
1488
1488
  abstract initStarted(): any;
@@ -1514,14 +1514,14 @@ export class RemoteSessionEventHandler extends SessionEventHandler {
1514
1514
  set serverUrl(serverUrl: string);
1515
1515
  getServerUrl(): string;
1516
1516
  setServerUrl(serverUrl: string): void;
1517
- get accessKey(): string;
1518
- set accessKey(accessKey: string);
1519
- getAccessKey(): string;
1517
+ get accessKey(): undefined | string;
1518
+ set accessKey(accessKey: undefined | string);
1519
+ getAccessKey(): undefined | string;
1520
1520
  setAccessKey(accessKey: string): void;
1521
- get timeout(): number;
1522
- set timeout(timeout: number);
1521
+ get timeout(): undefined | number;
1522
+ set timeout(timeout: undefined | number);
1523
1523
  setTimeout(timeout: number): void;
1524
- getTimeout(): number;
1524
+ getTimeout(): undefined | number;
1525
1525
  initStarted(): void;
1526
1526
  initEnded(): void;
1527
1527
  setSizeWillStart(): void;
@@ -1,4 +1,4 @@
1
- import { ConfigurationPlain } from './api';
1
+ import { ConfigurationPlain } from './index';
2
2
  interface EyesServiceOptions extends ConfigurationPlain {
3
3
  useVisualGrid?: boolean;
4
4
  concurrency?: number;