Skip to content

Commit

Permalink
fix: Changed the Playwright Test to be tolerant for url params
Browse files Browse the repository at this point in the history
  • Loading branch information
FleetAdmiralJakob committed Mar 23, 2024
1 parent 7dccfbd commit a0e1188
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/e2e-web-tests/tests/main-workflow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ test("main workflow", async ({ page }) => {
await page.waitForSelector("button[aria-label=Munich]");
await page.press("input[type=text]", "Enter");

await page.waitForURL("**/home");
await page.waitForURL(/^http:\/\/localhost:3000\/home(\?.*)?$/);

expect(page.url()).toBe("http://localhost:3000/home");
await expect(page).toHaveURL(/^http:\/\/localhost:3000\/home(\?.*)?$/);

await expect(
page.locator("h1").filter({ hasText: "Munich" }).first(),
Expand All @@ -31,9 +31,9 @@ test("main workflow german city name", async ({ page }) => {
await page.waitForSelector("button[aria-label=München]");
await page.press("input[type=text]", "Enter");

await page.waitForURL("**/home");
await page.waitForURL(/^http:\/\/localhost:3000\/home(\?.*)?$/);

expect(page.url()).toBe("http://localhost:3000/home");
await expect(page).toHaveURL(/^http:\/\/localhost:3000\/home(\?.*)?$/);

await expect(
page.locator("h1").filter({ hasText: "München" }).first(),
Expand Down

0 comments on commit a0e1188

Please sign in to comment.