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

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

上级 41fca744
...@@ -122,13 +122,13 @@ const pages = [ ...@@ -122,13 +122,13 @@ const pages = [
'/pages/template/swiper-vertical-video/swiper-vertical-video' '/pages/template/swiper-vertical-video/swiper-vertical-video'
] ]
let page;
describe('page screenshot test', () => { describe('page screenshot test', () => {
beforeAll(async () => { beforeAll(async () => {
console.log("page screenshot test start"); console.log("page screenshot test start");
await program.reLaunch('/pages/tabBar/component');
}); });
beforeEach(async () => { beforeEach(async () => {
const page = await program.reLaunch(pages[pageIndex]); page = await program.reLaunch(pages[pageIndex]);
await page.waitFor(1000); await page.waitFor(1000);
}); });
afterEach(() => { afterEach(() => {
...@@ -140,7 +140,8 @@ describe('page screenshot test', () => { ...@@ -140,7 +140,8 @@ describe('page screenshot test', () => {
test.each(pages)('%s', async () => { test.each(pages)('%s', async () => {
const image = await program.screenshot({ const image = await program.screenshot({
fullPage: true fullPage: true
}) });
expect(image).toMatchImageSnapshot(); expect(image).toMatchImageSnapshot();
await page.waitFor(500);
}) })
}) })
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册