Automated Testing
Automated tests can be used to check features of the site are working correctly after changes have been made to the site.
To run automated tests we use behat, to learn how to use this read our guide to behat.
Browser Automation¶
There are different types a software testing, using browser automated testing gives us an accurate method of what a user will do when visiting a site. Read more about different types of testing here
Browser automation simulates running the site in a normal web browser to check the system is working from page load to clicking through the site. See the video below for a demonstration, notice how quickly we can run through different scenarios.
Testing the Critical Path¶
When we talk about the critical path we are talking about the most important journey a user will take when navigating your website.
In e-commerce we would consider the critical path to be:
- Homepage
- Product page works for each type of product
- Add to cart
- Checkout
- Offline payment method
- Order placed
Testing the critical path gives more confidence when deploying changes to a store. It is the smallest possible area to check and opens the door to add more tests in the future.
Automated tests using the critical path are not a guaranteed catch-all for issues on the site but will at the very least cover orders being created by customers.
The Importance of tests for an E-commerce store¶
If a user cannot complete the critical path then the site is not performing its core function - to allow a customer to place orders. If changes are made without testing we can break the critical path and stop orders coming in, running tests before will help to stop unnecessary breakages to the site.
The Benefits of Automated Testing¶
A big benefit of an automated test suite is the speed it run through a scenario compared to manual testing. Having automated tests to run when making changes can give piece of mind and take some of the nerves away from a deployment, giving us more confidence that the site will resume normal functionality right away.
Another benefit of automated testing is removing the unintentional focus when checking a new feature or bug fix. It is easy to fall into the trap of focusing on the changes we are expecting when testing and not thinking of the side effects, having an automated test suite helps us be sure the whole site is functioning and not just what has been under development.
Extending A Test Suite¶
Once the critical path is tested we can expand on the test suite checking different features on the site, this can include bespoke features which are unique to a website.