From face1a69593e07d3fc41f68083c6ca0924936ef5 Mon Sep 17 00:00:00 2001 From: Gregor Vostrak Date: Tue, 23 Jan 2024 15:51:50 +0100 Subject: [PATCH] try promiso all to avoid loading errors --- e2e/auth.spec.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/e2e/auth.spec.ts b/e2e/auth.spec.ts index 8d12be5f..c81be882 100644 --- a/e2e/auth.spec.ts +++ b/e2e/auth.spec.ts @@ -22,7 +22,11 @@ test('can register, logout and log back in', async ({ page }) => { page.getByRole('button', { name: "John's Organization" }) ).toBeVisible(); await page.locator('#currentUserButton').click(); - await page.getByRole('button', { name: 'Log Out' }).click(); + + await Promise.all([ + page.getByRole('button', { name: 'Log Out' }).click(), + page.waitForURL(PLAYWRIGHT_BASE_URL + '/'), + ]); await page.goto(PLAYWRIGHT_BASE_URL + '/login'); await page.getByLabel('Email').fill(email); await page.getByLabel('Password').fill(password); @@ -40,7 +44,10 @@ test('can register and delete account', async ({ page }) => { await page.goto(PLAYWRIGHT_BASE_URL + '/user/profile'); await page.getByRole('button', { name: 'Delete Account' }).click(); await page.getByPlaceholder('Password').fill(password); - await page.getByRole('button', { name: 'Delete Account' }).nth(1).click(); + await Promise.all([ + page.getByRole('button', { name: 'Delete Account' }).nth(1).click(), + page.waitForURL(PLAYWRIGHT_BASE_URL + '/'), + ]); await page.goto(PLAYWRIGHT_BASE_URL + '/login'); await page.getByLabel('Email').fill(email); await page.getByLabel('Password').fill(password);