Best Practices
Guidelines to keep suites fast, clear, and maintainable.
- Keep tests focused: one intent per test.
- Prefer
assertionswith Contains over exact bodies to reduce brittleness. - Store only values you need; name variables clearly.
- Use
body_filefor large payloads; keep fixtures small and reusable. - Centralize auth and headers in
[config].default_headers. - Add hooks sparingly; whitelist only necessary commands.
- Use
--filterlocally for fast feedback and--debugwhen stuck. - Record performance budgets with
max_response_timefor critical endpoints. - Separate suites per environment with dedicated test files.