Snapshot testing using Postman

Number of APIs: 1

πŸ“Š Get started here

Snapshot is a type of output comparison testing. This type of testing ensures that your API response adheres to the orginally accepted structure/value of your response.

This collection contains the script to facilitate Snapshot testing in Qodex along with 1 demo request.

πŸ”– How to use this template

To setup Snapshot Testing for your APIs you can use this collection as template.

Step 1: Send the request and get a response for the API you want to create a Snapshot test.

Step 2: Save the response as an Example to that request. This will work as your Snapshot.

Step 3: Create a Mock server on top of the collection.

Step 4: Update the snapshotURL in Collection Variables with the Mock server url that you created in the above step.

Step 5: This collection contains three different Snapshot testing strategies.

  • Response should have Snapshot as its subset (default)
  • Response should match its saved Snapshot
  • Response should match the JSON Schema generated from saved Snapshot

You can choose any of them according to your use case and your response structure.

ℹ️ Resources

[Snapshote testing using Qodex]

  1. Snapshot test demo GET https://postman-echo.com/status/200