Skip to content

Add Playwright e2e tests for game interactions #50

Description

@moKshagna-p

Feature: Add e2e tests for game functionality

The repo currently has zero tests. We should add Playwright-based e2e tests covering the core game interactions.

Scope

Falling Words game:

  • Game starts on typing
  • Enter restarts from idle/game-over
  • Clicking game area refocuses input
  • Tab navigates through header/footer links normally
  • Game pauses on tab switch, resumes on return
  • Window blur/focus pause/resume
  • Word typing and submission
  • Difficulty switching
  • Game-over state and score display

Survival game:

  • Game starts on typing
  • Health system and damage
  • Enter restarts
  • Window blur ends game (production behavior — keep as-is)

Test structure

apps/frontend/e2e/
├── playwright.config.ts
├── fixtures/
│   └── game.ts          # shared helpers (start game, wait for game-over, etc)
├── falling-words/
│   ├── focus.spec.ts    # focus/click/tab/Enter behaviors
│   ├── pause.spec.ts    # visibilitychange pause/resume
│   └── gameplay.spec.ts # word typing, scoring, game-over
└── survival/
    └── gameplay.spec.ts

Infrastructure

  • Install @playwright/test as dev dependency
  • playwright.config.ts with webServer pointing at bun run dev
  • CI integration (add to .github/workflows/ci.yml)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions