@applitools/driver 1.16.6 → 1.17.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
@@ -1,5 +1,24 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.17.1](https://github.com/Applitools-Dev/sdk/compare/js/driver@1.17.0...js/driver@1.17.1) (2024-04-22)
4
+
5
+
6
+ ### Dependencies
7
+
8
+ * @applitools/utils bumped to 1.7.2
9
+ #### Bug Fixes
10
+
11
+ * trigger release ([88ba29f](https://github.com/Applitools-Dev/sdk/commit/88ba29f358620a5c0f0861eb31e8929d0b611284))
12
+ * @applitools/logger bumped to 2.0.16
13
+
14
+
15
+ ## [1.17.0](https://github.com/Applitools-Dev/sdk/compare/js/driver@1.16.6...js/driver@1.17.0) (2024-04-22)
16
+
17
+
18
+ ### Features
19
+
20
+ * report batchId and batchUrl to kobiton ([#2329](https://github.com/Applitools-Dev/sdk/issues/2329)) ([5be4356](https://github.com/Applitools-Dev/sdk/commit/5be4356d7f3cd96b70491325d4a788202c06720a))
21
+
3
22
  ## [1.16.6](https://github.com/Applitools-Dev/sdk/compare/js/driver@1.16.5...js/driver@1.16.6) (2024-04-15)
4
23
 
5
24
 
package/dist/driver.js CHANGED
@@ -277,8 +277,9 @@ class Driver {
277
277
  this._environment.isMobile = true;
278
278
  this._environment.isEmulation = true;
279
279
  }
280
- this._environment.isEC =
281
- this._environment.isECClient || /exec-wus.applitools.com/.test((_d = (await this.getDriverUrl())) !== null && _d !== void 0 ? _d : '');
280
+ const driverUrl = (_d = (await this.getDriverUrl())) !== null && _d !== void 0 ? _d : '';
281
+ this._environment.isEC = this._environment.isECClient || /exec-wus.applitools.com/.test(driverUrl);
282
+ this._environment.isKobiton = /kobiton/.test(driverUrl);
282
283
  this._logger.log('Extracted environment', this._environment);
283
284
  }
284
285
  return this._environment;
@@ -867,8 +868,6 @@ async function makeDriver(options) {
867
868
  let driver;
868
869
  if (options.driver instanceof Driver) {
869
870
  driver = options.driver;
870
- if (options.relaxed)
871
- return driver;
872
871
  }
873
872
  else {
874
873
  options.driver = (_c = (await ((_b = (_a = options.spec) === null || _a === void 0 ? void 0 : _a.toDriver) === null || _b === void 0 ? void 0 : _b.call(_a, options.driver)))) !== null && _c !== void 0 ? _c : options.driver;
@@ -23,7 +23,7 @@ const DEFAULT_PROPS = {
23
23
  };
24
24
  class MockDriver {
25
25
  constructor(options = {}) {
26
- const { viewport = { width: 1000, height: 1000 }, device, platform, browser, ua } = options;
26
+ const { viewport = { width: 1000, height: 1000 }, device, platform, browser, ua, driverServerUrl } = options;
27
27
  this._device = device;
28
28
  this._platform = platform;
29
29
  this._browser = browser;
@@ -33,6 +33,7 @@ class MockDriver {
33
33
  url: 'http://default.url',
34
34
  rect: { x: 0, y: 0, ...viewport },
35
35
  };
36
+ this._driverServerUrl = driverServerUrl;
36
37
  this._methods = new Map();
37
38
  this._scripts = new Map();
38
39
  this._elements = new Map();
@@ -262,6 +263,9 @@ class MockDriver {
262
263
  browserVersion: this._browser ? this._browser.version : null,
263
264
  };
264
265
  }
266
+ get driverServerUrl() {
267
+ return this._driverServerUrl;
268
+ }
265
269
  async executeScript(script, args = []) {
266
270
  if (this.environment.isNative)
267
271
  throw new Error("Native context doesn't support this method");
@@ -106,7 +106,7 @@ async function takeScreenshot(driver) {
106
106
  }
107
107
  exports.takeScreenshot = takeScreenshot;
108
108
  async function getDriverInfo(driver) {
109
- return { environment: driver.environment };
109
+ return { environment: driver.environment, driverServerUrl: driver.driverServerUrl };
110
110
  }
111
111
  exports.getDriverInfo = getDriverInfo;
112
112
  async function getWindowSize(driver) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/driver",
3
- "version": "1.16.6",
3
+ "version": "1.17.1",
4
4
  "description": "Applitools universal framework wrapper",
5
5
  "keywords": [
6
6
  "applitools",
@@ -73,9 +73,9 @@
73
73
  "test": "run --top-level mocha './test/**/*.spec.ts'"
74
74
  },
75
75
  "dependencies": {
76
- "@applitools/logger": "2.0.15",
76
+ "@applitools/logger": "2.0.16",
77
77
  "@applitools/snippets": "2.4.25",
78
- "@applitools/utils": "1.7.1",
78
+ "@applitools/utils": "1.7.2",
79
79
  "semver": "7.5.4"
80
80
  },
81
81
  "devDependencies": {
package/types/driver.d.ts CHANGED
@@ -95,7 +95,6 @@ export declare function makeDriver<T extends SpecType>(options: {
95
95
  useCeilForViewportSize?: boolean;
96
96
  };
97
97
  reset?: boolean;
98
- relaxed?: boolean;
99
98
  logger?: Logger;
100
99
  }): Promise<Driver<T>>;
101
100
  export {};
@@ -23,6 +23,7 @@ export declare class MockDriver {
23
23
  browserName: any;
24
24
  browserVersion: any;
25
25
  };
26
+ get driverServerUrl(): any;
26
27
  executeScript(script: any, args?: never[]): Promise<any>;
27
28
  findElement(selector: any, rootElement?: any): Promise<any>;
28
29
  findElements(selector: any, rootElement?: any): Promise<any>;
package/types/types.d.ts CHANGED
@@ -49,6 +49,7 @@ export type Environment = {
49
49
  isIOS?: boolean;
50
50
  isMac?: boolean;
51
51
  isWindows?: boolean;
52
+ isKobiton?: boolean;
52
53
  };
53
54
  export type Viewport = {
54
55
  displaySize?: Size;