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 562256c commit e55bad1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion 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("load");
await newTab.waitForLoadState("networkidle");
await expect(newTab).toHaveURL(new RegExp(`${ROUTE_LAWS.url}/.+`));

const mainContent = newTab.getByRole("main");
Expand Down
13 changes: 11 additions & 2 deletions packages/dito/tests/e2e/methodPages.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,22 @@ test.describe("five principles page", () => {

for (const [index, url] of links.entries()) {
await page.goto(ROUTE_METHODS_FIVE_PRINCIPLES.url);

Check failure on line 147 in packages/dito/tests/e2e/methodPages.spec.ts

View workflow job for this annotation

GitHub Actions / check-test-build-deploy (dito) / check-and-test-shared / check-and-test

[firefox] › e2e/methodPages.spec.ts:136:3 › five principles page › five principles page links to examples

1) [firefox] › e2e/methodPages.spec.ts:136:3 › five principles page › five principles page links to examples Error: page.goto: NS_BINDING_ABORTED; maybe frame was detached? Call log: - navigating to "http://localhost:5173/methoden/fuenf-prinzipien", waiting until "load" 145 | 146 | for (const [index, url] of links.entries()) { > 147 | await page.goto(ROUTE_METHODS_FIVE_PRINCIPLES.url); | ^ 148 | 149 | await Promise.all([ 150 | page.waitForLoadState("domcontentloaded"), at /home/runner/work/digitalcheck-apps/digitalcheck-apps/packages/dito/tests/e2e/methodPages.spec.ts:147:18
await Promise.all([page.waitForLoadState("networkidle")]);

await Promise.all([
page.waitForLoadState("domcontentloaded"),
page.waitForLoadState("networkidle"),
]);

const link = page
.getByRole("link", { name: "Beispiele betrachten" })
.nth(index);

await Promise.all([page.waitForURL(url), link.click()]);
await expect(link).toBeVisible();
const navigationPromise = page.waitForURL(url);
await link.click();
await navigationPromise;

await expect(page).toHaveURL(url);
}
});
});
Expand Down

0 comments on commit e55bad1

Please sign in to comment.