loading.test.js 1.1 KB
Newer Older
杜庆泉's avatar
杜庆泉 已提交
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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
// uni-app自动化测试教程: uni-app自动化测试教程: https://uniapp.dcloud.net.cn/worktile/auto/hbuilderx-extension/

describe('API-loading', () => {

  let page;
  const isAndroid = process.env.UNI_OS_NAME === "android";

  beforeAll(async () => {
    page = await program.reLaunch('/pages/API/loading/loading')

    await page.waitFor(200);

  });



  // it("onload-loading-test", async () => {
  //   if (isAndroid) {
  //     const res = await page.callMethod('jest_getWindowInfo')
  //     const windowHeight = res.windowHeight * res.pixelRatio;
  //     const windowWidth = res.windowWidth * res.pixelRatio;
  //     const image = await program.screenshot({
  //       adb: true,
  //       area: {
  //         x: 0,
  //         y: windowHeight / 2 + 120,
  //         height: windowHeight / 2,
  //         width:windowWidth
  //       },
  //     });
  //     expect(image).toMatchImageSnapshot();
  //   }else{
  //     const image = await program.screenshot({
  //       adb: true,
  //       fullPage: true
  //     });
  //     expect(image).toMatchImageSnapshot()
  //   }
  // })


});