From 2ad5f0883c1c3fa6704b16c0bc9ad19a7c6340d0 Mon Sep 17 00:00:00 2001 From: philipp Date: Fri, 19 Apr 2024 15:33:44 +0200 Subject: [PATCH] make clicking on 'create trip' button more robust (clicked on notification as this was the first .relative element --- frontend/tests/cox.spec.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/tests/cox.spec.ts b/frontend/tests/cox.spec.ts index c19ae45..d38dc96 100644 --- a/frontend/tests/cox.spec.ts +++ b/frontend/tests/cox.spec.ts @@ -8,7 +8,7 @@ test("cox can create and delete trip", async ({ page }) => { await page.getByPlaceholder("Passwort").fill("cox"); await page.getByPlaceholder("Passwort").press("Enter"); await page.locator('li').filter({ hasText: 'Geplante Ausfahrten' }).getByRole('link').click(); - await page.locator(".relative").first().click(); + await page.locator('a[href="#"]:has-text("Ausfahrt")').first().click(); await page.locator("#sidebar #planned_starting_time").click(); await page.locator("#sidebar #planned_starting_time").fill("18:00"); await page.locator("#sidebar #planned_starting_time").press("Tab"); @@ -38,8 +38,8 @@ test.describe("cox can edit trips", () => { await page.getByPlaceholder("Name").press("Tab"); await page.getByPlaceholder("Passwort").fill("cox"); await page.getByPlaceholder("Passwort").press("Enter"); - await page.locator('li').filter({ hasText: 'Geplante Ausfahrten' }).getByRole('link').click(); - await page.locator(".relative").first().click(); + await page.locator('li').filter({ hasText: 'Geplante Ausfahrten' }).getByRole('link').click(); + await page.locator('a[href="#"]:has-text("Ausfahrt")').first().click(); await page.locator("#sidebar #planned_starting_time").click(); await page.locator("#sidebar #planned_starting_time").fill("18:00"); await page.locator("#sidebar #planned_starting_time").press("Tab");