From e9c0ee05c3b44eba347941032a07ce5d0fd7ef26 Mon Sep 17 00:00:00 2001 From: shutao Date: Wed, 20 Sep 2023 17:18:30 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85image=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/component/image/image.test.js | 14 ++++++++++++++ pages/component/image/image.uvue | 8 +++++--- 2 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 pages/component/image/image.test.js diff --git a/pages/component/image/image.test.js b/pages/component/image/image.test.js new file mode 100644 index 00000000..f8714407 --- /dev/null +++ b/pages/component/image/image.test.js @@ -0,0 +1,14 @@ +// uni-app自动化测试教程: uni-app自动化测试教程: https://uniapp.dcloud.net.cn/worktile/auto/hbuilderx-extension/ + +describe('component-native-image', () => { + + let page; + beforeAll(async () => { + page = await program.reLaunch('/pages/component/image/image'); + await page.waitFor(600); + }); + + it('check_image_load', async () => { + expect(await page.data('loadError')).toBe(false) + }); +}); diff --git a/pages/component/image/image.uvue b/pages/component/image/image.uvue index 9e6345ee..652e2c5f 100644 --- a/pages/component/image/image.uvue +++ b/pages/component/image/image.uvue @@ -25,11 +25,13 @@ export default { data() { return { - title: 'image' + title: 'image', + loadError: false } }, methods: { - error(event : ImageErrorEvent) { + error(event : ImageErrorEvent) { + this.loadError = true console.log(event.type, event.detail); }, load(event : ImageLoadEvent) { @@ -63,4 +65,4 @@ margin: 40rpx auto; width: 200rpx; } - \ No newline at end of file + -- GitLab