@applitools/driver
Advanced tools
Comparing version 1.7.1 to 1.7.2
@@ -171,6 +171,7 @@ "use strict"; | ||
else { | ||
const barsHeight = await ((_s = (_r = this._spec).getBarsHeight) === null || _s === void 0 ? void 0 : _s.call(_r, this.target).catch(() => undefined)); | ||
const barsHeight = await ((_s = (_r = this._spec).getBarsSize) === null || _s === void 0 ? void 0 : _s.call(_r, this.target).catch(() => undefined)); | ||
const displaySize = await this.getDisplaySize(); | ||
// calculate status and navigation bars sizes | ||
if (barsHeight) { | ||
const orientation = await this.getOrientation(); | ||
// when status bar is overlapping content on android it returns status bar height equal to viewport height | ||
@@ -180,3 +181,4 @@ if (this.isAndroid && barsHeight.statusBarHeight / this.pixelRatio < displaySize.height) { | ||
} | ||
this._driverInfo.navigationBarHeight = Math.max((_u = this._driverInfo.navigationBarHeight) !== null && _u !== void 0 ? _u : 0, barsHeight.navigationBarHeight); | ||
// android witches the width and height only for the navigationBar in landscape mode. | ||
this._driverInfo.navigationBarHeight = Math.max((_u = this._driverInfo.navigationBarHeight) !== null && _u !== void 0 ? _u : 0, orientation === 'landscape' ? barsHeight.navigationBarWidth : barsHeight.navigationBarHeight); | ||
} | ||
@@ -504,2 +506,8 @@ if (this.isAndroid) { | ||
} | ||
async setOrientation(orientation) { | ||
if (this.isWeb && !this.isMobile) | ||
return; | ||
await this._spec.setOrientation(this.target, orientation); | ||
this._logger.log('set device orientation:', orientation); | ||
} | ||
async getCookies() { | ||
@@ -506,0 +514,0 @@ var _a, _b, _c; |
{ | ||
"name": "@applitools/driver", | ||
"version": "1.7.1", | ||
"version": "1.7.2", | ||
"description": "Applitools universal framework wrapper", | ||
@@ -77,3 +77,3 @@ "keywords": [ | ||
"@applitools/snippets": "2.2.3", | ||
"@applitools/types": "1.3.1", | ||
"@applitools/types": "1.3.2", | ||
"@applitools/utils": "1.2.14" | ||
@@ -80,0 +80,0 @@ }, |
@@ -49,3 +49,3 @@ # Driver | ||
- [spec.getOrientation(driver)](#specgetorientationdriver) | ||
- [spec.getBarsHeight(driver)](#specgetbarsheightdriver) | ||
- [spec.getBarsSize(driver)](#specgetbarsSizedriver) | ||
- [spec.getElementRegion(driver, element)](#specgetelementregiondriver-element) | ||
@@ -437,3 +437,3 @@ - [spec.getElementAttribute(driver, element, attribute)](#specgetelementattributedriver-element-attribute) | ||
### spec.getBarsHeight(driver) | ||
### spec.getBarsSize(driver) | ||
TBD | ||
@@ -440,0 +440,0 @@ |
@@ -65,2 +65,3 @@ /// <reference types="node" /> | ||
getOrientation(): Promise<'portrait' | 'landscape'>; | ||
setOrientation(orientation: types.ScreenOrientation): Promise<void>; | ||
getCookies(): Promise<types.Cookie[]>; | ||
@@ -67,0 +68,0 @@ getTitle(): Promise<string>; |
190451
2956
+ Added@applitools/types@1.3.2(transitive)
- Removed@applitools/types@1.3.1(transitive)
Updated@applitools/types@1.3.2