/qa-codegen
Phase: Advanced (not part of the main STLC path)
Command: /qa-codegen
Allowed tools: Bash, Read, Write
What it does
Generates runnable test code from the designs produced in Phase 3. Two output modes:
| Mode | Output | When to use |
|---|---|---|
| Playwright scripts | TypeScript .spec.ts files | When you want to run UI tests outside Claude Code in a CI pipeline |
| C# NBomber project | Full .NET project with Program.cs, scenarios, and fixtures | When load test scenarios require custom logic beyond what YAML supports |
This is not part of the guided STLC
/qa-codegen is an advanced utility. The main lifecycle runs tests through the CLIs directly - you don't need generated code unless you want to maintain tests as code artifacts in your repository.
Playwright script generation
Reads qa-reports/ui/ui-test.yaml and outputs Playwright TypeScript test files:
# Generates:
# qa-codegen/ui/login.spec.ts
# qa-codegen/ui/reset-password.spec.tsExample output:
import { test, expect } from '@playwright/test'
test('Login flow', async ({ page }) => {
await page.goto('https://app.example.com/login')
await page.fill('[data-testid="email"]', 'test@example.com')
await page.fill('[data-testid="password"]', 'TestPassword123')
await page.click('[data-testid="submit"]')
await expect(page.locator('[data-testid="dashboard"]')).toBeVisible()
})C# NBomber project generation
Reads load-tests/dq-nbomber.yaml and generates a full .NET project:
dq-nbomber codegen --config load-tests/dq-nbomber.yaml \
--output qa-codegen/perf/Generated project structure:
qa-codegen/perf/
MyApp.LoadTests.csproj
Program.cs
Scenarios/
LoginScenario.cs
ProductListingScenario.cs
Data/
test-users.csvOutput location
All generated code goes into qa-codegen/ - never into the application source tree. The safety hook will block any attempt to write to application source directories.
