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 0000000000000000000000000000000000000000..614df7a4cb89b77370ef5baa8df3085fe7f809dd --- /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 4ddb0b95f8e6cdc3d050e8d64b066550a17a883b..67c254df0e04a6adda731e4af16d6412f22b7621 100644 --- a/pages/component/cover-view/cover-view.uvue +++ b/pages/component/cover-view/cover-view.uvue @@ -1,6 +1,9 @@