@applitools/driver 1.19.6 → 1.20.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,28 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.20.0](https://github.com/Applitools-Dev/sdk/compare/js/driver@1.19.7...js/driver@1.20.0) (2024-11-12)
4
+
5
+
6
+ ### Features
7
+
8
+ * add an option to keep the navigation bar for android devices ([#2608](https://github.com/Applitools-Dev/sdk/issues/2608)) ([e7647e0](https://github.com/Applitools-Dev/sdk/commit/e7647e0105a7aa47e6bf3b20ab033f1e389ca849))
9
+
10
+ ## [1.19.7](https://github.com/Applitools-Dev/sdk/compare/js/driver@1.19.6...js/driver@1.19.7) (2024-11-07)
11
+
12
+
13
+ ### Dependencies
14
+
15
+ * @applitools/utils bumped to 1.7.5
16
+ #### Code Refactoring
17
+
18
+ * start linting "no-floating-promises" (wip) ([#2539](https://github.com/Applitools-Dev/sdk/issues/2539)) ([51b91cb](https://github.com/Applitools-Dev/sdk/commit/51b91cb15603f7d68e4bd6a16eb0f80e3f380295))
19
+ * @applitools/snippets bumped to 2.6.2
20
+ #### Bug Fixes
21
+
22
+ * provide a clear "stale element" exception message when passing detached regions to `check` ([#2590](https://github.com/Applitools-Dev/sdk/issues/2590)) ([1e5b49e](https://github.com/Applitools-Dev/sdk/commit/1e5b49e9aec6b8caf89f2cdb1f8e81a237d52896))
23
+ * @applitools/logger bumped to 2.0.19
24
+
25
+
3
26
  ## [1.19.6](https://github.com/Applitools-Dev/sdk/compare/js/driver@1.19.5...js/driver@1.19.6) (2024-10-31)
4
27
 
5
28
 
package/dist/driver.js CHANGED
@@ -305,7 +305,7 @@ class Driver {
305
305
  }
306
306
  return this._environment;
307
307
  }
308
- async getViewport() {
308
+ async getViewport({ keepNavigationBar } = {}) {
309
309
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
310
310
  var _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15;
311
311
  if (!this._viewport) {
@@ -342,9 +342,9 @@ class Driver {
342
342
  this._viewport.statusBarSize = Math.max((_g = this._viewport.statusBarSize) !== null && _g !== void 0 ? _g : 0, statusBarSize);
343
343
  }
344
344
  }
345
- if (navigationBar === null || navigationBar === void 0 ? void 0 : navigationBar.visible) {
345
+ if ((navigationBar === null || navigationBar === void 0 ? void 0 : navigationBar.visible) && !keepNavigationBar) {
346
346
  this._logger.log('Driver navigation size', navigationBar);
347
- // if navigation bar is placed on the right side is screen the the orientation is landscape-secondary
347
+ // if navigation bar is placed on the right side of the screen then the orientation is landscape-secondary
348
348
  if (navigationBar.x > 0)
349
349
  this._viewport.orientation = 'landscape-secondary';
350
350
  // navigation bar size could be its height or width depending on screen orientation
@@ -385,7 +385,7 @@ class Driver {
385
385
  if (!this._viewport.viewportSize) {
386
386
  this._viewport.viewportSize = { ...this._viewport.displaySize };
387
387
  this._viewport.viewportSize.height -= this._viewport.statusBarSize;
388
- if (environment.isAndroid) {
388
+ if (environment.isAndroid && !keepNavigationBar) {
389
389
  this._viewport.viewportSize[((_u = this._viewport.orientation) === null || _u === void 0 ? void 0 : _u.startsWith('landscape')) ? 'width' : 'height'] -=
390
390
  this._viewport.navigationBarSize;
391
391
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/driver",
3
- "version": "1.19.6",
3
+ "version": "1.20.0",
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.18",
77
- "@applitools/snippets": "2.6.1",
78
- "@applitools/utils": "1.7.4",
76
+ "@applitools/logger": "2.0.19",
77
+ "@applitools/snippets": "2.6.2",
78
+ "@applitools/utils": "1.7.5",
79
79
  "semver": "7.6.2"
80
80
  },
81
81
  "devDependencies": {
package/types/driver.d.ts CHANGED
@@ -71,7 +71,9 @@ export declare class Driver<T extends SpecType> {
71
71
  force?: boolean;
72
72
  }): Promise<string | undefined>;
73
73
  getEnvironment(): Promise<Environment>;
74
- getViewport(): Promise<Viewport>;
74
+ getViewport({ keepNavigationBar }?: {
75
+ keepNavigationBar?: boolean;
76
+ }): Promise<Viewport>;
75
77
  getFeatures(): Promise<Features>;
76
78
  getSessionId(): Promise<string | null>;
77
79
  getDriverUrl(): Promise<string | null>;