Description
DoubtDesk currently has zero automated end-to-end tests. The test.yml workflow exists but runs no meaningful tests. Critical user flows like doubt creation, AI chat, classroom management, and video generation have no automated verification, leading to silent regressions (like the video generation double-parse bug).
Scope
The following critical user flows need E2E test coverage:
P0 - Must Have
- Authentication flow: Sign up -> sign in -> redirect to dashboard
- Doubt CRUD: Create doubt -> view doubt -> edit doubt -> delete doubt
- Reply flow: View doubt -> write reply -> upvote reply -> mark as solved
- AI Chat: Ask a question -> receive AI response -> view history
- Classroom management: Create classroom -> invite code -> join classroom
P1 - Should Have
- Public doubts: View public doubts feed -> filter by tag -> search
- Bookmark flow: Bookmark doubt -> view bookmarks -> unbookmark
- Profile: View profile -> update preferences -> check activity stats
- Admin moderation: Flag content -> admin review -> block user
P2 - Nice to Have
- Video generation: Generate video -> view video -> download
- Dark/light mode: Toggle theme -> verify persistence
- Responsive layout: Test mobile viewport -> verify navigation
Affected Files
playwright.config.ts [NEW] - Playwright configuration
tests/e2e/ [NEW] - test directory
package.json - add Playwright dev dependency
.github/workflows/test.yml - update to run Playwright
Proposed Fix
- Install Playwright:
npm install -D @playwright/test
- Create
playwright.config.ts with base URL, auth state management
- Write test files for each flow using Page Object Model pattern
- Set up test database seeding/teardown
- Update CI workflow to run tests on PR
Complexity
Requires understanding Playwright testing framework, Next.js server startup for tests, Clerk auth mocking, database seeding strategies, and CI integration. The auth mocking alone is a significant challenge.
Description
DoubtDesk currently has zero automated end-to-end tests. The
test.ymlworkflow exists but runs no meaningful tests. Critical user flows like doubt creation, AI chat, classroom management, and video generation have no automated verification, leading to silent regressions (like the video generation double-parse bug).Scope
The following critical user flows need E2E test coverage:
P0 - Must Have
P1 - Should Have
P2 - Nice to Have
Affected Files
playwright.config.ts[NEW] - Playwright configurationtests/e2e/[NEW] - test directorypackage.json- add Playwright dev dependency.github/workflows/test.yml- update to run PlaywrightProposed Fix
npm install -D @playwright/testplaywright.config.tswith base URL, auth state managementComplexity
Requires understanding Playwright testing framework, Next.js server startup for tests, Clerk auth mocking, database seeding strategies, and CI integration. The auth mocking alone is a significant challenge.