From 4a159e1620f1a1104b4b58175eee227790170b32 Mon Sep 17 00:00:00 2001 From: zhenyuWang <13641039885@163.com> Date: Tue, 18 Jun 2024 13:07:24 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E4=BC=98=E5=8C=96=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/API/modal/modal.test.js | 2 +- pages/API/resize-observer/resize-observer.test.js | 2 +- .../set-navigation-bar-color.test.js | 6 ++++++ .../set-navigation-bar-title.test.js | 6 ++++++ .../test-background-color-content.test.js | 2 +- 5 files changed, 15 insertions(+), 3 deletions(-) diff --git a/pages/API/modal/modal.test.js b/pages/API/modal/modal.test.js index 048a0d66..4e89390d 100644 --- a/pages/API/modal/modal.test.js +++ b/pages/API/modal/modal.test.js @@ -7,7 +7,7 @@ describe('API-loading', () => { beforeAll(async () => { page = await program.reLaunch('/pages/API/modal/modal') - await page.waitFor(200); + await page.waitFor('view'); }); diff --git a/pages/API/resize-observer/resize-observer.test.js b/pages/API/resize-observer/resize-observer.test.js index ad6de613..74b7124e 100644 --- a/pages/API/resize-observer/resize-observer.test.js +++ b/pages/API/resize-observer/resize-observer.test.js @@ -9,7 +9,7 @@ describe('api-resize-observer', () => { it('check_resize-observer', async () => { await page.waitFor(600) - const image = await program.screenshot(); + const image = await program.screenshot({fullPage: true}); expect(image).toSaveImageSnapshot(); }) diff --git a/pages/API/set-navigation-bar-color/set-navigation-bar-color.test.js b/pages/API/set-navigation-bar-color/set-navigation-bar-color.test.js index c4373a46..a99467b9 100644 --- a/pages/API/set-navigation-bar-color/set-navigation-bar-color.test.js +++ b/pages/API/set-navigation-bar-color/set-navigation-bar-color.test.js @@ -2,6 +2,12 @@ const CURRENT_PAGE_PATH = '/pages/API/set-navigation-bar-color/set-navigation-bar-color' describe('setNavigationBarColor', () => { + if (process.env.UNI_AUTOMATOR_APP_WEBVIEW == 'true') { + it('dummyTest', () => { + expect(1).toBe(1) + }) + return + } let page let originLifeCycleNum beforeAll(async () => { diff --git a/pages/API/set-navigation-bar-title/set-navigation-bar-title.test.js b/pages/API/set-navigation-bar-title/set-navigation-bar-title.test.js index 698bf809..1f8cb687 100644 --- a/pages/API/set-navigation-bar-title/set-navigation-bar-title.test.js +++ b/pages/API/set-navigation-bar-title/set-navigation-bar-title.test.js @@ -2,6 +2,12 @@ const CURRENT_PAGE_PATH = "/pages/API/set-navigation-bar-title/set-navigation-bar-title"; describe("setNavigationBarColor", () => { + if (process.env.UNI_AUTOMATOR_APP_WEBVIEW == 'true') { + it('dummyTest', () => { + expect(1).toBe(1) + }) + return + } let page; let originLifeCycleNum; beforeAll(async () => { diff --git a/pages/template/test-background-color-content/test-background-color-content.test.js b/pages/template/test-background-color-content/test-background-color-content.test.js index dd0041f3..fc134b0a 100644 --- a/pages/template/test-background-color-content/test-background-color-content.test.js +++ b/pages/template/test-background-color-content/test-background-color-content.test.js @@ -8,7 +8,7 @@ describe('PagesJson-backgroundColorContent', () => { it('background color content size', async () => { await program.pageScrollTo(1000) - const image = await program.screenshot(); + const image = await program.screenshot({fullPage: true}); expect(image).toSaveImageSnapshot() }) -- GitLab