Skip to content

[ADVANCED] Implement End-to-End Test Suite with Playwright for Critical User Flows #320

Description

@knoxiboy

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

  1. Authentication flow: Sign up -> sign in -> redirect to dashboard
  2. Doubt CRUD: Create doubt -> view doubt -> edit doubt -> delete doubt
  3. Reply flow: View doubt -> write reply -> upvote reply -> mark as solved
  4. AI Chat: Ask a question -> receive AI response -> view history
  5. Classroom management: Create classroom -> invite code -> join classroom

P1 - Should Have

  1. Public doubts: View public doubts feed -> filter by tag -> search
  2. Bookmark flow: Bookmark doubt -> view bookmarks -> unbookmark
  3. Profile: View profile -> update preferences -> check activity stats
  4. Admin moderation: Flag content -> admin review -> block user

P2 - Nice to Have

  1. Video generation: Generate video -> view video -> download
  2. Dark/light mode: Toggle theme -> verify persistence
  3. 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

  1. Install Playwright: npm install -D @playwright/test
  2. Create playwright.config.ts with base URL, auth state management
  3. Write test files for each flow using Page Object Model pattern
  4. Set up test database seeding/teardown
  5. 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.

Metadata

Metadata

Labels

aiAI prompts, models, moderationbackendAPI routes, database, server logicfrontendUI components, pages, stylinggssoc'26GSSoC program issuelevel:advancedAdvanced level taskpriority: lowCan be resolved when convenienttype:designDesign updatetype:testingTesting

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions