From ed052cd8bde68ae5076be4ecf0562970d303690f Mon Sep 17 00:00:00 2001 From: zhenyuWang <13641039885@163.com> Date: Mon, 20 Nov 2023 12:10:49 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E4=BC=98=E5=8C=96=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/pages.test.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/pages/pages.test.js b/pages/pages.test.js index ad9a6936..0b5d1268 100755 --- a/pages/pages.test.js +++ b/pages/pages.test.js @@ -125,19 +125,20 @@ const pages = [ '/pages/API/element-draw/element-draw', ] -const needLoadingNetworkResourcesPages = [ - "/pages/CSS/text/font-family", - "/pages/template/list-news/list-news", +const needDelayPages = [ + "/pages/CSS/text/font-family", // load network font + "/pages/template/list-news/list-news", // load network image + "/pages/component/list-view/list-view", // delay wait scroll to disappear ]; let page; -describe('page screenshot test', () => { +describe("page screenshot test", () => { beforeAll(async () => { console.log("page screenshot test start"); }); beforeEach(async () => { page = await program.reLaunch(pages[pageIndex]); - if (needLoadingNetworkResourcesPages.includes(pages[pageIndex])) { + if (needDelayPages.includes(pages[pageIndex])) { await page.waitFor(2000); } await page.waitFor(1000); @@ -148,11 +149,11 @@ describe('page screenshot test', () => { afterAll(() => { console.log("page screenshot test finish"); }); - test.each(pages)('%s', async () => { + test.each(pages)("%s", async () => { const image = await program.screenshot({ - fullPage: true + fullPage: true, }); expect(image).toMatchImageSnapshot(); await page.waitFor(500); - }) -}) + }); +}); -- GitLab