From 7fb1f62bf0292aca6e8978314bcaa1a6166123ea Mon Sep 17 00:00:00 2001 From: jixinbao Date: Thu, 1 Aug 2024 16:09:50 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=A1=A5=E5=85=85=20getEnterOptionsSyn?= =?UTF-8?q?c=20=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages.json | 13 +++- .../get-enter-options-sync.test.js | 23 +++++++ .../get-enter-options-sync.uvue | 61 +++++++++++++++++++ 3 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 pages/API/get-enter-options-sync/get-enter-options-sync.test.js create mode 100644 pages/API/get-enter-options-sync/get-enter-options-sync.uvue diff --git a/pages.json b/pages.json index 2bf06b50..c64c934f 100644 --- a/pages.json +++ b/pages.json @@ -551,6 +551,13 @@ "navigationBarTitleText": "getLaunchOptionsSync | 获取启动参数" } }, + { + "path": "pages/API/get-enter-options-sync/get-enter-options-sync", + "group": "1,1,4,1", + "style": { + "navigationBarTitleText": "getEnterOptionsSync | 获取启动参数" + } + }, { "path": "pages/API/navigator/navigator", "group": "1,2,0", @@ -2075,6 +2082,10 @@ { "id": "api.base.launch.getLaunchOptionsSync", "name": "getLaunchOptionsSync" + }, + { + "id": "api.base.launch.getEnterOptionsSync", + "name": "getLEnterOptionsSync" } ] }, @@ -2744,4 +2755,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/pages/API/get-enter-options-sync/get-enter-options-sync.test.js b/pages/API/get-enter-options-sync/get-enter-options-sync.test.js new file mode 100644 index 00000000..e5c7cac9 --- /dev/null +++ b/pages/API/get-enter-options-sync/get-enter-options-sync.test.js @@ -0,0 +1,23 @@ +const PAGE_PATH = '/pages/API/get-enter-options-sync/get-enter-options-sync' + +describe('getEnterOptionsSync', () => { + it('getEnterOptionsSync', async () => { + const page = await program.navigateTo(PAGE_PATH) + await page.waitFor('view') + await page.callMethod('getEnterOptionsSync') + const data = await page.data() + expect(data.checked).toBe(true) + }) + + 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) + }) +}) diff --git a/pages/API/get-enter-options-sync/get-enter-options-sync.uvue b/pages/API/get-enter-options-sync/get-enter-options-sync.uvue new file mode 100644 index 00000000..bd2b77d5 --- /dev/null +++ b/pages/API/get-enter-options-sync/get-enter-options-sync.uvue @@ -0,0 +1,61 @@ + + + -- GitLab