Integration Testing

Number of APIs: 3

About this collection

Qodex allows you to test your APIs using simple Javascript code. You can evaluate your response body, headers, cookies, and more using the ChaiJS BDD syntax.

This collection guides you through the process of setting up an integration test to ensure that all individual components of an API function together seamlessly.

The API under test in this collection includes three endpoints for registering and receiving a token, accessing your unique generated name, and unregistering a token:

  • POST /register
  • POST /unregister
  • GET /my-name

By setting up requests in the order of the operation, we can test the flow of data to and from the endpoints and ensure they work together as expected. We also verify that the data persists between requests on the back end.

Using this collection

Step 1: Check out the requests' documentation to learn more about -

  • what each request is meant to do.
  • the tests we've added against each one.

Step 2: Run this collection by clicking on Run.

Step 3: To customize this collection, replace the request URLs with your API endpoints and add or edit the tests if needed.

Resources

[Scripting in Qodex]

[Test script examples]

[Qodex Sandbox API reference]

[Using the Collection Runner]

  1. Register POST {{baseUrl}}/register

  2. Get name GET {{baseUrl}}/my-name?token={{token}}

  3. Unregister POST {{baseUrl}}/unregister