web-view-local.test.js 688 字节
Newer Older
shutao-dc's avatar
shutao-dc 已提交
1 2
// uni-app自动化测试教程: uni-app自动化测试教程: https://uniapp.dcloud.net.cn/worktile/auto/hbuilderx-extension/

3 4 5 6 7 8
describe('component-native-web-view', () => {
  let page;
  beforeAll(async () => {
    page = await program.reLaunch('/pages/component/web-view-local/web-view-local');
    await page.waitFor(1000);
  });
shutao-dc's avatar
shutao-dc 已提交
9

10 11 12
  it('check_load_url', async () => {
    expect(await page.data('loadError')).toBe(false)
  });
shutao-dc's avatar
shutao-dc 已提交
13

14 15 16 17 18 19
  it('screenshot', async () => {
    await page.waitFor(async () => {
      return await page.data('loadFinish') === true;
    });
    const image = await program.screenshot({
      fullPage: true
shutao-dc's avatar
shutao-dc 已提交
20
    });
21 22
    expect(image).toMatchImageSnapshot();
  });
shutao-dc's avatar
shutao-dc 已提交
23
});