From dbe7e931853d25c50226ccc875eb0ddcf7b1ed29 Mon Sep 17 00:00:00 2001 From: wangyaqi Date: Tue, 5 Mar 2024 18:09:48 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E5=9C=A8web=E7=AB=AF=E5=B1=8F=E8=94=BD?= =?UTF-8?q?image=20cookie=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/component/image/image.test.js | 36 +++++++++++++++-------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/pages/component/image/image.test.js b/pages/component/image/image.test.js index 26fd38e5..0c031b72 100644 --- a/pages/component/image/image.test.js +++ b/pages/component/image/image.test.js @@ -20,7 +20,7 @@ describe('component-native-image', () => { await page.waitFor(300); expect(await page.data('loadError')).toBe(false) }) - + it('check_image_load_error', async () => { await page.setData({ loadError: false, @@ -30,22 +30,24 @@ 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 - }); - }) + if (process.env.uniTestPlatformInfo.startsWith('android')) { + 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'); -- GitLab