Build and maintain automated test infrastructure for continuous testing. Use when setting up test frameworks, configuring CI test pipelines, implementing parallel test execution, test data management, reporting dashboards, or test environment provisioning.
Purpose: Build robust automated test infrastructure for continuous, reliable, and fast testing. Scope: Framework setup, CI integration, parallel execution, test data, reporting, environment management.
What test automation task?
+- New project setup?
| +- Which stack?
| | +- TypeScript/JS -> Jest or Vitest (unit) + Playwright (e2e)
| | +- Python -> pytest + playwright-python
| | +- C#/.NET -> xUnit + Playwright for .NET
| | +- Java -> JUnit 5 + Selenium/Playwright
| | +- Go -> testing package + testify
+- CI pipeline integration?
| +- GitHub Actions -> .github/workflows/test.yml
| +- GitLab CI -> gitlab-ci.yml
| +- GitLab CI -> .gitlab-ci.yml
+- Tests too slow?
| +- Parallelize across workers/shards
| +- Use test impact analysis (only run affected)
| +- Cache dependencies and build artifacts
+- Test data management?
| +- Factories for dynamic data generation
| +- Fixtures for static seed data
| +- Database snapshots for integration tests
+- Flaky tests?
| +- Quarantine, investigate, and fix
| +- Add retry with reporting (not silent retry)
+- Test reporting?
| +- JUnit XML for CI integration
| +- HTML reports for human review
| +- Coverage reports with thresholds
| Stack | Framework | Runner | Assertion | Mocking |
|---|---|---|---|---|
| TypeScript/JS | Vitest | Vitest | Built-in | vi.fn() |
| TypeScript/JS | Jest | Jest | Built-in | jest.fn() |
| Python | pytest | pytest | assert | unittest.mock / pytest-mock |
| C++ | GoogleTest | ctest | EXPECT** / ASSERT** | GoogleMock |
| Java | JUnit 5 | Maven/Gradle | AssertJ | Mockito |
| Go | testing | go test | testify/assert | testify/mock |
| Concern | Tool | Purpose |
|---|---|---|
| HTTP APIs | Supertest, httpx, RestAssured | API contract testing |
| Databases | Testcontainers | Isolated DB instances |
| Message queues | Testcontainers | Isolated broker instances |
| External services | WireMock, MSW, responses | HTTP mock servers |