name: ‘step-04b-subagent-e2e-failing’ description: ‘Subagent: Generate red-phase E2E test scaffolds (TDD red phase)’ subagent: true
This is an isolated subagent running in parallel with API red-phase test generation.
What you have from parent workflow:
Your task: Generate E2E test scaffolds for the feature’s expected UI behavior. They stay in test.skip() until the developer activates them for the current task (TDD RED PHASE).
test.skip() until the developer activates themFrom the story acceptance criteria (Step 1 output), identify:
Example Acceptance Criteria:
Story: User Registration
- As a user, I can navigate to /register page
- I can fill in email and password fields
- I can click "Register" button
- System shows success message and redirects to dashboard
- System shows error if email already exists
Automation mode: config.tea_browser_automation
If auto (fall back to MCP if CLI unavailable; if neither available, generate from best practices):
playwright-cli -s=tea-atdd-{{timestamp}} open <target_url>
playwright-cli -s=tea-atdd-{{timestamp}} snapshot → map refs to Playwright locators
{role: "button", name: "Submit"} → page.getByRole('button', { name: 'Submit' }){role: "textbox", name: "Email"} → page.getByRole('textbox', { name: 'Email' })playwright-cli -s=tea-atdd-{{timestamp}} close when doneIf cli (CLI only — do NOT fall back to MCP; generate from best practices if CLI unavailable):
playwright-cli -s=tea-atdd-{{timestamp}} open <target_url>
playwright-cli -s=tea-atdd-{{timestamp}} snapshot → map refs to Playwright locators
{role: "button", name: "Submit"} → page.getByRole('button', { name: 'Submit' }){role: "textbox", name: "Email"} → page.getByRole('textbox', { name: 'Email' })playwright-cli -s=tea-atdd-{{timestamp}} close when doneSession Hygiene: Always close sessions using
playwright-cli -s=tea-atdd-{{timestamp}} close. Do NOT useclose-all— it kills every session on the machine and breaks parallel execution.
If mcp:
If none:
For each user journey, create test file in tests/e2e/[feature].spec.ts:
Test Structure (ATDD - Red Phase):
import { test, expect } from '@playwright/test';
test.describe('[Story Name] E2E User Journey (ATDD)', () => {
test.skip('[P0] should complete user registration successfully', async ({ page }) => {
// THIS TEST WILL FAIL - UI not implemented yet
await page.goto('/register');
// Expect registration form but will get 404 or missing elements
await page.fill('[name="email"]', 'newuser@example.com');
await page.fill('[name="password"]', 'SecurePass123!');
await page.click('button:has-text("Register")');
// Expect success message and redirect
await expect(page.getByText('Registration successful!')).toBeVisible();
await page.waitForURL('/dashboard');
});
test.skip('[P1] should show error if email exists', async ({ page }) => {
// THIS TEST WILL FAIL - UI not implemented yet
await page.goto('/register');
await page.fill('[name="email"]', 'existing@example.com');
await page.fill('[name="password"]', 'SecurePass123!');
await page.click('button:has-text("Register")');
// Expect error message
await expect(page.getByText('Email already exists')).toBeVisible();
});
});
CRITICAL ATDD Requirements:
test.skip() to mark tests as red-phase scaffoldsWhy test.skip():
test.skip() documents this is intentional (TDD red phase)test.skip() to verify green phaseIdentify fixtures needed for E2E tests:
Do NOT create fixtures yet - just track what’s needed for aggregation step.
Write JSON to temp file: /tmp/tea-atdd-e2e-tests-{{timestamp}}.json
{
"success": true,
"subagent": "atdd-e2e-tests",
"tests": [
{
"file": "tests/e2e/user-registration.spec.ts",
"content": "[full TypeScript test file content with test.skip()]",
"description": "ATDD E2E test scaffolds for user registration journey (RED PHASE)",
"expected_to_fail": true,
"acceptance_criteria_covered": [
"User can navigate to /register",
"User can fill registration form",
"System shows success message on registration",
"System shows error if email exists"
],
"priority_coverage": {
"P0": 1,
"P1": 1,
"P2": 0,
"P3": 0
}
}
],
"fixture_needs": ["registrationPageMock"],
"knowledge_fragments_used": ["fixture-architecture", "network-first", "selector-resilience"],
"test_count": 2,
"tdd_phase": "RED",
"summary": "Generated 2 red-phase E2E test scaffolds for user registration story"
}
On Error:
{
"success": false,
"subagent": "atdd-e2e-tests",
"error": "Error message describing what went wrong",
"partial_output": {
/* any tests generated before error */
}
}
Subagent completes when:
test.skip() (documented red-phase scaffolds)Subagent terminates here. Parent workflow will read output and proceed to aggregation.