load-font-face.test.js 676 字节
Newer Older
DCloud-WZF's avatar
DCloud-WZF 已提交
1
const PAGE_PATH = '/pages/API/load-font-face/load-font-face'
DCloud-WZF's avatar
DCloud-WZF 已提交
2
const CHILD_PAGE_PATH = "/pages/API/load-font-face/load-font-face-child";
DCloud-WZF's avatar
DCloud-WZF 已提交
3

DCloud-WZF's avatar
DCloud-WZF 已提交
4
describe("loadFontFace", () => {
DCloud-WZF's avatar
DCloud-WZF 已提交
5
  beforeAll(async () => {
DCloud-WZF's avatar
DCloud-WZF 已提交
6
    const page = await program.navigateTo(PAGE_PATH);
7
    await page.waitFor(4000);
DCloud-WZF's avatar
DCloud-WZF 已提交
8 9
  });
  it("parent screenshot", async () => {
10
    const image = await program.screenshot({fullPage: true});
11
    expect(image).toSaveImageSnapshot();
DCloud-WZF's avatar
DCloud-WZF 已提交
12 13 14
  });
  it("child screenshot", async () => {
    const page = await program.navigateTo(CHILD_PAGE_PATH);
15
    await page.waitFor(3000);
16
    const image = await program.screenshot({fullPage: true});
17
    expect(image).toSaveImageSnapshot();
DCloud-WZF's avatar
DCloud-WZF 已提交
18 19
  });
});