diff --git a/tests/e2e/01-auth.spec.ts b/tests/e2e/01-auth.spec.ts new file mode 100644 index 000000000..2007fdba7 --- /dev/null +++ b/tests/e2e/01-auth.spec.ts @@ -0,0 +1,280 @@ +import { test, expect } from '@playwright/test'; +import { CONFIG, loginViaUI, navigateTo, assertNoDebugText } from './helpers'; + +test.describe('AUTH — Inscription', () => { + test('01. La page /register se charge correctement', async ({ page }) => { + await navigateTo(page, '/register'); + await expect(page.getByTestId('register-form')).toBeVisible({ timeout: 10_000 }); + await expect(page.locator('#register-username')).toBeVisible({ timeout: 5_000 }); + await expect(page.locator('#register-email')).toBeVisible({ timeout: 5_000 }); + await expect(page.locator('#register-password')).toBeVisible({ timeout: 5_000 }); + await assertNoDebugText(page); + }); + + test('02. Inscription avec email + mot de passe valides', async ({ page }) => { + await navigateTo(page, '/register'); + await page.getByTestId('register-form').waitFor({ state: 'visible', timeout: 10_000 }); + + const uniqueSuffix = Date.now(); + const uniqueEmail = `e2e-${uniqueSuffix}@veza.test`; + + const usernameInput = page.locator('#register-username'); + await usernameInput.waitFor({ state: 'visible', timeout: 5_000 }); + await usernameInput.fill(`e2e-user-${uniqueSuffix}`); + await page.locator('#register-email').fill(uniqueEmail); + await page.locator('#register-password').fill('SecurePass123!@#'); + await page.locator('#register-password_confirm').fill('SecurePass123!@#'); + + // Accept terms — Radix Checkbox renders a visible