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:
Felipe Cardoso
2025-11-01 15:49:28 +01:00
parent ce5ed70dd2
commit e2a8656f81
4 changed files with 37 additions and 20 deletions

View File

@@ -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 }) => {