From 91d83f5bfb3931dcf02a8356886a2965e5898227 Mon Sep 17 00:00:00 2001 From: Anne_LXM Date: Thu, 22 Aug 2024 20:33:52 +0800 Subject: [PATCH] =?UTF-8?q?test(cover-view.test.js):=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E4=BE=8B=EF=BC=8C=E9=81=BF=E5=85=8D=E5=9C=B0?= =?UTF-8?q?=E5=9B=BE=E6=9C=AA=E6=B8=B2=E6=9F=93=E5=AE=8C=E6=88=90=E5=B0=B1?= =?UTF-8?q?=E6=88=AA=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/component/cover-view/cover-view.test.js | 24 +++++++++++++++++++ pages/component/cover-view/cover-view.uvue | 9 +++++++ pages/pages.test.js | 1 - 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 pages/component/cover-view/cover-view.test.js diff --git a/pages/component/cover-view/cover-view.test.js b/pages/component/cover-view/cover-view.test.js new file mode 100644 index 00000000..614df7a4 --- /dev/null +++ b/pages/component/cover-view/cover-view.test.js @@ -0,0 +1,24 @@ +let page; +describe('web-cover-view', () => { + if (!process.env.uniTestPlatformInfo.startsWith('web')) { + it('app', () => { + expect(1).toBe(1) + }) + return + } + beforeAll(async () => { + page = await program.reLaunch('/pages/component/cover-view/cover-view') + await page.waitFor('view'); + await page.waitFor('cover-view'); + await page.waitFor('cover-image'); + await page.waitFor('map'); + // 等待地图加载完成 + const waitTime = process.env.uniTestPlatformInfo.includes('firefox') ? 5000:3000 + await page.waitFor(waitTime) + }); + + it('screenshot', async () => { + expect(await program.screenshot()).toSaveImageSnapshot(); + }); + +}); diff --git a/pages/component/cover-view/cover-view.uvue b/pages/component/cover-view/cover-view.uvue index 4ddb0b95..67c254df 100644 --- a/pages/component/cover-view/cover-view.uvue +++ b/pages/component/cover-view/cover-view.uvue @@ -1,6 +1,9 @@