write-real-e2e-test

Write Playwright end-to-end tests for live Werewolf game flows with CI-safe polling and isolation.

Updated Jun 25, 2025
One-click install
npx skills add https://github.com/wangdaqian08/werewolf-simple --skill write-real-e2e-test
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: write-real-e2e-test
Source: https://github.com/wangdaqian08/werewolf-simple/tree/main/.claude/skills/write-real-e2e-test
Command: npx skills add https://github.com/wangdaqian08/werewolf-simple --skill write-real-e2e-test

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you create, edit, and debug real-backend Playwright end-to-end tests without falling into the CI-only failures that commonly affect live game flows.

Core Features & Use Cases

  • CI-safe test design: Guides you to validate sub-phase transitions, use backend polling, and avoid timing-based assertions.
  • Real browser isolation: Encourages separate player contexts so multi-user gameplay tests stay deterministic.
  • Failure-resistant debugging: Points you to project memory, reusable helpers, and quarantine records so you can diagnose and fix flaky scenarios faster.
  • Use Case: You are adding a sheriff election or night-action spec under frontend/e2e/real/ and need it to pass locally and in CI without hidden race conditions.

Quick Start

Use this skill to review the target real-backend spec, confirm the relevant game phase logic, and rewrite the test so it waits on verified sub-phase state instead of fixed delays.

Frequently Asked Questions about write-real-e2e-test

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I stop Playwright end-to-end tests from failing in CI but passing locally?

Real-backend Playwright tests fail in CI when they rely on fixed delays instead of verified state. You can fix this by using CI-aware polling, confirming backend state transitions, and validating sub-phase completion before asserting gameplay outcomes.

What is the best way to test multiplayer gameplay flows with Playwright?

Multiplayer gameplay testing requires isolated browser contexts for each player. Creating separate Playwright contexts ensures multi-user interactions remain deterministic and prevents state bleed when validating complex phase transitions across multiple game iterations.

How do I write real-backend Playwright tests for game phase transitions?

You write real-backend tests by polling the live backend for verified sub-phase state instead of using hardcoded timing delays. This approach validates actual game phase transitions and keeps multi-iteration scenarios deterministic across different environments.

Why do my Playwright tests have hidden race conditions in live game flows?

Hidden race conditions occur when tests assert timing-based state rather than verified backend responses. Stabilizing tests requires waiting on confirmed sub-phase transitions, reusing established helpers, and updating quarantine records to track flaky scenarios.

Can I use Playwright to validate sheriff election and night-action gameplay specs?

Playwright can validate sheriff election and night-action specs against a real backend. The tests must use per-player browser isolation and backend state polling to ensure these complex gameplay flows pass deterministically in both local and CI environments.

How do I debug flaky end-to-end tests in a real backend environment?

Debugging flaky real-backend tests involves checking project memory, reusing existing test helpers, and reviewing quarantine records. This helps diagnose timing issues and rewrite assertions to wait for verified backend state rather than arbitrary delays.