提交 31f368eb 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

test(pages.test.js): 优化 android 端截图

上级 cb796fa4
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册