API Testing CI Environment
This guide describes steps necessary for testing an API described in a swagger file with the Dredd API Testing Framework in a CI Environment (Jenkins, TeamCity).
Environment Prerequisites
The following must be available in the CI environment before testing:
Node.js runtime MUST be available in the CI environment:
Testing an API
Test Run Prerequisites
To test an API within the CI environment provisioned as mentioned in the environment prerequisites, you will need the following:
A
swagger.yaml
file with the description of API being testedThe OpenAPI Specifciation file should be fetched from API Design Platform. In the case of SwaggerHub API Design Platform, the file can be fetched manually or via their API. Refer to Integrating with the SwaggerHub API, for details how to use SwaggerHub API.
Alternativelly this can also be a remote file e.g. SwaggerHub URL, if the API is public its OAS file and reachable from the testing host.
The host (address) of the service being tested
Running the Test
Run:
The Dredd will perform the tests and exits usually if the tests have passed. You can check the test result as with any other Unix tools with:
Everything else but 0
should break the build. The test results will be visible in the CLI (log)
Last updated