Importing from Postman, OpenAPI, and GraphQL

Build API tests from the specification you already maintain instead of retyping every endpoint.

Free plan and above
View as Markdown

If your API is already described somewhere, that description is the fastest way into Testsnag. Rather than recreating twenty endpoints by hand, import the collection or specification and start from requests that already have the right URLs, methods, headers, and example bodies.

  1. 1Postman: connect your account and import a collection.
  2. 2Connect starts the authorisation flow. It is a workspace-level connection.
  3. 3Imported requests become API test steps you then add assertions to.

What can be imported

  • Postman: connect your Postman account and pick a collection, or paste one in.
  • Swagger and OpenAPI: point Testsnag at a specification URL or upload the document.
  • GraphQL: register an endpoint and Testsnag introspects the schema for available operations.
  • cURL: paste a command copied from your browser’s network tab to create a single request.

Import is a starting point

An imported request knows how to call the endpoint. It does not know what a correct response looks like, and that is the part that makes a test worth running. After importing, add assertions on status codes and response bodies, and replace any hard-coded tokens with variables so the test is not tied to one expiring credential.

Collections often contain production credentials. Review what you import before saving, and move anything sensitive into a variable marked secret.

Keeping up with the spec

Importing is a snapshot, not a live link. When the specification changes, re-import to pick up new endpoints, and treat the tests you have already customised as yours to maintain rather than expecting them to update themselves.

Still stuck, or spotted something out of date?

Contact support