From 63f4f70220a9148288d92940834a5dcbd690658b Mon Sep 17 00:00:00 2001 From: Merlin Pannewitz Date: Wed, 22 Jan 2025 12:56:31 +0100 Subject: [PATCH] Address flaky tests --- packages/dito/tests/e2e/examplePages.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/dito/tests/e2e/examplePages.spec.ts b/packages/dito/tests/e2e/examplePages.spec.ts index 906d4a94..101919ea 100644 --- a/packages/dito/tests/e2e/examplePages.spec.ts +++ b/packages/dito/tests/e2e/examplePages.spec.ts @@ -21,7 +21,8 @@ test.describe("Digitaltauglichkeit main functionality", () => { const url = `${ROUTE_PRINCIPLES.url}/${principle}`; await page.goto(url); - const mainContent = page.getByRole("main"); + const mainContent = page.locator("main"); + await mainContent.waitFor(); await expect(mainContent).toContainText( `Prinzip ${principles.indexOf(principle) + 1} in Regelungstexten`, ); @@ -32,7 +33,6 @@ test.describe("Digitaltauglichkeit main functionality", () => { }) => { const url = `${ROUTE_PRINCIPLES.url}/${principle}`; await page.goto(url); - await page.locator("main").waitFor(); const nextPrincipleIndex = principles.indexOf(principle) + 1; if (nextPrincipleIndex < principles.length) {