Skip to content

Commit

Permalink
Fix flaky test
Browse files Browse the repository at this point in the history
  • Loading branch information
lsolcher committed Jan 3, 2025
1 parent cf14f17 commit 21ba268
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions packages/dito/tests/e2e/examplePages.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ test.describe("Digitaltauglichkeit Prinzipien Detail", () => {
lawLinks.first().click(),
]);

await newTab.waitForLoadState("domcontentloaded");
await newTab.waitForLoadState("load");
await expect(newTab).toHaveURL(new RegExp(`${ROUTE_LAWS.url}/.+`));

const mainContent = newTab.getByRole("main");
Expand Down Expand Up @@ -121,15 +121,13 @@ test.describe("Visualizations Overview Page", () => {
await expect(firstImage).toBeVisible();

// Test image zoom in new tab
if (browserName !== "firefox") {
const [newTab] = await Promise.all([
context.waitForEvent("page"),
firstImage.click(),
]);
const [newTab] = await Promise.all([
context.waitForEvent("page"),
firstImage.click(),
]);

await newTab.waitForLoadState("domcontentloaded");
expect(newTab.url()).toMatch(/^https?:\/\/secure-dinosaurs.+/);
}
await newTab.waitForLoadState("load");
expect(newTab.url()).toMatch(/^https?:\/\/secure-dinosaurs.+/);
});

test("navigation to regulation detail works", async ({ page }) => {
Expand Down

0 comments on commit 21ba268

Please sign in to comment.