fix: add sleep to wait for page to load

This commit is contained in:
Aravinth Manivannan 2024-01-10 20:58:58 +05:30
parent 47120c40b0
commit 1bdc1e0dbb
Signed by: realaravinth
GPG key ID: F8F50389936984FF

View file

@ -24,8 +24,11 @@ test("Create admin fixture @setup", async ({ page }) => {
await page.getByLabel("Confirm Password").fill(admin.password); await page.getByLabel("Confirm Password").fill(admin.password);
await page.getByRole("button", { name: "Register Account" }).click(); await page.getByRole("button", { name: "Register Account" }).click();
await new Promise(r => setTimeout(r, 3000));
await page.waitForURL(config.INSTANCE_URL.toString()); 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( expect(page.locator(".positive > p:nth-child(1)")).toContainText(
"Account was successfully created. Welcome!" "Account was successfully created. Welcome!"
); );