@applitools/driver
Advanced tools
Comparing version 1.5.6 to 1.5.7
@@ -381,7 +381,9 @@ "use strict"; | ||
} | ||
async normalizeRegion(region) { | ||
async normalizeRegion(region, shouldIgnoreSafeRegion) { | ||
if (this.isWeb || !utils.types.has(this._driverInfo, ['viewportSize', 'statusBarHeight'])) | ||
return region; | ||
const scaledRegion = this.isAndroid ? utils.geometry.scale(region, 1 / this.pixelRatio) : region; | ||
const safeRegion = this.isIOS ? utils.geometry.intersect(scaledRegion, this._driverInfo.safeArea) : scaledRegion; | ||
const safeRegion = this.isIOS && !shouldIgnoreSafeRegion | ||
? utils.geometry.intersect(scaledRegion, this._driverInfo.safeArea) | ||
: scaledRegion; | ||
const offsetRegion = utils.geometry.offsetNegative(safeRegion, { x: 0, y: this.statusBarHeight }); | ||
@@ -388,0 +390,0 @@ if (offsetRegion.y < 0) { |
@@ -109,3 +109,3 @@ "use strict"; | ||
} | ||
async getRegion() { | ||
async getRegion(shouldIgnoreSafeRegion) { | ||
const region = await this.withRefresh(async () => { | ||
@@ -120,3 +120,3 @@ if (this.driver.isWeb) { | ||
this._logger.log('Extracted native region', region); | ||
return this.driver.normalizeRegion(region); | ||
return this.driver.normalizeRegion(region, shouldIgnoreSafeRegion); | ||
} | ||
@@ -123,0 +123,0 @@ }); |
{ | ||
"name": "@applitools/driver", | ||
"version": "1.5.6", | ||
"version": "1.5.7", | ||
"description": "Applitools universal framework wrapper", | ||
@@ -77,3 +77,3 @@ "keywords": [ | ||
"@applitools/snippets": "2.2.2", | ||
"@applitools/types": "1.2.2", | ||
"@applitools/types": "1.3.0", | ||
"@applitools/utils": "1.2.13" | ||
@@ -80,0 +80,0 @@ }, |
@@ -53,3 +53,3 @@ /// <reference types="node" /> | ||
switchToChildContext(...references: ContextReference<TDriver, TContext, TElement, TSelector>[]): Promise<Context<TDriver, TContext, TElement, TSelector>>; | ||
normalizeRegion(region: types.Region): Promise<types.Region>; | ||
normalizeRegion(region: types.Region, shouldIgnoreSafeRegion?: boolean): Promise<types.Region>; | ||
getRegionInViewport(context: Context<TDriver, TContext, TElement, TSelector>, region: types.Region): Promise<types.Region>; | ||
@@ -56,0 +56,0 @@ element(selector: types.Selector<TSelector>): Promise<Element<TDriver, TContext, TElement, TSelector>>; |
@@ -34,3 +34,3 @@ import type * as types from '@applitools/types'; | ||
init(context: Context<TDriver, TContext, TElement, TSelector>): Promise<this>; | ||
getRegion(): Promise<types.Region>; | ||
getRegion(shouldIgnoreSafeRegion?: boolean): Promise<types.Region>; | ||
getClientRegion(): Promise<types.Region>; | ||
@@ -37,0 +37,0 @@ getContentSize(): Promise<types.Size>; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
188742
2921
+ Added@applitools/types@1.3.0(transitive)
- Removed@applitools/types@1.2.2(transitive)
Updated@applitools/types@1.3.0