API Fortress is focused on API Quality. That means performance, uptime and accuracy. That last part is where we really differentiate ourselves. The metrics of an API call are important, but what we do better than anyone else is help verify the business logic behind the API. It’s more than schema validation, and requires zero coding.
Below, we will show you how to quickly create a test using an e-commerce API.
Let’s get started!
Step 1: Create a Project
When you first log in, you are introduced to the Company Dashboard. The company already contains a project called Examples with some example tests. Click “Create Project”.
Step 2: Create a Test
Step 3: Choose Your Test Creation Method
Once you have named your test you will be redirected to the Interstitial page. There are two avenues that you may take in building a test from here. First, you must decide if you want to build a test manually, API Fortress is very capable of building a test draft for you. This can be done from a Spec File, an Apiary account, or using the “Generate Test” button. Since this is a quick start guide, we will show you how to use the “Generate Test” button. To build using a Spec file see http://apifortress.com/doc/build-from-spec/, or from an Apiary account see http://apifortress.com/doc/build-from-apiary/.
Step 4: Create a Test Using the Generate Test button
Click on Compose.
Next, you will be presented with a tutorial on the Visual Composer. The final screen of the tutorial provides you with more instructions on how to create a test. Close the tutorial and open the Console by clicking on HTTP Client button in the left panel.
For this example we will use our own test API. It’s a simple GET request, so you can leave the dropdown as it is and enter the following url:
Once done, click the Send button and the response payload will appear.
Now, click the “Generate Test” button at the top left corner of the Console to generate a test draft.
The following screens will allow you to choose whether you want to create the input set based on the data provided in the request, and if you want Magic to generate the assertions. The final screen summarizes what was done. Press Continue on each screen.
At this stage, the test should be considered a draft. You should take a moment to verify each object, and/or add more logic to it. API Fortress has a lot of tools that allow for comprehensive continuous integration testing. Magic Test Generation is great at understanding datatypes and structure, which is often 90% of the work. For an example of adding more intelligence to a test, please see the Appendix at the bottom.