Skip to content

Commit

Permalink
fix e2e-test
Browse files Browse the repository at this point in the history
  • Loading branch information
nknapp committed Apr 8, 2024
1 parent d6fd12d commit 02f29bf
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions e2e-tests/TechniqueChooser.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,22 @@ import { expect, test } from "@playwright/test";

test("loads keeps settings across page reload", async ({ page }) => {
await page.goto("http://localhost:4321/en/aikido-dojo-darmstadt/");
await page.getByText("Random").click();
await expect(page.getByText("Random")).toHaveAttribute("aria-checked", "false");

await page.getByText("5th Kyu").click();
await expect(page.getByText("5th Kyu")).toHaveAttribute("aria-checked", "true");
await expect(page.getByText("suwari waza")).toBeVisible();
{
const randomizeButton = page.getByRole("button", { name: "Random" });
await randomizeButton.click();
await expect(randomizeButton).toHaveAttribute("aria-checked", "false");

const kyu5Button = page.getByRole("button", { name: "5th Kyu" });
await kyu5Button.click();
await expect(kyu5Button).toHaveAttribute("aria-checked", "true");
await expect(page.getByText("suwari waza")).toBeVisible();
}
await page.reload();

await expect(page.getByText("Random")).toHaveAttribute("aria-checked", "false");
await expect(page.getByText("5th Kyu")).toHaveAttribute("aria-checked", "true");
await expect(page.getByText("suwari waza")).toBeVisible();
{
const randomizeButton = page.getByRole("button", { name: "Random" });
const kyu5Button = page.getByRole("button", { name: "5th Kyu" });
await expect(randomizeButton).toHaveAttribute("aria-checked", "false");
await expect(kyu5Button).toHaveAttribute("aria-checked", "true");
await expect(page.getByText("suwari waza")).toBeVisible();
}
});

0 comments on commit 02f29bf

Please sign in to comment.