Build from Postman Collections

API Fortress can now generate a test from a Postman collection!

The first step is exporting your collection from within Postman.

collection

Next to your Collection name click the ellipsis (three dots) … then click Export and choose ‘Collection v2.’

export exportCollectionV2

Once you’ve exported the collection from Postman, go to API Fortress and create a New Test.

newTest

On the interstitial page, click Build from Spec.

buildFromSpec

On the following page, choose Postman Collection from the dropdown menu, and upload the collection file we exported. Click Save.

specFile

For a new test, choose From Scratch and then click the check. If you were updating a test, you would use the Merge option.

buildoptions

This imports the API call to the composer. Now we can use this to call the payload and build a test automatically!

testcreated

The easiest way to create a test is using our Magic tool. To do so you need to import the call into the console. First, select the call in the composer, which will highlight it. Open the HTTP Client and click the import button, highlighted below.

Screen Shot 2018-03-30 at 11.34.09 AM

When the call is in the console, click the Send button and you will see the response.

Screen Shot 2018-03-30 at 11.46.57 AM

At this point, the Magic tool can generate the test for you. Click the “Generate Test” button, highlighted in the image below. Click Continue a few times and voila, a complete API test generated without having to write any code.
Screen Shot 2018-03-30 at 11.43.58 AM

You can then review the test, seen below, and add some more logic. You’ve successfully created a test from a Postman collection!

Screen Shot 2018-03-30 at 11.34.58 AM

 

 

 

Build from Mashery

You can now generate a draft an API test from the I/O Docs in your Mashery account!

On the test interstitial page there is a “Build from Mashery” button. Click it, enter the Username, Password and Area ID from your Mashery account.

Area ID can be found when you login to your Mashery account. In the top right under Customer name.

Screen Shot 2017-04-06 at 7.00.07 AM Screen Shot 2017-04-06 at 7.00.16 AM

Choose the I/O Doc you want to use, and then click the lightning bolt.

You can also have API Fortress generate some assertions for you by using the ‘magic’ tool. From the composer, click the “import the request into the console” button from the top navigation. The HTTP console will open. From there insert the required values and make the call. Finally, click the Magic Wand icon (skip the global/input set generation step) and that’s it. An API test is created for you!

From here you can add more intelligence to the test. Maybe make it an integration test with more calls, or add an IF statement. A lot of options are at your disposal.

ezgif.com-video-to-gif

Build from Apiary

Introduction
If you have the right level Apiary account (any paid account), you can generate a test from your Apiary docs. It’s as simple as a few clicks.

Directions
This GIF pretty much explains it, but from the test composer interstitial page, there is a Build from Apiary button. Click it, login to your Apiary account, and choose which Blueprint to create a test from. Simple, right?

Don’t forget that this is a test draft. Add more logic to it for a really awesome test. Maybe add more calls to it as well to create a proper integration test.
build-from-apiary

Build from Spec (Swagger / Open API / RAML)

This feature allows you to create a test starting with a specification file.

From the interstitial page, choose the ‘Build from SPEC’ icon.

Note: this process deletes your working copy. Keep this in mind if you are attempting to use a specification file with a test that has already been written.

The available specification files you can choose from are: RAML 0.8, RAML 1.0, Swagger, API Blueprint, I/O Docs, Soap WSDL and Postman Collections.

There are two ways to build a test from a specification file. The first would be uploading the specification file itself. The second would be providing the URL that points to the specification file. The dropdown on the top right of the screen allows you to select your mode.

The file can be uploaded by dragging it into the middle of the window or by clicking on the middle of the window and selecting the file from the popup.

You may also reference the specification file with a URL. Selecting the URL field in the dropdown will open the SPEC URL field.

Once you have chosen the file type and the method, click the Save button and you will be redirected to the next step where the available endpoints are listed in a dropdown. Choose the one that you wish to test and click “Continue.” The test will then be created. You can now make any further adjustments, save and publish it for later use and scheduling.

Note: For RAML, we suggest uploading the entire zip file. Here’s an example video of building tests from a RAML file.