From 14cdd51832a4711a24614e08903e2e879dac0806 Mon Sep 17 00:00:00 2001 From: yinjiacheng Date: Wed, 13 Nov 2024 12:34:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0dialogPage=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/API/dialog-page/dialog-page.test.js | 16 ++++++++++++++++ pages/API/dialog-page/dialog-page.uvue | 13 +++++++++++++ 2 files changed, 29 insertions(+) diff --git a/pages/API/dialog-page/dialog-page.test.js b/pages/API/dialog-page/dialog-page.test.js index a04a9541..b7abc7bb 100644 --- a/pages/API/dialog-page/dialog-page.test.js +++ b/pages/API/dialog-page/dialog-page.test.js @@ -308,6 +308,22 @@ describe('dialog page', () => { await page.waitFor(2000); await page.callMethod('jest_CloseDialog1') }) + + it('dialogPage hideStatusBar hideBottomNavigationIndicator', async () => { + await page.callMethod('openDialog2ForTest'); + await page.waitFor(1000); + await page.callMethod('setPageStyleForTest', { + hideStatusBar: true, + hideBottomNavigationIndicator: true + }); + await page.waitFor(2000); + const image = await program.screenshot({ + deviceShot: true + }); + expect(image).toSaveImageSnapshot(); + await page.waitFor(2000); + await page.callMethod('closeDialog2ForTest'); + }); afterAll(async () => { await page.callMethod('setLifeCycleNum', initLifeCycleNum) diff --git a/pages/API/dialog-page/dialog-page.uvue b/pages/API/dialog-page/dialog-page.uvue index 28573013..b77b2032 100644 --- a/pages/API/dialog-page/dialog-page.uvue +++ b/pages/API/dialog-page/dialog-page.uvue @@ -193,6 +193,19 @@ } this.jest_click_x = systemInfo.screenWidth / 2 * ratio this.jest_click_y = systemInfo.statusBarHeight * ratio + 10 + }, + openDialog2ForTest() { + uni.openDialogPage({ + url: '/pages/API/dialog-page/dialog-2' + }); + }, + closeDialog2ForTest() { + uni.closeDialogPage({}); + }, + setPageStyleForTest(style : UTSJSONObject) { + const pages = getDialogPages(); + const currentPage = pages[pages.length - 1]; + currentPage.setPageStyle(style); } } } -- GitLab