Skip to content

Commit

Permalink
Moved playwright test navigation to RendererFixture
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandercerutti committed Feb 15, 2024
1 parent 2b04f50 commit 8190924
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
6 changes: 6 additions & 0 deletions packages/captions-renderer/specs/RendererFixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ interface RendererFixture {
waitForEvent(event: "playing"): Promise<void>;
}

const SUB37_SAMPLE_PAGE_PATH = "./pages/sub37-example/index.html";

export const RendererFixture = base.extend<RendererFixture>({
page({ page }, use) {
page.goto(SUB37_SAMPLE_PAGE_PATH);
return use(page);
},
getFakeVideo({ page }, use) {
return use(() => page.locator("fake-video"));
},
Expand Down
8 changes: 0 additions & 8 deletions packages/captions-renderer/specs/renderer.spec.pw.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -35,8 +33,6 @@ scroll:up
<v Bill>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),
Expand Down Expand Up @@ -72,8 +68,6 @@ scroll:up
<v Bill>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),
Expand Down Expand Up @@ -123,8 +117,6 @@ STYLE
<v Bill>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),
Expand Down

0 comments on commit 8190924

Please sign in to comment.