Skip to main content

Create Your First Test

This page is a quickstart guide for getting up and running with the API Fortress tool. API Fortress may be deployed in our hosted cloud or self-hosted/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 walk through how to quickly create a test using an e-commerce API. Let's get started!

What You'll Need#

  • An API Fortress Account
Confirm your Email Address

You should receive an email with your login credentials from the platform. If you haven’t, please email us at support@saucelabs.com. If you’d like to trial mocking or load testing, please contact support or your API Fortress representative.

Step 1: Create a Project#

When you first log in, you are introduced to the Dashboard.

Select the Create Project tab.

Create a Project UI

Then enter your project details in the New Project window.

New Project Window

Select Save when finished.

Step 2: Create a Test#

After you create and name your project, select the Create Test button.

Create a Test button

Enter the details about your test and select Save.

Enter Test Details

Once you finish creating your test, you should see the Test Composer page.

Test Composer Page

There are two avenues that you may take in building a test from here:

  • Use the Visual Test Composer
  • Use the Live Code View

For the purposes of this quickstart guide, the next page walks through how to use the Visual Test Composer view.

Build Tests from Spec Files

To build tests using spec file(s) see: Build from Spec.

Step 3: Add Test Components#

The next step is to add the necessary test components when combined act as our test logic. Generally, there are two types of test components in API Fortress:

  • Request (I/O) Component
  • Assertion Component
Full Component List

Visit the I/O Components and Assertion Components sections for more details and descriptions of each test component.

For now, create a simple GET request and validate that response is correct.

Request Component#

Select the + Add Request / Assertions button.

Add Request Component

Select the GET request component.

GET request Component

Edit the following details:

  • Url: https://api.us-west-1.saucelabs.com/rest/v1/public/tunnels/info/versions - This URL returns a json response body.

  • Variable: payload - This variable stores the response.

    GET request fields

Leave the rest of the fields blank and select Save.

This is what the end result looks like:

GET request end result

Assertion Component#

Select the + Add Request / Assertions button.

Add Request Component

Select the Assert Exists assertion component.

Assert Exists Component

Edit the following details:

  • Expression: payload.downloads - This expression checks for the field "downloads" in the json response body.Assert Exists Details

Leave the rest of the fields blank and select Save.

Step 4: Run the Test#

  1. Before you run the test, select the Save icon save icon at the top of the Composer
  2. Then select the Run icon run test icon directly next to the Save icon
Test Composer Tool Bar

All test runs appear to the right of the Composer, underneath the test details and environment sections.

Test Runs Section

Viewing Test Results#

After the test completes, click on the test run and the test results page should appear. This page displays information regarding the test.

Test Outcome Report: Session details such as Date, Mode, and Execution Time

Event Details: Details about the input data, and other useful test information such as:

  • Did the test pass or fail?
  • Reasons for failure
  • HTTP request and response status codes
  • Assertion detailsTest Results Page

Additional Topics#

At this stage, this test is only 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.

Below are some topics worth exploration:

  • Check out the Example Snippets provided by the API Fortress Dashboard.
  • Learn how to import Postman Collections so that you may generate more tests.
  • Learn how to schedule a test here.
  • Learn about data and notifications connectors here. Simple solutions to plug into the systems you use today (e.g DataDog or New Relic).