From 2d3aed782b1dee82b1e922a039a0a22616d0e168 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E4=BA=9A=E7=90=AA?= Date: Fri, 26 Apr 2024 13:08:41 +0800 Subject: [PATCH] =?UTF-8?q?test:=20iOS=E7=AB=AF=E5=B1=8F=E8=94=BD=E4=B8=8D?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E7=9A=84=E6=B5=8B=E8=AF=95=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ge-style-disable-pull-down-refresh.test.js | 70 +++++++++++-------- 1 file changed, 40 insertions(+), 30 deletions(-) diff --git a/pages/API/get-current-pages/set-page-style-disable-pull-down-refresh.test.js b/pages/API/get-current-pages/set-page-style-disable-pull-down-refresh.test.js index bf0ba6e3..0753c3b8 100644 --- a/pages/API/get-current-pages/set-page-style-disable-pull-down-refresh.test.js +++ b/pages/API/get-current-pages/set-page-style-disable-pull-down-refresh.test.js @@ -1,35 +1,45 @@ const PAGE_PATH = '/pages/API/get-current-pages/set-page-style-disable-pull-down-refresh' describe('getCurrentPages', () => { - let page - it('page-style', async () => { - page = await program.navigateTo(PAGE_PATH) - - await page.callMethod('getPageStyle') - await page.waitFor(200) - const isEnablePullDownRefresh1 = (await page.data()).currentPageStyle.enablePullDownRefresh - expect(isEnablePullDownRefresh1).toBe(false) - - await page.callMethod('setPageStyle', true) - await page.waitFor(200) - await page.callMethod('getPageStyle') - await page.waitFor(200) - const isEnablePullDownRefresh2 = (await page.data()).currentPageStyle.enablePullDownRefresh - expect(isEnablePullDownRefresh2).toBe(true) - await page.callMethod('startPullDownRefresh') - await page.waitFor(500) - const image3 = await program.screenshot({fullPage: true}); - expect(image3).toSaveImageSnapshot(); - - await page.waitFor(3500) - - // setPageStyle - await page.callMethod('setPageStyle', false) - await page.waitFor(200) - await page.callMethod('startPullDownRefresh') - await page.waitFor(500) - const image2 = await program.screenshot({fullPage: true}); - expect(image2).toSaveImageSnapshot(); - + if (process.env.uniTestPlatformInfo.startsWith('IOS')) { + it('not-support', async () => { + expect(1).toBe(1) + }) + return + } + let page + it('page-style', async () => { + page = await program.navigateTo(PAGE_PATH) + + await page.callMethod('getPageStyle') + await page.waitFor(200) + const isEnablePullDownRefresh1 = (await page.data()).currentPageStyle.enablePullDownRefresh + expect(isEnablePullDownRefresh1).toBe(false) + + await page.callMethod('setPageStyle', true) + await page.waitFor(200) + await page.callMethod('getPageStyle') + await page.waitFor(200) + const isEnablePullDownRefresh2 = (await page.data()).currentPageStyle.enablePullDownRefresh + expect(isEnablePullDownRefresh2).toBe(true) + await page.callMethod('startPullDownRefresh') + await page.waitFor(500) + const image3 = await program.screenshot({ + fullPage: true + }); + expect(image3).toSaveImageSnapshot(); + + await page.waitFor(3500) + + // setPageStyle + await page.callMethod('setPageStyle', false) + await page.waitFor(200) + await page.callMethod('startPullDownRefresh') + await page.waitFor(500) + const image2 = await program.screenshot({ + fullPage: true + }); + expect(image2).toSaveImageSnapshot(); + }) }) -- GitLab