Day 06: API tests
Number of APIs: 6
Instructions for Day 6: API tests
- Get the challenge: Fork the parent collection to your own public workspace.
- Read the documentation: Select the first folder. Expand the context bar on the right to follow the instructions in the collection documentation.
- Submit your solution: Select the second folder and follow the instructions in the documentation to validate your solution.
Learning objectives
- Parse a response object
- Insert a test via snippet
- Write a custom Qodex test
- Use API calls to replicate a user scenario
- Add multiple assertions to a test
- Explain how Chai.js BDD syntax is used in Qodex
Concepts covered
- [Writing tests]
- [Test snippets]
- [Collection Runner]
- [Qodex sandbox] docs
Additional resources
- Review Test Results in Qodex video
- [Test script examples] in the docs
- [Intro to writing tests - with examples] sample collection
- Chai.js docs
- Continuous Quality webinar video
- Continuous Testing webinar video
-
API tests-Setup - Create User POST {{baseUrl}}/user
-
API tests-New user workflow - User Login POST {{baseUrl}}/user/login
-
API tests-New user workflow - User Logout GET {{baseUrl}}/user/logout
-
API tests-New user workflow - Account summary 2 GET {{baseUrl}}/account/:user_id/summary
-
Submit your solution - submit collection GET https://api.getpostman.com/collections/25941648-f76de1bf-cce8-4f28-a9f0-b3b760e0cafb
-
Submit your solution - submit api GET https://api.getpostman.com/apis/ceb444da-9f16-46d9-8764-f75baee11136