Skip to content

Playwright & UI Tests#3408

Merged
MuhammadKhalilzadeh merged 22 commits intodevelopfrom
mo-318-feb-23-advanced-test
Feb 24, 2026
Merged

Playwright & UI Tests#3408
MuhammadKhalilzadeh merged 22 commits intodevelopfrom
mo-318-feb-23-advanced-test

Conversation

@MuhammadKhalilzadeh
Copy link
Copy Markdown
Collaborator

Playwright & UI Tests

Please ensure all items are checked off before requesting a review:

  • I deployed the code locally.
  • I have performed a self-review of my code.
  • I have included the issue # in the PR.
  • I have labelled the PR correctly.
  • The issue I am working on is assigned to me.
  • I have avoided using hardcoded values to ensure scalability and maintain consistency across the application.
  • I have ensured that font sizes, color choices, and other UI elements are referenced from the theme.
  • My pull request is focused and addresses a single, specific feature.

MuhammadKhalilzadeh and others added 21 commits February 24, 2026 14:53
Built-in plugins (like dataset-bulk-upload) register routes directly in
Express and don't have remote code in the plugin marketplace. The
getDataFromProviders loop was attempting to load code for all installed
plugins, causing 404 errors for built-in plugins with __builtin__
sentinel paths.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add a defensive check at the top of downloadAndLoadPlugin to throw a
clear error if a built-in plugin with __builtin__ sentinel values
reaches this method. Prevents cryptic 404 errors and provides an
actionable message directing callers to check isBuiltinPlugin() first.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… errors

Replace console.error(..., error) with single-line messages that extract
only error.message plus status/url for Axios errors. Prevents hundreds
of lines of circular Axios error objects from flooding the backend
console on plugin load failures.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add stubs for window.matchMedia, IntersectionObserver, ResizeObserver,
and VITE_APP_API_BASE_URL that are required for MUI components to render
in the jsdom test environment without errors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add reusable test wrapper that provides Redux store, MemoryRouter, MUI
ThemeProvider, and React Query context. Accepts optional preloadedState,
store, and routerProps overrides for flexible test configuration.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add e2e exclusion pattern to avoid Playwright tests running in Vitest.
Set VITE_APP_API_BASE_URL env var for test environment. Lower coverage
thresholds to 10% for initial rollout.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add 8 tests covering variant rendering (success, error, warning, info),
toast close button visibility, and icon display per variant.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add 6 tests covering label rendering, checked/unchecked states,
onChange handler, size prop, and disabled state.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add 13 tests covering text/password/url/description input types,
password visibility toggle, error and helper text display, required
and optional indicators, and custom width styling.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add 4 tests covering redirect to /login without auth token, rendering
children with valid token, nested route rendering, and reloadTrigger
prop propagation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add 4 tests covering form field rendering (email, password), login
button, forgot password link, and register link presence.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add @playwright/test ^1.58.2, @axe-core/playwright ^4.11.1, and
@testing-library/dom ^10.4.1 as dev dependencies. Add test:e2e,
test:e2e:headed, and test:e2e:debug npm scripts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Ignore test-results/, playwright-report/, blob-report/,
playwright/.cache/, and e2e/.auth/ directories.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Configure sequential execution with 1 worker and 3 projects: setup
(global auth), auth-tests (unauthenticated), and chromium (authenticated
with stored state). Auto-starts Vite dev server on port 5173.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add global.setup.ts that performs UI-based login and saves storageState
for reuse. Add auth.fixture.ts with authedPage fixture that loads stored
auth state and navigates to the dashboard.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add 6 tests: login page rendering, unauthenticated redirect, successful
login flow, invalid credentials error, forgot password navigation, and
register link navigation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add 9 tests verifying authenticated navigation to all major pages:
dashboard, compliance tracker, risk management, model inventory,
settings, vendors, AI trust center, file manager, and policies.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add 3 tests covering vendor page title display, tab navigation
elements, and search functionality.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add seedTestData.ts that creates a test organization and admin user
(test@example.com / Test1234!) for E2E tests. Uses findOrCreate
semantics for idempotent execution.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add unit-and-component-tests job that runs vitest with coverage and
uploads coverage report as artifact.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add GitHub Actions workflow with PostgreSQL and Redis services that
builds the backend, runs migrations, seeds test data, starts the server,
and runs Playwright tests. Uploads HTML report on failure.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@MuhammadKhalilzadeh MuhammadKhalilzadeh self-assigned this Feb 24, 2026
@MuhammadKhalilzadeh MuhammadKhalilzadeh added enhancement New feature or request frontend Frontend related tasks/issues backend Backend related tasks/issues labels Feb 24, 2026
@MuhammadKhalilzadeh MuhammadKhalilzadeh added this to the 2.2 milestone Feb 24, 2026
The CI workflow starts the Vite dev server before Playwright runs. With
reuseExistingServer set to !process.env.CI (false in CI), Playwright
tried to start a second server on port 5173 and failed. Set to true
unconditionally so Playwright reuses any already-running server.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@MuhammadKhalilzadeh MuhammadKhalilzadeh merged commit 6e0cd8d into develop Feb 24, 2026
3 checks passed
@MuhammadKhalilzadeh MuhammadKhalilzadeh deleted the mo-318-feb-23-advanced-test branch February 24, 2026 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Backend related tasks/issues enhancement New feature or request frontend Frontend related tasks/issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants