From 1d7bcc4282f27ae032777ec3e931cb646c571dd9 Mon Sep 17 00:00:00 2001 From: wangjinxin613 <1749574663@qq.com> Date: Fri, 22 Mar 2024 17:54:56 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E5=85=BC=E5=AE=B9=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96=E6=B5=8B=E8=AF=95=20webview=20=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../element-takesnapshot.test.js | 2 +- .../get-app-authorize-setting.test.js | 4 ++-- .../get-file-system-manager.test.js | 2 +- .../get-system-setting.test.js | 2 +- .../nested-scroll-body.test.js | 9 +++++++- .../nested-scroll-header.test.js | 22 ++++++++++++------- 6 files changed, 27 insertions(+), 14 deletions(-) diff --git a/pages/API/element-takesnapshot/element-takesnapshot.test.js b/pages/API/element-takesnapshot/element-takesnapshot.test.js index 5aedb2e7..d5cd7ebb 100644 --- a/pages/API/element-takesnapshot/element-takesnapshot.test.js +++ b/pages/API/element-takesnapshot/element-takesnapshot.test.js @@ -2,7 +2,7 @@ const PAGE_PATH = "/pages/API/element-takesnapshot/element-takesnapshot"; describe("element-takesnapshot", () => { - if (process.env.uniTestPlatformInfo.indexOf('web') > -1) { + if (process.env.uniTestPlatformInfo.indexOf('web') > -1 || process.env.UNI_AUTOMATOR_APP_WEBVIEW == 'true') { it('dummyTest', () => { expect(1).toBe(1) }) diff --git a/pages/API/get-app-authorize-setting/get-app-authorize-setting.test.js b/pages/API/get-app-authorize-setting/get-app-authorize-setting.test.js index 31578789..44b9d35e 100644 --- a/pages/API/get-app-authorize-setting/get-app-authorize-setting.test.js +++ b/pages/API/get-app-authorize-setting/get-app-authorize-setting.test.js @@ -1,7 +1,7 @@ const PAGE_PATH = '/pages/API/get-app-authorize-setting/get-app-authorize-setting' -describe('ExtApi-GetAppAuthorizeSetting', () => { - if (process.env.uniTestPlatformInfo.indexOf('web') > -1) { +describe('ExtApi-GetAppAuthorizeSetting', () => { + if (process.env.uniTestPlatformInfo.indexOf('web') > -1 || process.env.UNI_AUTOMATOR_APP_WEBVIEW == 'true') { it('dummyTest', () => { expect(1).toBe(1) }) diff --git a/pages/API/get-file-system-manager/get-file-system-manager.test.js b/pages/API/get-file-system-manager/get-file-system-manager.test.js index 547c9633..c8f4c83b 100644 --- a/pages/API/get-file-system-manager/get-file-system-manager.test.js +++ b/pages/API/get-file-system-manager/get-file-system-manager.test.js @@ -2,7 +2,7 @@ const PAGE_PATH = '/pages/API/get-file-system-manager/get-file-system-manager' describe('ExtApi-FileManagerTest', () => { - if (process.env.uniTestPlatformInfo.indexOf('web') > -1) { + if (process.env.uniTestPlatformInfo.indexOf('web') > -1 || process.env.UNI_AUTOMATOR_APP_WEBVIEW == 'true') { it('dummyTest', () => { expect(1).toBe(1) }) diff --git a/pages/API/get-system-setting/get-system-setting.test.js b/pages/API/get-system-setting/get-system-setting.test.js index 779c2a5e..c715b308 100644 --- a/pages/API/get-system-setting/get-system-setting.test.js +++ b/pages/API/get-system-setting/get-system-setting.test.js @@ -1,7 +1,7 @@ const PAGE_PATH = '/pages/API/get-system-setting/get-system-setting' describe('ExtApi-GetSystemSetting', () => { - if (process.env.uniTestPlatformInfo.indexOf('web') > -1) { + if (process.env.uniTestPlatformInfo.indexOf('web') > -1 || process.env.UNI_AUTOMATOR_APP_WEBVIEW == 'true') { it('web', () => { expect(1).toBe(1) }) diff --git a/pages/component/nested-scroll-body/nested-scroll-body.test.js b/pages/component/nested-scroll-body/nested-scroll-body.test.js index 9463eaf8..a3b80a39 100644 --- a/pages/component/nested-scroll-body/nested-scroll-body.test.js +++ b/pages/component/nested-scroll-body/nested-scroll-body.test.js @@ -1,4 +1,11 @@ -describe('component-native-nested-scroll-body', () => { +describe('component-native-nested-scroll-body', () => { + if (process.env.uniTestPlatformInfo.indexOf('web') > -1 || process.env.UNI_AUTOMATOR_APP_WEBVIEW == 'true') { + it('dummyTest', () => { + expect(1).toBe(1) + }) + return + } + let page beforeAll(async () => { //打开lnested-scroll-body测试页 diff --git a/pages/component/nested-scroll-header/nested-scroll-header.test.js b/pages/component/nested-scroll-header/nested-scroll-header.test.js index 864d44b8..c3982468 100644 --- a/pages/component/nested-scroll-header/nested-scroll-header.test.js +++ b/pages/component/nested-scroll-header/nested-scroll-header.test.js @@ -1,15 +1,21 @@ describe('component-native-nested-scroll-header', () => { + if (process.env.uniTestPlatformInfo.indexOf('web') > -1 || process.env.UNI_AUTOMATOR_APP_WEBVIEW == 'true') { + it('dummyTest', () => { + expect(1).toBe(1) + }) + return + } + let page - beforeAll(async () => { + beforeAll(async () => { //打开lnested-scroll-header测试页 page = await program.reLaunch('/pages/component/nested-scroll-header/nested-scroll-header') await page.waitFor(600) - }) - - - it('check_nested-scroll-header', async () => { - const image = await program.screenshot(); - expect(image).toMatchImageSnapshot(); + }) + + + it('check_nested-scroll-header', async () => { + const image = await program.screenshot(); + expect(image).toMatchImageSnapshot(); }) }) - -- GitLab