From 1bdc1e0dbb0b37177cafec3cd3492dd5dee718f3 Mon Sep 17 00:00:00 2001 From: Aravinth Manivannan Date: Wed, 10 Jan 2024 20:58:58 +0530 Subject: [PATCH] fix: add sleep to wait for page to load --- tests/create-admin.spec.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/create-admin.spec.ts b/tests/create-admin.spec.ts index 12b5f1c..4bcc5c1 100644 --- a/tests/create-admin.spec.ts +++ b/tests/create-admin.spec.ts @@ -24,8 +24,11 @@ test("Create admin fixture @setup", async ({ page }) => { await page.getByLabel("Confirm Password").fill(admin.password); await page.getByRole("button", { name: "Register Account" }).click(); + await new Promise(r => setTimeout(r, 3000)); await page.waitForURL(config.INSTANCE_URL.toString()); + await page.locator(".positive > p:nth-child(1)").waitFor(); + expect(page.locator(".positive > p:nth-child(1)")).toContainText( "Account was successfully created. Welcome!" );