theme-change.test.js 786 字节
Newer Older
shutao-dc's avatar
shutao-dc 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
// 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")
26 27 28
    //还原主题为light
    await page.callMethod('setAppTheme', "light")
    await page.waitFor(600)
shutao-dc's avatar
shutao-dc 已提交
29 30
  })
});