Skip to main content

Build from a Spec File

Using API Fortress's HTTP Client, you can generate tests from external endpoints or files such as an OpenAPI spec.

Supported Spec Formats
  • Currently supported: Swagger OpenAPI 3 Postman Collection
  • Pending: RAML API Blueprint I/O Docs SOAP WSDL

Generating a Test#

There are two ways to build a test from a specification file:

  • Upload the specification file itself.
  • Reference the URL that points to the specification file.

Both methods involve using the HTTP Client.

Upload a file#

From the project home page:

  1. Choose the HTTP Client button in the toolbar.

    HTTP Client Button
  2. In the Snapshots section select the arrow icon:

    Add spec file
  3. Select the desired file and finish by selecting Open:

    Select Desired File
  4. A prompt appears asking how the files should be imported, select the appropriate option:

    Select Desired Import
  5. Select the desired path in your project tree in which you wish to save the file/collection:

    Select Desired Path

    When you're finished select Save. Now you can view the test endpoints, as well as their respective components, by using the dropdown icons:

    Example versions endpoint
  6. Select the sample request, it populates in the HTTP Client with all the necessary details:

    Sample request
  7. Select the Send button and the response body appears:

    Response Body

    Select the Generate Test button. API Fortress then generates test component data based on the request and response data from the spec file. Below is the same example in both Visual and Code view:

    Code ViewVisual View
    Sample Test Code ViewSample Test Visual View

Reference the Spec File#

Coming Soon

This feature is available in the previous releases of API Fortress, stay tuned for more information