Skip to content

Frontend Testing ## Business Purpose Validate end-to-end user flows and UI functionality using Playwright, ensuring the application works correctly from a user's perspective. ## Current Behaviors - Authentication: auth.setup.ts:6 performs login once and stores session state.

  • Login Tests: login.spec.ts covers successful login, incorrect password, and password recovery.
  • Items Tests: items.spec.ts covers creating, editing, deleting items via the UI.
  • Admin Tests: admin.spec.ts covers admin user management flows.
  • User Settings Tests: user-settings.spec.ts covers profile update, password change, account deletion.
  • Reset Password Tests: reset-password.spec.ts covers email recovery and token reset.
  • Sign-up Tests: sign-up.spec.ts covers registration form and validation errors. ## Technical Implementation - Framework: Playwright with playwright.config.ts for parallel test execution.
  • Test Utilities: utils/user.ts provides signUpNewUser, logInUser, logOutUser; utils/random.ts generates random strings; utils/mailcatcher.ts intercepts emails; utils/privateApi.ts creates users via API.
  • Setup: auth.setup.ts:6 logs in and saves storage state for reuse.
  • Assertions: Uses Playwright's built-in assertions and custom testId locators.
  • CI Integration: Tests run in CI with headless browsers. ## Definition of Done - All E2E tests pass (npx playwright test exit code 0).
  • Login test verifies redirect to dashboard after successful login.
  • Item creation, edit, and deletion flows work end-to-end.
  • Admin can add, edit, and delete users.
  • Password recovery email is received and reset flow works.
  • Account deletion is successful with confirmation.