diff --git a/pages/pages.test.js b/pages/pages.test.js index 69599f4b2f32a2f9bd60774b12f809ae17ada08d..7da590d47b7f18fc860c241b985975d3173105fb 100755 --- a/pages/pages.test.js +++ b/pages/pages.test.js @@ -178,16 +178,16 @@ describe("page screenshot test", () => { fullPage } if (!fullPage && !process.env.UNI_AUTOMATOR_APP_WEBVIEW) { + if (!windowInfo) { + windowInfo = await getWindowInfo() + page = await program.reLaunch(pages[pageIndex]); + await page.waitFor(1000); + } let offsetY = '0' if (process.env.uniTestPlatformInfo.toLocaleLowerCase().startsWith('android')) { - offsetY = '44' + offsetY = `${windowInfo.statusBarHeight + 44}` } if (process.env.uniTestPlatformInfo.toLocaleLowerCase().startsWith('ios')) { - if (!windowInfo) { - windowInfo = await getWindowInfo() - page = await program.reLaunch(pages[pageIndex]); - await page.waitFor(1000); - } offsetY = `${windowInfo.safeAreaInsets.top + 44}` } screenshotParams.offsetY = offsetY