Test Design
Keep tests focused and atomic
Keep tests focused and atomic
- “User can add item to cart”
- “Admin can create new user account”
- “Password reset flow works”
- “Test entire checkout including login, browsing, cart, payment, and confirmation”
- “Test all admin features”
Use descriptive test names
Use descriptive test names
[Actor] can [action] [expected result]Examples:- “Guest user can view product details without login”
- “Admin can delete user and see confirmation”
- “Cart preserves items after logout and login”
Test Organization
Organize by feature or user journey
Organize by feature or user journey
- “User Authentication”
- “Shopping Cart”
- “Checkout & Payment”
- “User Profile”
- “New User Onboarding”
- “Purchase Flow”
- “Account Management”
- “Critical Smoke Tests”
- “Full Regression”
- “Edge Cases”
Use consistent naming conventions
Use consistent naming conventions
[Feature/Area] Tests- “Authentication Tests”
- “Checkout Tests”
[Actor] can [action]- “User can login with valid credentials”
- “Admin can view all users”
[Role] - [Environment]- “Admin - Staging”
- “Customer - Production”
Separate critical paths from comprehensive coverage
Separate critical paths from comprehensive coverage
- Login/logout
- Core user journeys
- Revenue-generating flows
- 5-10 tests, < 5 minutes total
- All features
- Edge cases
- Integration tests
- 50-200 tests, 30-60 minutes total
Browser Profiles
Create role-specific profiles
Create role-specific profiles
- Admin profile (full permissions)
- Manager profile (limited admin)
- Standard user profile
- Guest/unauthenticated profile
- Premium/paid user profile
- Free tier profile
- Test permission boundaries
- Verify role-specific features
- Ensure proper access control
Keep profiles fresh
Keep profiles fresh
- Weekly: Critical test profiles
- Monthly: Less frequently used profiles
- After changes: Password updates, auth changes
Use test accounts, not real users
Use test accounts, not real users
- Separate from production users
- Clearly labeled as test accounts
- Document credentials securely
- Rotate passwords periodically
Using AI Features
Use the Swarm for initial coverage
Use the Swarm for initial coverage
- Run the Swarm with focused area
- Review all proposed tests
- Accept high-value tests
- Edit tests that need adjustment
- Reject low-value tests
- Supplement with manual tests for critical paths
Provide context to the Swarm
Provide context to the Swarm
- Detailed focus area descriptions
- Clear guidelines (what to avoid)
- Documentation URLs
- Feature descriptions
“Focus on the checkout flow including cart management, address entry, payment selection, and order confirmation. Don’t test admin features or account deletion.”
Review AI-generated tests critically
Review AI-generated tests critically
- Does it test important behavior?
- Are steps logical and complete?
- Are assertions meaningful?
- Is it redundant with other tests?
Maintenance
Fix broken tests immediately
Fix broken tests immediately
- Investigate within 24 hours
- Fix if it’s a legitimate failure
- Update if application changed
- Disable temporarily if can’t fix immediately
- Document why disabled
Review and prune regularly
Review and prune regularly
- Delete redundant tests
- Update outdated tests
- Remove tests for deprecated features
- Consolidate overlapping tests
Update after major changes
Update after major changes
- UI redesigns
- Feature changes
- Authentication updates
- URL structure changes
- Review affected tests
- Update selectors
- Adjust assertions
- Verify all tests pass
Performance
Keep tests fast
Keep tests fast
- Remove unnecessary waits
- Use appropriate timeouts
- Skip non-critical assertions
- Avoid testing same setup repeatedly
Run tests in parallel
Run tests in parallel
- Faster results
- Better resource utilization
- More frequent testing possible
Use browser profiles to skip authentication
Use browser profiles to skip authentication
Documentation
Document test assumptions
Document test assumptions
- What the test validates
- Prerequisites (data, state)
- Known limitations
- Why specific assertions exist
Track test ownership
Track test ownership
- Suite owners
- Test creators
- Feature experts
Team Practices
Make testing a team responsibility
Make testing a team responsibility
- Developers add tests for new features
- QA creates comprehensive suites
- Product reviews test coverage
- Everyone fixes broken tests
Review tests like code
Review tests like code
- Clear test names
- Appropriate assertions
- Proper organization
- No redundancy
- Good coverage
Celebrate test coverage wins
Celebrate test coverage wins
- Catching bugs before production
- Reaching coverage milestones
- Creating especially valuable tests
- Reducing flaky tests