File tree Expand file tree Collapse file tree 4 files changed +18
-7
lines changed Expand file tree Collapse file tree 4 files changed +18
-7
lines changed Original file line number Diff line number Diff line change 1+ <a name =" 6.1.2 " ></a >
2+ ## [ 6.1.2] ( https://github.com/NativeScript/nativescript-dev-appium/compare/6.1.0...6.1.2 ) (2019-10-04)
3+
4+
5+ ### Bug Fixes
6+
7+ * ** ios-13:** remove statusbar height from viewportRect ([ c1a993c] ( https://github.com/NativeScript/nativescript-dev-appium/commit/c1a993c ) )
8+
9+
10+
111<a name =" 6.1.0 " ></a >
212# [ 6.1.0] ( https://github.com/NativeScript/nativescript-dev-appium/compare/6.0.0...6.1.0 ) (2019-10-03)
313
Original file line number Diff line number Diff line change @@ -272,7 +272,7 @@ export class AppiumDriver {
272272 logInfo ( "Current version of appium doesn't support appium settings!" ) ;
273273 }
274274
275- await DeviceManager . applyDeviceAdditionsSettings ( driver , args , appiumCapsFromConfig ) ;
275+ await DeviceManager . applyDeviceAdditionsSettings ( driver , args , sessionInfoDetails ) ;
276276
277277 hasStarted = true ;
278278 } catch ( error ) {
@@ -322,7 +322,8 @@ export class AppiumDriver {
322322 const matches = devicesInfos . filter ( d => sessionInfoDetails . deviceName . includes ( d . deviceType ) ) ;
323323 if ( matches && matches . length > 0 ) {
324324 const deviceType = matches [ matches . length - 1 ] ;
325- args . device . viewportRect . y += deviceType . actionBarHeight * deviceType . density ;
325+ args . device . viewportRect . y += deviceType . actionBarHeight ;
326+ args . device . viewportRect . height -= deviceType . actionBarHeight ;
326327 }
327328 } catch ( error ) { }
328329 }
Original file line number Diff line number Diff line change @@ -202,7 +202,7 @@ export class DeviceManager implements IDeviceManager {
202202 args . device . config = { "density" : args . device . deviceScreenDensity || args . device . config . density , "offsetPixels" : + sessionInfoDetails . statBarHeight || args . device . config . offsetPixels } ;
203203 } else {
204204 args . device . apiLevel = sessionInfoDetails . platformVersion ;
205- args . device . deviceScreenDensity = sessionInfoDetails . pixelRatio ;
205+ args . device . deviceScreenDensity = sessionInfoDetails . pixelRatio || args . device . config . density ;
206206 const offsetPixels = + sessionInfoDetails . viewportRect . top - + sessionInfoDetails . statBarHeight ;
207207 args . device . config = { "density" : sessionInfoDetails . pixelRatio || args . device . config . density , "offsetPixels" : isNumber ( offsetPixels ) ? offsetPixels : args . device . config . offsetPixels } ;
208208 }
@@ -272,11 +272,11 @@ export class DeviceManager implements IDeviceManager {
272272 // }
273273
274274 public static async applyDeviceAdditionsSettings ( driver , args : INsCapabilities , sessionInfo : any ) {
275- if ( ( ! args . device . viewportRect || ! args . device . viewportRect . x ) && ( ! args . device . config || ! args . device . config . offsetPixels ) ) {
275+ if ( ( ! args . device . viewportRect || ! args . device . viewportRect . x ) && ( ! args . device . config || ! isNumber ( args . device . config . offsetPixels ) ) ) {
276276 args . device . config = { } ;
277277 let density : number ;
278- if ( sessionInfo && sessionInfo . length >= 1 ) {
279- density = sessionInfo [ 1 ] . deviceScreenDensity ? sessionInfo [ 1 ] . deviceScreenDensity / 100 : undefined ;
278+ if ( sessionInfo && Object . getOwnPropertyNames ( sessionInfo ) . length >= 1 ) {
279+ density = sessionInfo . pixelRatio ? sessionInfo . pixelRatio : undefined ;
280280 }
281281
282282 if ( density ) {
Original file line number Diff line number Diff line change @@ -268,7 +268,7 @@ export class UIElement {
268268 */
269269 public async getActualRectangle ( ) {
270270 const actRect = await this . getRectangle ( ) ;
271- const density = this . _args . device . config . density ;
271+ const density = this . _args . device . deviceScreenDensity ;
272272 if ( this . _args . isIOS ) {
273273 if ( density ) {
274274 actRect . x *= density ;
You can’t perform that action at this time.
0 commit comments