Web testing practices
- Functionality Testing (business logic for API and UI)
- Usability and UI testing (manual testing)
- Compatibility testing (browser, OS, device)
- Performance testing (load, stress)
- Security testing (input validations, auth)
My notes: best practices from experience
- Tests should be independent from setup and teardown parts. You can use different implementations for these stages. Use try/except in teardown.
- Tests themselves should be independents.
- Sometimes you want your test to pass to behavior of backend, but sometimes you can make mistakes.
- Naming conventions need to be discussed. Classes, test methods.
- Config: API hosts, DB, users.
- Automation engineers sometimes need to duplicate the work of developers.
- Discuss in the beginning what to test, and how to test, what needs to be tested.
- Users → Authentication and authorization. Do you have roles?
- First test happy paths, then move to negative testing.
- It is okay to have duplicate code in test scripts. Don't overuse clean coding, keep WET not too much DRY. In the end, we should have maintainable, extensible and readable code.
- Validate RESPONSE body schema. Success responses and error responses. Validate status code.
- Create a document: how to write test methods, how to design test cases, how to name, how to run, what kind of branching use, where store and how to write manual test cases, how to review test cases, how to report bugs.