From 67c8097a318d229948c7befe7af511a1e8740ccf Mon Sep 17 00:00:00 2001 From: giancarlo Date: Thu, 11 Apr 2024 18:25:42 +0800 Subject: [PATCH] Add waitForResponse for auth in e2e tests Introduced a waitForResponse function in the authentication end-to-end test file. This helps to ensure that the test doesn't proceed until a response from the auth URL is received, adding robustness to the test flow. --- apps/e2e/tests/authentication/auth.spec.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/e2e/tests/authentication/auth.spec.ts b/apps/e2e/tests/authentication/auth.spec.ts index b6bae3e14..2544a2faf 100644 --- a/apps/e2e/tests/authentication/auth.spec.ts +++ b/apps/e2e/tests/authentication/auth.spec.ts @@ -20,6 +20,10 @@ test.describe('Auth flow', () => { repeatPassword: 'password', }); + await page.waitForResponse(resp => { + return resp.url().includes('auth'); + }); + await auth.visitConfirmEmailLink(email); expect(page.url()).toContain('http://localhost:3000/home');