name: ‘step-03b-subagent-e2e’ description: ‘Subagent: Generate E2E tests only’ subagent: true
This is an isolated subagent running in parallel with API test generation.
What you have from parent workflow:
Your task: Generate E2E tests ONLY (not API, not fixtures, not other test types).
From the coverage plan (Step 2 output), identify:
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-automate-{{timestamp}} open <target_url>
playwright-cli -s=tea-automate-{{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-automate-{{timestamp}} close when doneIf cli (CLI only — do NOT fall back to MCP; generate from best practices if CLI unavailable):
playwright-cli -s=tea-automate-{{timestamp}} open <target_url>
playwright-cli -s=tea-automate-{{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-automate-{{timestamp}} close when doneSession Hygiene: Always close sessions using
playwright-cli -s=tea-automate-{{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:
import { test, expect } from '@playwright/test';
test.describe('[Feature] E2E User Journey', () => {
test('[P0] should complete [user journey]', async ({ page }) => {
// Navigate to starting point
await page.goto('/feature');
// Interact with UI
await page.getByRole('button', { name: 'Submit' }).click();
// Assert expected state
await expect(page.getByText('Success')).toBeVisible();
});
test('[P1] should handle [edge case]', async ({ page }) => {
// Test edge case scenario
});
});
Requirements:
Identify 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-automate-e2e-tests-{{timestamp}}.json
{
"success": true,
"subagent": "e2e-tests",
"tests": [
{
"file": "tests/e2e/authentication.spec.ts",
"content": "[full TypeScript test file content]",
"description": "E2E tests for user authentication journey",
"priority_coverage": {
"P0": 2,
"P1": 3,
"P2": 2,
"P3": 0
}
},
{
"file": "tests/e2e/checkout.spec.ts",
"content": "[full TypeScript test file content]",
"description": "E2E tests for checkout journey",
"priority_coverage": {
"P0": 3,
"P1": 2,
"P2": 1,
"P3": 0
}
}
],
"fixture_needs": ["authenticatedUserFixture", "paymentMockFixture", "checkoutDataFixture"],
"knowledge_fragments_used": ["fixture-architecture", "network-first", "selector-resilience", "playwright-cli"],
"test_count": 15,
"summary": "Generated 15 E2E test cases covering 5 user journeys"
}
On Error:
{
"success": false,
"subagent": "e2e-tests",
"error": "Error message describing what went wrong",
"partial_output": {
/* any tests generated before error */
}
}
Subagent completes when:
Subagent terminates here. Parent workflow will read output and proceed to aggregation.