From ede8b889fbd9e3bb4d6303256fb0e50bc36ab5ec Mon Sep 17 00:00:00 2001 From: yinjiacheng Date: Mon, 25 Sep 2023 19:28:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=A1=B5=E9=9D=A2=E6=88=AA?= =?UTF-8?q?=E5=9B=BE=E8=87=AA=E5=8A=A8=E5=8C=96=E6=B5=8B=E8=AF=95=E7=94=A8?= =?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 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pages/pages.test.js b/pages/pages.test.js index e7679897..7576892a 100755 --- a/pages/pages.test.js +++ b/pages/pages.test.js @@ -122,13 +122,13 @@ const pages = [ '/pages/template/swiper-vertical-video/swiper-vertical-video' ] +let page; describe('page screenshot test', () => { beforeAll(async () => { console.log("page screenshot test start"); - await program.reLaunch('/pages/tabBar/component'); }); beforeEach(async () => { - const page = await program.reLaunch(pages[pageIndex]); + page = await program.reLaunch(pages[pageIndex]); await page.waitFor(1000); }); afterEach(() => { @@ -140,7 +140,8 @@ describe('page screenshot test', () => { test.each(pages)('%s', async () => { const image = await program.screenshot({ fullPage: true - }) + }); expect(image).toMatchImageSnapshot(); + await page.waitFor(500); }) }) -- GitLab