From 89ddf24fd442889719c45987322b170f8068b7b8 Mon Sep 17 00:00:00 2001 From: Pankaj Yadav Date: Tue, 5 Sep 2023 16:31:43 +0530 Subject: [PATCH] Fix Status bar height and update test (#166) --- percy/providers/appAutomateProvider.js | 6 +++--- test/percy/providers/appAutomateProvider.test.mjs | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/percy/providers/appAutomateProvider.js b/percy/providers/appAutomateProvider.js index a547fb9..8e03c89 100644 --- a/percy/providers/appAutomateProvider.js +++ b/percy/providers/appAutomateProvider.js @@ -148,9 +148,9 @@ class AppAutomateProvider extends GenericProvider { JSON.parse(response.result).forEach(tileData => { tiles.push(new Tile({ - statBarHeight, - navBarHeight, - fullscreen, + statusBarHeight: statBarHeight, + navBarHeight: navBarHeight, + fullscreen: fullscreen, headerHeight: tileData.header_height, footerHeight: tileData.footer_height, sha: tileData.sha.split('-')[0] // drop build id diff --git a/test/percy/providers/appAutomateProvider.test.mjs b/test/percy/providers/appAutomateProvider.test.mjs index c7a3124..4a51322 100644 --- a/test/percy/providers/appAutomateProvider.test.mjs +++ b/test/percy/providers/appAutomateProvider.test.mjs @@ -153,7 +153,9 @@ describe('AppAutomateProvider', () => { args['options']['deviceHeight'] = screenSize['height']; appAutomate.metadata = { statusBarHeight: () => 100, navigationBarHeight: () => 200, scaleFactor: () => 1, screenSize: () => screenSize }; - await appAutomate.getTiles(true, false, null, null, null); + let tiles = await appAutomate.getTiles(true, false, null, null, null); + expect(tiles[0].statusBarHeight).toEqual(100); + expect(tiles[0].navBarHeight).toEqual(200); expect(browserstack_executorSpy).toHaveBeenCalledWith('percyScreenshot', args); }); });