forked from cardosofelipe/fast-next-template
Improve navigation and URL validation in Playwright authentication tests
- Replaced `waitForTimeout` with `Promise.all` for navigation events to improve reliability. - Updated URL assertions to support regex patterns for handling query parameters. - Adjusted worker count in `playwright.config.ts` for improved performance in local environments.
This commit is contained in:
@@ -47,7 +47,8 @@ test.describe('Registration Flow', () => {
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
// Should stay on register page (validation failed)
|
||||
await expect(page).toHaveURL('/register');
|
||||
// URL might have query params, so use regex
|
||||
await expect(page).toHaveURL(/\/register/);
|
||||
});
|
||||
|
||||
test('should show validation error for short first name', async ({ page }) => {
|
||||
@@ -92,7 +93,8 @@ test.describe('Registration Flow', () => {
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
// Should stay on register page (validation failed)
|
||||
await expect(page).toHaveURL('/register');
|
||||
// URL might have query params, so use regex
|
||||
await expect(page).toHaveURL(/\/register/);
|
||||
});
|
||||
|
||||
test('should show error for duplicate email', async ({ page }) => {
|
||||
|
||||
Reference in New Issue
Block a user