diff --git a/pages.json b/pages.json index dcfce5fe9f8f38bfa290a7f45dcec104e302f597..aa2cfba83fac90939f03842ed656fa7e8ccf4bb5 100644 --- a/pages.json +++ b/pages.json @@ -1309,6 +1309,13 @@ "navigationBarTitleText": "日历" } }, + { + "path": "pages/API/theme-change/theme-change", + "style": { + "navigationBarTitleText": "主题切换", + "enablePullDownRefresh": false + } + }, // #endif { "path": "pages/template/schema/schema", @@ -1380,13 +1387,6 @@ "enablePullDownRefresh": false } }, - // { - // "path": "pages/API/theme-change/theme-change", - // "style": { - // "navigationBarTitleText": "主题切换", - // "enablePullDownRefresh": false - // } - // }, { "path": "uni_modules/uni-pay-x/pages/success/success", "style": { diff --git a/pages/API/theme-change/theme-change.test.js b/pages/API/theme-change/theme-change.test.js new file mode 100644 index 0000000000000000000000000000000000000000..0dcdb3a3dc236ac010c9c98c6e7c0c1a1e6c647d --- /dev/null +++ b/pages/API/theme-change/theme-change.test.js @@ -0,0 +1,27 @@ +// uni-app自动化测试教程: uni-app自动化测试教程: https://uniapp.dcloud.net.cn/worktile/auto/hbuilderx-extension/ + +describe('API-theme-change', () => { + + let page; + const isApp = process.env.UNI_OS_NAME === "android" || process.env.UNI_OS_NAME === "ios"; + + if (!isApp) { + it('dummyTest', () => { + expect(1).toBe(1) + }) + return + } + + beforeAll(async () => { + page = await program.reLaunch('/pages/API/theme-change/theme-change') + await page.waitFor(600); + }); + + + + it("check-set-app-theme", async () => { + await page.callMethod('setAppTheme', "dark") + await page.waitFor(300) + expect(await page.data('appTheme')).toBe("dark") + }) +}); diff --git a/pages/API/theme-change/theme-change.uvue b/pages/API/theme-change/theme-change.uvue index 4afff9df03afb8b1912033de755b4fe6002a4d2a..ab118218b8ad9bc3175136d4b14c40ad1d2ca573 100644 --- a/pages/API/theme-change/theme-change.uvue +++ b/pages/API/theme-change/theme-change.uvue @@ -1,81 +1,100 @@ -