13 Commits

Author SHA1 Message Date
Felipe Cardoso
568aad3673 Add E2E tests for security headers
- Implemented tests to verify OWASP-compliant security headers, including X-Frame-Options, X-Content-Type-Options, Referrer-Policy, Permissions-Policy, and Content-Security-Policy.
- Ensured deprecated headers like X-XSS-Protection are not set.
- Validated security headers across multiple routes.
- Updated Playwright configuration to include the new test suite.
2025-12-10 14:53:40 +01:00
Felipe Cardoso
fcbcff99e9 Add E2E tests for OAuth authentication flows and provider integrations
- Implemented comprehensive E2E tests for OAuth buttons on login and register pages, including Google and GitHub provider interactions.
- Verified OAuth provider buttons' visibility, icons, and proper API integration with mock endpoints.
- Added button interaction tests to ensure correct API calls for authorization and state handling.
- Updated `playwright.config.ts` to include the new `auth-oauth.spec.ts` in test configurations.
- Extended mock handlers in `overrides.ts` and `auth.ts` to support OAuth-specific API workflows and demo scenarios.
2025-11-25 10:40:37 +01:00
Felipe Cardoso
b49678b7df Add E2E tests for authentication flows and admin user management
- Implemented comprehensive E2E tests for critical authentication flows, including login, session management, and logout workflows.
- Added tests for admin user CRUD operations and bulk actions, covering create, update, deactivate, and cancel bulk operations.
- Updated `auth.ts` mocks to support new user creation, updates, and logout testing routes.
- Refactored skipped tests in `settings-profile.spec.ts` and `settings-password.spec.ts` with detailed rationale for omission (e.g., `react-hook-form` state handling limitations).
- Introduced `auth-flows.spec.ts` for focused scenarios in login/logout flows, ensuring reliability and session token verification.
2025-11-25 09:36:42 +01:00
Felipe Cardoso
a6a10855fa Refactor Playwright tests to use cached authentication state for improved performance
- Removed redundant `loginViaUI` calls across E2E tests, leveraging cached storage state for faster test execution.
- Enhanced Playwright configuration to include a `setup` project for pre-caching admin and regular user authentication states.
- Added new `auth.setup.ts` to handle initial authentication and save storage states to `.auth` directory.
- Increased local worker count to 16 (CI unchanged) to optimize parallel execution.
- Updated `.gitignore` to exclude authentication state files.
2025-11-08 20:46:59 +01:00
Felipe Cardoso
bf95aab7ec Optimize Playwright config and refactor E2E tests for reliability and performance
- Adjusted Playwright worker count (8 locally, 1 on CI) and fine-tuned timeout values for faster and efficient execution.
- Disabled unnecessary artifact capture (screenshots, videos) to reduce overhead during retries.
- Enhanced E2E test targeting with stricter element selectors to improve clarity and avoid ambiguities.
- Improved navigation tests by refining locators for header links (`Admin Demo`, `Login`) to prevent false positives.
- Added clipboard permission handling for demo credential copy tests, ensuring cross-browser compatibility.
- Skipped a known flaky test for password change form with a detailed TODO for further investigation.
2025-11-08 19:05:04 +01:00
Felipe Cardoso
e64b0e8085 Rebuild and expand E2E tests for Settings flows
- Updated Playwright config to enable 8 workers locally while maintaining single worker on CI.
- Rebuilt Settings Navigation E2E tests to verify page transitions and default redirects.
- Reintroduced Password Change E2E tests to validate form display and interactions.
- Expanded Profile Settings E2E tests to include email read-only verification.
- Marked Sessions Management E2E tests as skipped, pending route implementation confirmation.
2025-11-05 22:57:05 +01:00
Felipe Cardoso
f23fdb974a Refactor to enforce AuthContext usage over useAuthStore and improve test stability
- Replaced `useAuthStore` with `useAuth` from `AuthContext` across frontend components and tests to ensure dependency injection compliance.
- Enhanced E2E test stability by delaying navigation until the auth context is fully initialized.
- Updated Playwright configuration to use a single worker to prevent mock conflicts.
- Refactored test setup to consistently inject `AuthProvider` for improved isolation and mocking.
- Adjusted comments and documentation to clarify dependency injection and testability patterns.
2025-11-05 08:37:01 +01:00
Felipe Cardoso
77b914ffa2 Disable Firefox browser in Playwright config due to missing system dependencies. 2025-11-03 08:36:56 +01:00
Felipe Cardoso
54a14047be Enhance auth flows and improve e2e test reliability
- Remove redundant `'use client'` directives in auth pages to streamline code.
- Refine Playwright config: adjust worker limits and add video recording for failed tests.
- Improve session management in e2e tests with isolated state clearing, console log collection, and detailed failure attachments.
- Update API client: better handle auth routes, ensure safe token refresh, and prevent unnecessary redirects.
2025-11-03 00:02:27 +01:00
Felipe Cardoso
29ff97f726 Suppress non-essential console output in tests unless VERBOSE=true; adjust Playwright config to respect verbosity settings and use appropriate reporter. 2025-11-02 05:41:16 +01:00
Felipe Cardoso
e2a8656f81 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.
2025-11-01 15:49:28 +01:00
Felipe Cardoso
a95b25cab8 Enhance Playwright test coverage and refactor e2e authentication tests
- Improved validation checks with element ID and class-specific locators for better accuracy and resilience.
- Removed outdated form behaviors (e.g., "Remember me" and test-only shortcuts) for updated flows.
- Refactored test cases to reflect backend changes, and standardized password validation and error messages.
- Updated selector usage to leverage `getByRole` for improved accessibility testing.
- Reorganized and optimized test timeouts and interactivity delays for faster execution.
2025-11-01 13:12:15 +01:00
Felipe Cardoso
f117960323 Add Playwright end-to-end tests for authentication flows and configuration
- Added comprehensive Playwright tests for login, registration, password reset, and authentication guard flows to ensure UI and functional correctness.
- Introduced configuration file `playwright.config.ts` with support for multiple browsers and enhanced debugging settings.
- Verified validation errors, success paths, input state changes, and navigation behavior across authentication components.
2025-11-01 06:30:28 +01:00