提交 2c2e1c13 编写于 作者: Anne_LXM's avatar Anne_LXM

test(cover-view.test.js): 新增测试例,避免地图未渲染完成就截图

上级 f95bf7a1
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();
});
});
<template>
<view>
<page-head title="cover-view用于覆盖map、video等原生组件"></page-head>
<view class="uni-padding-wrap uni-common-mb">
<text class="uni-subtitle-text">注意:需要正确配置地图服务商的Key才能正常显示地图组件</text>
</view>
<view class="cover-content">
<map :latitude="latitude" :longitude="longitude"></map>
<cover-view class="cover-view">简单的cover-view</cover-view>
......@@ -53,4 +56,10 @@
width: 96px;
height: 96px;
}
.tips {
font-size: 12px;
margin-top: 15px;
opacity: .8;
}
</style>
......@@ -318,7 +318,6 @@ if (isWeb) {
'/pages/component/label/label',
'/pages/component/picker/picker',
'/pages/component/map/map',
'/pages/component/cover-view/cover-view',
'/pages/component/editor/editor',
'/pages/API/get-image-info/get-image-info',
'/pages/API/get-video-info/get-video-info',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册