From b88b912c9d561180ed0604beee08b6b9de809853 Mon Sep 17 00:00:00 2001 From: zhenyuWang <13641039885@163.com> Date: Thu, 26 Oct 2023 17:05:47 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E4=BC=98=E5=8C=96=20loadFontFace=20?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../load-font-face-child.test.js | 12 --------- .../API/load-font-face/load-font-face.test.js | 25 ++++++++++++------- 2 files changed, 16 insertions(+), 21 deletions(-) delete mode 100644 pages/API/load-font-face/load-font-face-child.test.js diff --git a/pages/API/load-font-face/load-font-face-child.test.js b/pages/API/load-font-face/load-font-face-child.test.js deleted file mode 100644 index 602fb40f..00000000 --- a/pages/API/load-font-face/load-font-face-child.test.js +++ /dev/null @@ -1,12 +0,0 @@ -const PAGE_PATH = '/pages/API/load-font-face/load-font-face-child' - -describe('loadFontFace global', () => { - beforeAll(async () => { - const page = await program.navigateTo(PAGE_PATH) - await page.waitFor('view') - }) - it('screenshot', async () => { - const image = await program.screenshot() - expect(image).toMatchImageSnapshot() - }) -}) diff --git a/pages/API/load-font-face/load-font-face.test.js b/pages/API/load-font-face/load-font-face.test.js index 826dabee..df73df33 100644 --- a/pages/API/load-font-face/load-font-face.test.js +++ b/pages/API/load-font-face/load-font-face.test.js @@ -1,12 +1,19 @@ const PAGE_PATH = '/pages/API/load-font-face/load-font-face' +const CHILD_PAGE_PATH = "/pages/API/load-font-face/load-font-face-child"; -describe('loadFontFace', () => { +describe("loadFontFace", () => { beforeAll(async () => { - const page = await program.navigateTo(PAGE_PATH) - await page.waitFor(3000) - }) - it('screenshot', async () => { - const image = await program.screenshot() - expect(image).toMatchImageSnapshot() - }) -}) + const page = await program.navigateTo(PAGE_PATH); + await page.waitFor(3000); + }); + it("parent screenshot", async () => { + const image = await program.screenshot(); + expect(image).toMatchImageSnapshot(); + }); + it("child screenshot", async () => { + const page = await program.navigateTo(CHILD_PAGE_PATH); + await page.waitFor("view"); + const image = await program.screenshot(); + expect(image).toMatchImageSnapshot(); + }); +}); -- GitLab