Skip to content

e2e Tests - admin panel, RBAC & GHA - #903

Merged
rchlfryn merged 32 commits into
mainfrom
tests
Feb 16, 2026
Merged

rchlfryn merged 32 commits into
mainfrom
tests

Conversation

@busbyk

@busbyk busbyk commented Jan 30, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Adds a comprehensive Playwright E2E test suite for the admin panel, covering login, logout, tenant selector behavior across user roles type and verify what they can/cannot access, and tenant cookie edge cases.

Also adds the E2E job to CI to only run on merge.

Related Issues

Foundational e2e test infrastructure Fixes #866

Key Changes

Test files (7 spec files, 18 supporting files):

  • login.e2e.spec.ts — Login for all user roles, invalid credential errors, logout via nav button
  • role-based.e2e.spec.ts — Tenant selector visibility/options for super admin, multi-center admin, single-center admin
  • tenant-required.e2e.spec.ts — Tenant selector on list/create/edit views for tenant-scoped collections
  • global-collections.e2e.spec.ts — Tenant selector on collections with unique: true (settings, navigations, homePages)
  • non-tenant.e2e.spec.ts — Tenant selector hidden on non-tenant collections (users, tenants, etc.)
  • payload-globals.e2e.spec.ts — Tenant selector hidden on Payload globals
  • tenant-cookie-edge-cases.e2e.spec.ts — Behavior with no cookie, invalid cookie, cleared cookie

Test infrastructure:

  • Fixtures: auth.fixture.ts, tenant-selector.fixture.ts, nav.fixture.ts, test-users.ts
  • Helpers: login.ts (retry-based login), admin-url.ts, select-input.ts (react-select), tenant-cookie.ts, save-doc.ts
  • playwright.config.ts with admin and frontend projects
  • docs/testing.md — setup, running, writing tests, known issues

CI:

  • New e2e job in ci.yaml: seeds DB, builds, starts server, runs Playwright tests, uploads report artifact

Other:

  • Refactored LogoutButton to a client component (was needed for button-based logout)

How to test

# Setup (one-time)
pnpm exec playwright install chromium
pnpm seed:standalone

# Start dev server
pnpm dev

# Run all e2e tests
pnpm test:e2e

# Run specific file
pnpm test:e2e -- __tests__/e2e/admin/login.e2e.spec.ts

# Interactive UI mode
pnpm test:e2e:ui

Screenshots / Demo video

N/A — test suite

Future enhancements / Questions

  • Frontend tests: The frontend Playwright project is configured but has no tests yet
  • test.fixme logout test: /admin/logout direct navigation doesn't redirect to login without Edge Config — needs investigation

busbyk and others added 4 commits January 28, 2026 17:06
- Install @playwright/test and configure Chromium
- Add playwright.config.ts with admin and frontend projects
- Create test fixtures: test-users, auth, and tenant
- Add npm scripts for running E2E tests
- Update .gitignore for Playwright artifacts

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

@rchlfryn
rchlfryn added this pull request to the merge queue Feb 16, 2026
Merged via the queue into main with commit 010ab8d Feb 16, 2026
9 checks passed
@rchlfryn
rchlfryn deleted the tests branch February 16, 2026 20:57
@github-actions

Copy link
Copy Markdown
Contributor

🚀 This is included in version v1.9.0

This branch was previously deployed

1 inactive deployment
Preview — 9116aeed Deployed Feb 16, 2026 by rchlfryn via deploy #1474
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Baseline integration test suite using Playwright or Puppeteer

2 participants