Test Automation Architecture Skill — QA Engineer
Overview
This skill provides comprehensive guidance for designing and implementing test automation frameworks. It covers page object patterns, test reporting, parallel execution, test data management, and test infrastructure following CTFL-TA and ISTQB Advanced Level certifications.
When to Use
Use this skill when:
- Designing test automation frameworks
- Implementing page object patterns
- Creating test reporting and dashboards
- Managing parallel test execution
- Setting up test data management
- Designing test infrastructure
- Implementing test framework best practices
- Creating test libraries and utilities
- Setting up CI/CD integration
- Designing test environment management
- Implementing test result analysis
- Creating test metrics and KPIs
- Designing test coverage reporting
- Implementing test flakiness reduction
- Setting up test monitoring
- Designing test data privacy
- Implementing test version control
- Creating test documentation
- Designing test failure analysis
- Implementing test performance optimization
- Setting up test orchestration
- Designing test scalability
- Creating test maintainability strategies
- Implementing test quality gates
Do NOT use this skill when:
- Writing application business logic (use domain-driven skill)
- Designing database schemas (use database-design skill)
- Writing API endpoint specifications (use api-design skill)
- Performing security audits (use security-auditor skill)
- Writing SQL queries (use sql-best-practices skill)
- Designing multi-page website layouts (use design-system skill)
- Analyzing deployment configurations (use deployment skill)
- Writing documentation (use documentation-best-practices skill)
Test Framework Architecture
Layered Architecture
┌─────────────────────────────────────────────────────────────┐ │ Test Framework Architecture │ ├─────────────────────────────────────────────────────────────┤ │ ┌──────────────────────────────────────────────────────┐ │ │ │ Test Layer (Tests) │ │ │ │ - Feature tests │ │ │ │ - Integration tests │ │ │ │ - Unit tests │ │ │ └──────────────────────────────────────────────────────┘ │ │ ┌──────────────────────────────────────────────────────┐ │ │ │ Support Layer (Utilities) │ │ │ │ - Test data builders │ │ │ │ - API clients │ │ │ │ - Database helpers │ │ │ └──────────────────────────────────────────────────────┘ │ │ ┌──────────────────────────────────────────────────────┐ │ │ │ Framework Layer (Base Classes) │ │ │ │ - Page objects │ │ │ │ - Test base classes │ │ │ │ - Assertions │ │ │ └──────────────────────────────────────────────────────┘ │ │ ┌──────────────────────────────────────────────────────┐ │ │ │ Tool Layer (Test Runner) │ │ │ │ - Test runner (Jest, Mocha, Pytest) │ │ │ │ - Reporting (Allure, HTML report) │ │ │ │ - CI/CD integration │ │ │ └──────────────────────────────────────────────────────┘ │ └─────────────────────────────────────────────────────────────┘
Page Object Pattern
typescript// ✅ Good: Page Object Pattern class LoginPage { constructor(private page: Page) {} async navigate() { await this.page.goto('/login'); } async fillEmail(email: string) { await this.page.fill('#email', email); } async fillPassword(password: string) { await this.page.fill('#password', password); } async submit() { await this.page.click('#login-btn'); } async isLoggedIn(): Promise<boolean> { return await this.page.isVisible('#dashboard'); } } // Test using Page Object test('user can login', async () => { const loginPage = new LoginPage(page); await loginPage.navigate(); await loginPage.fillEmail('user@example.com'); await loginPage.fillPassword('password123'); await loginPage.submit(); expect(await loginPage.isLoggedIn()).toBe(true); });
Test Data Management
Test Data Builder Pattern
typescript// ✅ Good: Test Data Builder class UserBuilder { private user: Partial<User> = { email: faker.internet.email(), name: faker.name.findName(), role: 'user', }; withEmail(email: string) { this.user.email = email; return this; } withRole(role: UserRole) { this.user.role = role; return this; } build(): User { return this.user as User; } async create(): Promise<User> { const user = this.build(); return await userRepository.create(user); } } // Usage const user = await new UserBuilder().withRole('admin').create();
Test Data Isolation
typescript// ✅ Good: Test data isolation beforeEach(async () => { await database.truncate(); }); afterEach(async () => { await database.truncate(); }); // ❌ Bad: Shared test data test('user creates order', async () => { // Uses same data as other tests const user = await User.find(1); });
Parallel Test Execution
Parallelization Strategy
┌─────────────────────────────────────────────────────────────┐ │ Parallel Execution Strategy │ ├─────────────────────────────────────────────────────────────┤ │ 1. Test Suite Splitting │ │ - Split by feature, module, or test type │ │ - Balance execution time across workers │ │ │ │ 2. Resource Isolation │ │ - Separate databases per worker │ │ - Isolated test data │ │ - Unique test identifiers │ │ │ │ 3. Test Ordering │ │ - Randomize test order │ │ - Run slow tests first │ │ - Group related tests │ │ │ │ 4. Retry Logic │ │ - Retry flaky tests │ │ - Track flakiness metrics │ └─────────────────────────────────────────────────────────────┘
Parallel Configuration
yaml# Example: Jest parallel configuration testEnvironment: node testRunner: jest-circus/runner maxWorkers: 4 workerIdleMemoryLimit: 512MB forceExit: false
Test Reporting
Reporting Dashboard
┌─────────────────────────────────────────────────────────────┐ │ Test Reporting Dashboard │ ├─────────────────────────────────────────────────────────────┤ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │ │ │ Total │ │ Passed │ │ Failed │ │ │ │ Tests: 150 │ │ Tests: 145 │ │ Tests: 5 │ │ │ └─────────────┘ └─────────────┘ └─────────────┘ │ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │ │ │ Duration │ │ Pass Rate │ │ Flaky │ │ │ │ 45s │ │ 96.7% │ │ Tests: 2 │ │ │ └─────────────┘ └─────────────┘ └─────────────┘ │ │ │ │ Test Results by Module: │ │ ┌─────────────┬─────────┬─────────┬─────────┐ │ │ │ Module │ Total │ Passed │ Failed │ │ │ ├─────────────┼─────────┼─────────┼─────────┤ │ │ │ Auth │ 25 │ 25 │ 0 │ │ │ │ Orders │ 30 │ 28 │ 2 │ │ │ │ Products │ 40 │ 40 │ 0 │ │ │ │ Users │ 35 │ 32 │ 3 │ │ │ └─────────────┴─────────┴─────────┴─────────┘ │ └─────────────────────────────────────────────────────────────┘
Test Metrics
┌─────────────────────────────────────────────────────────────┐ │ Test Metrics │ ├─────────────────────────────────────────────────────────────┤ │ Coverage Metrics: │ │ - Line coverage: 85% │ │ - Branch coverage: 78% │ │ - Function coverage: 90% │ │ - Statement coverage: 82% │ │ │ │ Quality Metrics: │ │ - Test pass rate: 96.7% │ │ - Test flakiness: 1.3% │ │ - Mean time to recovery: 5 minutes │ │ - Test execution time: 45 seconds │ │ │ │ ROI Metrics: │ │ - Bugs caught before prod: 45 │ │ - Time saved: 20 hours/week │ │ - Release frequency: 3x faster │ └─────────────────────────────────────────────────────────────┘
Real-World Impact
Before this skill:
- Ad-hoc test automation
- Flaky tests
- Poor test coverage
- No reporting
- Manual test execution
After this skill:
- Well-designed test framework
- Reliable, fast tests
- Comprehensive coverage
- Detailed reporting
- Automated parallel execution
Cross-References
testing-strategy- For test strategy and planningtdd-workflow- For test-driven developmentdevops-pipeline- For CI/CD integration


