From f8b48a132cf36d047f48412b0c161b6b2765755c Mon Sep 17 00:00:00 2001 From: zhenyuWang <13641039885@163.com> Date: Mon, 17 Jul 2023 15:09:06 +0800 Subject: [PATCH] feat: getCurrentPages --- pages.json | 6 ++++ .../get-current-pages.test.js | 11 ++++++++ .../get-current-pages/get-current-pages.uvue | 28 +++++++++++++++++++ pages/tabBar/API.uvue | 8 ++++-- 4 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 pages/API/get-current-pages/get-current-pages.test.js create mode 100644 pages/API/get-current-pages/get-current-pages.uvue diff --git a/pages.json b/pages.json index 73dab942..522bedc4 100644 --- a/pages.json +++ b/pages.json @@ -153,6 +153,12 @@ "navigationBarTitleText": "getApp" } }, + { + "path": "pages/API/get-current-pages/get-current-pages", + "style": { + "navigationBarTitleText": "getCurrentPages" + } + }, { "path": "pages/API/navigator/navigator", "style": { diff --git a/pages/API/get-current-pages/get-current-pages.test.js b/pages/API/get-current-pages/get-current-pages.test.js new file mode 100644 index 00000000..f380eeca --- /dev/null +++ b/pages/API/get-current-pages/get-current-pages.test.js @@ -0,0 +1,11 @@ +const PAGE_PATH = '/pages/API/get-current-pages/get-current-pages' + +describe('getCurrentPages', () => { + it('getCurrentPages', async () => { + const page = await program.navigateTo(PAGE_PATH) + await page.waitFor(1000) + await page.callMethod('getCurrentPages') + const data = await page.data() + expect(data.checked).toBe(true) + }) +}) diff --git a/pages/API/get-current-pages/get-current-pages.uvue b/pages/API/get-current-pages/get-current-pages.uvue new file mode 100644 index 00000000..f454273b --- /dev/null +++ b/pages/API/get-current-pages/get-current-pages.uvue @@ -0,0 +1,28 @@ + + diff --git a/pages/tabBar/API.uvue b/pages/tabBar/API.uvue index ce6af2e5..1624fc0e 100644 --- a/pages/tabBar/API.uvue +++ b/pages/tabBar/API.uvue @@ -48,10 +48,14 @@ name: "基础", open: false, pages: [ - { + { name: "getApp", url: "get-app", - }, + }, + { + name: "getCurrentPages", + url: "get-current-pages", + }, { name: "事件总线event-bus", url: "event-bus", -- GitLab