Skip to content

Add comprehensive Playwright E2E tests#72

Merged
CarterT27 merged 6 commits into
mainfrom
CarterT27/playwright-e2e-tests
Jan 21, 2026
Merged

Add comprehensive Playwright E2E tests#72
CarterT27 merged 6 commits into
mainfrom
CarterT27/playwright-e2e-tests

Conversation

@CarterT27
Copy link
Copy Markdown
Owner

Summary

Add 15 Playwright E2E tests covering critical user flows: session creation/joining, quiz lifecycle, lost signals, Q&A, and navigation. Tests run in parallel across desktop and mobile viewports (30 total), completing in ~22 seconds.

Key Features

  • Page Objects: 5 page objects encapsulate selectors and actions for each route
  • Multi-browser: Tests run on both Chromium desktop and mobile-Chrome viewports
  • Real-time DB: Tests safely run in parallel since each creates isolated Convex sessions
  • Performance: 4.5x faster with parallel execution (15s for desktop-only tests)
  • CI Integration: GitHub Actions workflow included with artifact uploads

Test Coverage

  • 4 navigation tests (home, teacher, join pages)
  • 4 session flow tests (create, join, invalid code, end)
  • 2 quiz flow tests (full lifecycle, ready indicator)
  • 2 lost signal tests (confusion meter, auto-chat)
  • 3 Q&A tests (open/close chat, submit question, placeholder)

- Add Playwright configuration with sequential test execution for Convex state consistency
- Create page objects for all major pages (teacher, student, join, home)
- Implement tests for session flow, quiz lifecycle, lost signals, Q&A, and navigation
- Add GitHub Actions workflow for CI/CD E2E testing
- Use robust selectors with proper waits for real-time Convex updates
- Add chatCloseButton locator for mobile full-screen chat X button
- Update closeChat to prioritize X button (works on both desktop/mobile)
- Update markAsNotLost to close chat first on mobile
- Fix selector for X button in AI Assistant header
- Enable parallel test execution (fullyParallel: true)
- Use 4 workers locally, 2 in CI
- Skip mobile tests by default locally (use MOBILE=true to include)
- Add test:e2e:mobile script for running with mobile viewport

Performance improvement:
- Local (chromium only): 1.1m → 15s (~4.5x faster)
- Full suite (with mobile): 1.1m → 22s (~3x faster)
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Jan 21, 2026

Deploying waitwhat with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7dcbd20
Status: ✅  Deploy successful!
Preview URL: https://e0b1d50f.waitwhat-e0v.pages.dev
Branch Preview URL: https://cartert27-playwright-e2e-tes.waitwhat-e0v.pages.dev

View logs

E2E tests require a live Convex backend which isn't available in CI
without credentials. Tests are designed to run locally during development.

- Remove .github/workflows/e2e.yml (causes CI failures)
- Add e2e/README.md with comprehensive test documentation
- Document how to run tests locally and prerequisites
- Explain test coverage and architecture

Tests run in ~15s locally with parallel execution.
The previous package-lock.json triggered a known npm bug with optional
dependencies causing Rollup to fail in the Cloudflare build environment.
Regenerated with fresh npm install to resolve the issue.

Fixes: Error: Cannot find module @rollup/rollup-linux-x64-gnu
The lockfile was generated on macOS and only includes darwin-specific
optional dependencies. Cloudflare Pages runs on Linux and needs
@rollup/rollup-linux-x64-gnu, which npm's optional dependency bug
(npm/cli#4828) prevents from being properly recorded cross-platform.

Without the lockfile, Cloudflare Pages does a fresh npm install that
generates correct platform-specific dependencies.
@CarterT27 CarterT27 merged commit adc8d95 into main Jan 21, 2026
2 checks passed
@CarterT27 CarterT27 deleted the CarterT27/playwright-e2e-tests branch January 21, 2026 23:17
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.

1 participant