提交 553e6db2 编写于 作者: DCloud-yinjiacheng's avatar DCloud-yinjiacheng

更新image自动化测试用例

上级 4861d88d
......@@ -30,6 +30,23 @@ describe('component-native-image', () => {
expect(await page.data('loadError')).toBe(true)
})
it('check-cookie', async () => {
await page.setData({
autoTest: true,
setCookieImage: 'https://cdn.dcloud.net.cn/img/shadow-grey.png'
});
await page.waitFor(1000);
await page.setData({
loadError: false,
verifyCookieImage: 'https://request.dcloud.net.cn/img/shadow-grey.png'
});
await page.waitFor(1000);
expect(await page.data('loadError')).toBe(false);
await page.setData({
autoTest: false
});
})
it('path-screenshot', async () => {
const page = await program.navigateTo('/pages/component/image/image-path');
await page.waitFor(3000);
......
......@@ -18,6 +18,10 @@
<button type="primary" @tap="imageLarge">大图示例</button>
</view>
</view>
<view v-if="autoTest">
<image :src="setCookieImage"></image>
<image :src="verifyCookieImage" @error="error"></image>
</view>
</view>
</template>
<script>
......@@ -26,7 +30,11 @@
return {
title: 'image',
imageSrc: "/static/test-image/logo.png" as string.ImageURIString,
loadError: false
loadError: false,
// 自动化测试
autoTest: false,
setCookieImage: "",
verifyCookieImage: ""
}
},
methods: {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册