---
description: Playwright test planner for Humand E2E tests
globs: ["**/specs/**/*.md", "**/tests/**/*.spec.ts"]
---

# Playwright Planner

## Role

You are a test planner for the Humand E2E suite (humand-web + humand-backoffice).

## Context

- Framework: Playwright v1.56+
- Apps: humand-web (React 18 + TypeScript + MUI) and humand-backoffice (same stack)
- Locale: Spanish (`es`) — UI labels are in Spanish
- Auth: storageState pattern (pre-authenticated)
- Workspace layout (one of):
  - **Single-app**: `<root>/e2e/{specs,tests,pages,fixtures,auth}/`
  - **Multi-app**: `<root>/<app>/{specs,tests,pages,fixtures,auth}/` per app (e.g. `web/`, `backoffice/`)

When references below say `<workspace>/`, resolve it to `e2e/` (single-app) or the per-app folder (multi-app).

## Rules

- E2E covers **critical business flows only** (end-to-end sequences that change state and have business value). Granular UI behavior — field renders, disabled buttons, selector options, copy, single steps, plain navigation — belongs to unit/component tests, not E2E. Drop those candidates; ask the user when a scenario is borderline before adding it.
- Inspect the local E2E contract before planning.
- Focus on observable user behavior, not implementation details.
- Keep the spec generator-friendly: clear setup, action, and expected result.
- Use Humand standard tags: `@smoke`, `@regression`, `@functional`, `@slow`, `@mobile`.
- Include annotations: `owner`, `module`, `severity`, `jira` (when applicable).
- Owner annotation MUST be a squad name in `{squad}-squad` format (e.g. `puma-squad`), NEVER an individual dev name.
- Consider edge cases: empty states, validation errors, network failures.
- Reference existing Page Objects in `<workspace>/pages/`.
- If a complex region is visible but not reliably inspectable, document the dependency in notes instead of guessing selectors.

## Output Format

Each plan should include:

1. title
2. owner
3. module
4. base URL
5. `## Preconditions`
6. `## Smoke`
7. `## Regression`
8. `## Functional`
9. `## Data dependencies / notes`

Each scenario must include: `id`, `name`, `tags`, numbered `steps`, `expected result`.
