1) To explain the test strategy for automating a wordpress CMS site.
2) To validate and ensure an e-commerce website is fully functional, automated test cases should ensure key user flows are performing as expected using Nightwatch JS.
The user should be able to search for a product and add to cart.
- Based on
permalinks
configuration, assert for correctness. For instance, product permalinks contain the product name but hyphenated. This can be achieved making use of concatenation and textTransform. - Verify the arangement of the menu being used by making use of indexes. Assert for which comes first, second... (
nth item
approach works here). - For wordpress sites that handle authentication, the sign-up and sign-in fields should be tested. Positive and negative tests should be considered. For a login test, the following scenarios should be considered:
- Login with valid email and password
- Login with invalid email and password
- If invalid, assert for error toast message
- Check for leading and trailing whitespace
- Check for case-sensitivity for emails
- Use regex to check for valid and invalid emails
- If a product is deleted, verify that the url is no longer available.
- Verify that deleted users can no longer access their account.
- Verify that scheduled posts are published as planned. To automate this, a test script can be written and a cron job used to trigger the automated test at the stated time.
- Verify the appearance of the site on different browsers. This can be done manually by visiting the url on different browsers or by using device farms such as
Cross-Browser Testing and Kobiton
. - Verify mobile responsiveness on different devices.
- Use a secure password for the Wordpress admin (
/wp-admin
). - Change the admin password bi-weekly.
- API load testing using JMeter.
- Run a security test (scan) using OWASP ZAP.
-
Home Page should open and validate page title.
- Steps
- Open Homepage
- Verify page title
- Steps
-
Search Functionality is working.
- Steps
- Click on the home page search Box.
- Search for a specific product
- Assert a valid page result based on the searched product
- Steps
-
Add Product to cart
- Steps
- Search for a product
- Select quantity
- Click Add to cart
- Validate response message
- Steps
npm test --tag <tag name>
-Tags can be used to run similar tests and/or tests that are related.
npm test
Thanks and feel free to contribute or correct.