Skip to content

Commit c006b9e

Browse files
committed
A comment
1 parent 953d25f commit c006b9e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

e2e/scripts/pageHelpers.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,9 @@ export const registerShopper = async ({page, userCredentials, isMobile = false})
183183
await page
184184
.locator("input#password")
185185
.fill(userCredentials.password);
186-
186+
187+
// Best Practice: await the network call and assert on the network response rather than waiting for pageLoadState()
188+
// to avoid race conditions from lock in pageLoadState being released before network call resolves
187189
const tokenResponsePromise=page.waitForResponse('**/shopper/auth/v1/organizations/**/oauth2/token')
188190
await page.getByRole("button", { name: /Create Account/i }).click();
189191
await tokenResponsePromise;

0 commit comments

Comments
 (0)