diff --git a/packages/captions-renderer/specs/RendererFixture.ts b/packages/captions-renderer/specs/RendererFixture.ts index 4b529f0..5d002d1 100644 --- a/packages/captions-renderer/specs/RendererFixture.ts +++ b/packages/captions-renderer/specs/RendererFixture.ts @@ -8,7 +8,13 @@ interface RendererFixture { waitForEvent(event: "playing"): Promise; } +const SUB37_SAMPLE_PAGE_PATH = "./pages/sub37-example/index.html"; + export const RendererFixture = base.extend({ + page({ page }, use) { + page.goto(SUB37_SAMPLE_PAGE_PATH); + return use(page); + }, getFakeVideo({ page }, use) { return use(() => page.locator("fake-video")); }, diff --git a/packages/captions-renderer/specs/renderer.spec.pw.ts b/packages/captions-renderer/specs/renderer.spec.pw.ts index b5e1c61..f236282 100644 --- a/packages/captions-renderer/specs/renderer.spec.pw.ts +++ b/packages/captions-renderer/specs/renderer.spec.pw.ts @@ -1,8 +1,6 @@ import { expect } from "@playwright/test"; import { RendererFixture as test } from "./RendererFixture.js"; -const SUB37_SAMPLE_PAGE_PATH = "./pages/sub37-example/index.html"; - test("Renderer should render two regions if the tracks owns two regions", async ({ page, waitForEvent, @@ -35,8 +33,6 @@ scroll:up Hi, I’m Bill `; - await page.goto(SUB37_SAMPLE_PAGE_PATH); - await Promise.all([ waitForEvent("playing"), page.getByRole("textbox", { name: "WEBVTT..." }).fill(TEST_WEBVTT_TRACK), @@ -72,8 +68,6 @@ scroll:up Hi, I’m Bill `; - await page.goto(SUB37_SAMPLE_PAGE_PATH); - await Promise.all([ waitForEvent("playing"), page.getByRole("textbox", { name: "WEBVTT..." }).fill(TEST_WEBVTT_TRACK), @@ -123,8 +117,6 @@ STYLE Hi, I’m Bill `; - await page.goto(SUB37_SAMPLE_PAGE_PATH); - await Promise.all([ waitForEvent("playing"), page.getByRole("textbox", { name: "WEBVTT..." }).fill(TEST_WEBVTT_TRACK),