From 9a3798b085fbe3a944396a0994465d5bd03d20e7 Mon Sep 17 00:00:00 2001 From: jixinbao Date: Thu, 1 Aug 2024 17:06:38 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=AE=80=E5=8C=96=20getLaunchOptionsSy?= =?UTF-8?q?nc=20=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../get-launch-options-sync.test.js | 16 +--- .../get-launch-options-sync.uvue | 73 +++++++------------ 2 files changed, 27 insertions(+), 62 deletions(-) diff --git a/pages/API/get-launch-options-sync/get-launch-options-sync.test.js b/pages/API/get-launch-options-sync/get-launch-options-sync.test.js index db162b2a..264c264b 100644 --- a/pages/API/get-launch-options-sync/get-launch-options-sync.test.js +++ b/pages/API/get-launch-options-sync/get-launch-options-sync.test.js @@ -9,21 +9,9 @@ describe('getLaunchOptionsSync', () => { expect(data.checked).toBe(true) }) it('app onLaunch 和 getLaunchOptionsSync 结果一致', async () => { - const page = await program.navigateTo(PAGE_PATH) await page.waitFor('view') - const res = await page.callMethod('compareOnLaunchRes') - expect(res.appOnLaunch).toEqual(res.launchOptions) - }) - it('app onShow 和 getEnterOptionsSync 结果一致', async () => { - const page = await program.navigateTo(PAGE_PATH) - await page.waitFor('view') - const res = await page.callMethod('compareOnShowRes') - - if (process.env.uniTestPlatformInfo.toLowerCase().startsWith('android')) { - // if android return - expect(true).toBe(true) - } - expect(res.appOnShow).toEqual(res.onShowOption) + const pageData = await page.data() + expect(pageData.testResult).toBe(true) }) }) diff --git a/pages/API/get-launch-options-sync/get-launch-options-sync.uvue b/pages/API/get-launch-options-sync/get-launch-options-sync.uvue index ad9693ee..802c38fb 100644 --- a/pages/API/get-launch-options-sync/get-launch-options-sync.uvue +++ b/pages/API/get-launch-options-sync/get-launch-options-sync.uvue @@ -1,70 +1,47 @@ -