提交 2774843b 编写于 作者: DCloud-yinjiacheng's avatar DCloud-yinjiacheng

更新页面截图自动化测试用例

上级 6668d608
...@@ -135,6 +135,12 @@ if (process.env.uniTestPlatformInfo.startsWith('android')) { ...@@ -135,6 +135,12 @@ if (process.env.uniTestPlatformInfo.startsWith('android')) {
) )
} }
// 设置position: fixed的页面不能截取完整内容
const notFullPages = [
'/pages/CSS/layout/position',
'/pages/CSS/layout/z-index'
]
let page; let page;
describe("page screenshot test", () => { describe("page screenshot test", () => {
beforeAll(async () => { beforeAll(async () => {
...@@ -152,9 +158,13 @@ describe("page screenshot test", () => { ...@@ -152,9 +158,13 @@ describe("page screenshot test", () => {
}); });
test.each(pages)("%s", async () => { test.each(pages)("%s", async () => {
console.log("Taking screenshot: ", pageIndex, pages[pageIndex]); console.log("Taking screenshot: ", pageIndex, pages[pageIndex]);
let fullPage = true;
if (notFullPages.includes(pages[pageIndex])) {
fullPage = false;
}
const image = await program.screenshot({ const image = await program.screenshot({
fullPage: true, fullPage: fullPage
}); });
expect(image).toMatchImageSnapshot(); expect(image).toMatchImageSnapshot();
await page.waitFor(500); await page.waitFor(500);
}); });
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册