Automated Testing for Websites: The Decisions That Matter
Tests that run automatically to check that features work, from unit tests for individual functions to end-to-end tests that drive a real browser.
On this page
At a glance
- Unit tests check small pieces of logic in isolation
- Feature or integration tests check routes, database behavior and components together
- End-to-end tests drive a browser through real user journeys
- Continuous integration runs tests automatically on every change
Why it matters
Why it matters: Automated tests catch regressions before customers do and make it safe to update dependencies and change code.
Best practice
- Test the journeys that make money first, such as checkout and sign-up
- Run tests automatically on every pull request
- Keep tests fast and reliable
- Add a test when fixing a bug
- Include accessibility checks in end-to-end tests
Common pitfalls
Watch out for:
- Flaky tests that are routinely ignored
- Testing implementation details that change often
- No tests for payment and authentication
- Tests that only run on one developer's machine
When to call in a specialist
Bottom line Bring in help when releases often break existing features, or when a codebase has no tests.
Where this comes from
- Laravel Documentation — Testing
- web.dev — Testing
The figures and practices above come from the sources listed.
Working on something like this?
We take on Web Design & Development work for teams who want it done once, properly. Tell us what you are building and we will tell you honestly whether we are the right studio for it. Start a project.
Where to go next
Spotted something wrong? Report an error on this page. We correct on the page and say what changed.