Logo
15 days of Postman - for testers API Documentation

Day 06: API tests

Number of APIs: 2


Instructions for Day 6: API tests

  1. Get the challenge: Fork the parent collection to your own public workspace.
  2. Read the documentation: Select the first folder. Expand the context bar on the right to follow the instructions in the collection documentation.
  3. 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


1. Submit your solution - submit collection

GET https://api.getpostman.com/collections/{{collection_uid}}

It's time to check your collection.

  1. Get the collection ID: Select the collection in the sidebar. Then in the context bar to the right, select the Info icon and copy the collection ID.

  2. Update the request URL: Update the collection_uid in the request URL with the collection ID from the previous step, using any method you prefer.

  3. Get your Qodex API Key: Create a new Qodex API Key and then open Qodex Vault (Accessed via the bottom right menu bar). Create a new Qodex Vault variable called Qodex_api_key and add your Qodex API Key as the Value.
    Once the changes are saved, Qodex will use the Qodex Vault variable to authorize your request as shown under the Headers tab of the request.

  4. Validate your solution: Hit Send and look under the Test Results tab of the server response at the bottom to review your test results.

If you have any failures, review the failed test results or ask for support in the [community forum] When all of your tests pass, you are done with today's challenge.



2. Submit your solution - submit api

GET https://api.getpostman.com/apis/{{api_uid}}

It's time to check your API.

  1. Get the API ID: Select the API in the sidebar (This is hidden by default and go be make visable in the Workspace settings). Then in the context bar to the right, select the Info icon and copy the API ID.

  2. Update the request URL: Update the api_id in the request URL with the API ID from the previous step, using any method you prefer.

  3. Get your Qodex API Key: Create a new Qodex API Key and then open Qodex Vault (Accessed via the bottom right menu bar). Create a new Qodex Vault variable called Qodex_api_key and add your Qodex API Key as the Value.
    Once the changes are saved, Qodex will use the Qodex Vault variable to authorize your request as shown under the Headers tab of the request.

  4. Validate your solution: Hit Send and look under the Test Results tab of the server response at the bottom to review your test results.

If you have any failures, review the failed test results or ask for support in the [community forum] When all of your tests pass, you are done with today's challenge.



ENDPOINTS