If you’d like to trial mocking or load testing, please contact support or your API Fortress representative.
NOTE: API Fortress may be deployed in the cloud or on-premises via a container behind your firewall. Maintain complete test data ownership. Learn more about the differences between the two types of deployments.
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 https://apifortress.com/doc/build-from-spec/, or from an Apiary account see https://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.