Architecture for test automation framework: tools + structure + practices.
Components:
1. Tool selection.
- Apex unit tests (mandatory for code coverage).
- Jest for LWC.
- Provar / Tosca / Selenium / Cypress for UI / end-to-end.
- Postman / Newman for API.
- JMeter / Gatling / k6 for performance.
2. Test pyramid.
- Many unit tests (Apex, Jest) — fast, cheap.
- Some integration tests — moderate.
- Few end-to-end — slow, expensive.
This shape minimises overall cost.
3. Test organisation.
- Naming conventions — predictable.
- Folder structure — by feature / module.
- Test data factories — centralised.
- Page objects / object repositories — for UI tests.
4. Reusability.
- Common helpers for login, navigation, data setup.
- Page object models for UI.
- Custom assertions for Salesforce-specific.
5. Configuration.
- Environment configs — sandbox URLs, credentials, feature flags.
- Test data configs — test data per env.
- Browser configs for UI.
6. CI/CD integration.
- Tests run on every commit / PR.
- Quality gates — coverage, pass rate.
- Reporting — visible to team.
7. Reporting.
- Dashboard — test results, trends.
- Failure diagnostics — screenshots, logs, videos.
- Stakeholder visibility — pass rate over time.
8. Maintenance.
- Owners per test suite.
- Update process — when feature changes, tests change.
- Flaky test management — tag, fix, or retire.
- Periodic review — remove obsolete.
9. Test environments.
- Scratch orgs for isolated runs.
- Dedicated test sandbox for full suite.
- Stable test data across runs.
10. Skills.
- Test automation engineers — write framework.
- QA analysts — write test cases.
- Devs — write unit tests.
Common pitfalls:
- Over-investing in UI tests — slow, fragile.
- Under-investing in unit tests — bugs missed.
- No framework — every test reinvents wheel.
- No reporting — can't see what's working.
- Flaky tests ignored — erodes trust.
Senior QA insight: automation framework is QA infrastructure. Invest deliberately. Pays back over years.
The senior framing: the test pyramid is a cost optimization. Minimum slow tests; maximum fast tests. Everything in between.
