Suites

A suite encompasses a complete regression testing plan, from the individual test cases and their environments to the email notifications on failures.

Suites can be executed:

  • manually in the web application

  • through a periodic schedule

  • through the Suites API (i.e. to add to your CI/CD pipeline)

Suite execution results are stored and accessible during your account’s retention window.

Create a Suite

You can create a new suite from the main Suites List by clicking “Create Test Suite” and providing a name for the suite in the modal window.

From there, move on to building and configuring the suite as described in the following sections.

To delete a suite, use the dots menu on the suite detail page and accept the confirmation dialog.

Build a Suite

A suite is primarily a composition of workflow actions, and its execution follows a sequential path through the workflow, completing actions one at a time. API Hub for Test supports the following types of actions:

  • Run Tests - execute an ordered collection of tests sequentially or in parallel, and optionally apply configuration overrides to the test executions.

  • Decision - choose which of two workflow actions to execute next based on the pass/fail outcome of the previous action.

  • Call API - execute an HTTP request to an external system.

  • Send Email - send individual test failure emails, or a summary digest email describing the state of the suite execution.

  • Send Slack - send a Slack notification to a channel of your choosing that reports the state of the suite execution.

  • Wait - wait for some amount of time before continuing in the workflow.

When you create a new suite, API Hub for Test adds the default workflow, which consists of a Run Tests action followed by a Decision action. The Decision action has a Send Email action attached to its failure path. Thus, this workflow will execute 0 or more tests, and if any one of them fails, send a digest email to the users in your account.

AHfT_screenshot_CreateSuite_01.png

On the suite detail page, you can edit any action in the suite workflow by clicking on it to open the configuration panel on the right. To add new actions, click the (+) symbol anywhere in the workflow to open the actions panel on the left.

Run Tests

To change the tests or their order in a Run Tests action:

  1. Click the Run Tests block in the workflow

  2. Click the “Change” button to open the test modal

  3. Click “Add Tests” at the bottom of the modal to select tests to run and close the modal

    AHfT_screenshot_CreateSuite_03.png

    Use the “Details” panel dropdown to toggle the parallelism setting to execute tests.

Automatic retries

API Hub for Test supports the ability to automatically retry a Run Tests action a preconfigured number of times. This is helpful when the tests can't be run consistently or predictably.

To enable automatic retries, toggle on the “Retry on Failure” setting and choose a retry limit.

Note

If parallelism is enabled, multiple test cases or scenarios can run simultaneously within a single execution, reducing overall test duration.

If parallelism is not enabled, the tests will execute sequentially, one after the other, ensuring that each test completes before the next begins.

Click Save on the workflow to commit the updates.

Data-driven tests

Any test within a Run Tests action can be configured to run as a data-driven test. A data-driven test executes multiple “instances” of a particular test with different parameter values for each instance.

For example, a data-driven test allows you to verify that a given workflow within your application works as expected for the different role-based access controls (RBAC) defined in your application.

Consider the configuration below:

RE_Screenshot_Suites4.jpg

This setup instructs API Hub for Test to execute the “Create a Record” test that defines two parameters: username and password. This Suite is set up to run this test four times for four different usernames, each sharing the same password.

To create a data-driven variant, you must first define at least one parameter for your test so that you can override values sent to the test. Once a test has a parameter, a plus button will appear on this screen, allowing you to create data-driven variants. The default value for each parameter will be pre-populated but can be edited to contain whatever value you’d like, including containing a function or variable reference.

Each test instance will run and will appear in its own row in the “Tests” table on the suite execution detail page.

Note

API Hub for Test also supports running data-driven tests by uploading data from your own data store, such as a database or spreadsheet. Learn more in Suites API.

Share state across tests

In more advanced testing scenarios, you may need to use data created in an earlier test in one or more later tests.

For example, at the beginning of your Suite, you may want to execute a test that creates a new user and then log in as that newly created user in one or more subsequent tests.

To accomplish this, you can configure tests within a Suite such that a Parameter (for example, input) of a test references a Variable (for example, output) of a prior test. Within a Run Tests workflow action, click on Change Tests and then select the parameter of a test that needs to reference the state from a prior test. Choose to insert a variable, and you’ll be presented with an option to reference a variable from a prior test:

RE_Screenshot_Suites5.jpg

Within the modal, choose your desired variable by first selecting the Run Tests workflow action that contains the test you want to reference, then select the desired test, and finally select the desired variable associated with that test:

RE_Screenshot_Suites6.jpg

To reference a prior variable, its associated test must be guaranteed to execute before the test that’s referencing it. You can always reference variables in tests that are in a prior Run Tests workflow action. If the current workflow action has parallelism turned off, then you can also reference prior tests within the current Run Tests workflow action.

Call API

The Call API action issues a custom HTTP request to any Internet endpoint. All aspects of the request are configurable, and the HTTP response code of the request can be used in the subsequent Decision action in the workflow.

RE_Screenshot_Suites7.jpg

Send Email

The Send Email action can be configured to send either a summary digest email with the current status of the suite execution or individual emails for each test failure (thus far) in the suite execution. The digest email includes information about the following:

  • the test pass rate

  • the run time

  • the failed test steps for any failed test runs

Send Slack

The Send Slack action sends a notification to the channel of your choice that reports the current state of the suite execution. To use this workflow action, you must first connect your Slack workspace from within the Settings section of API Hub for Test.

Wait

The Wait action can be configured to delay execution for a certain amount of time before proceeding to the next step in the workflow.

RE_Screenshot_Suites8.jpg

Configure a Suite

The Run Tests action executes tests individually, so you can alter the environment or behavior of the browser for these test runs. The Define Environment Settings workflow action is at the start of every Suite workflow. It allows you to change the hostname and variables within the test definition to be executed, as well as set browser properties like Local Storage and cookie values.

RE_Screenshot_Suites9.jpg

Any execution overrides configured on the suite are re-evaluated for each Run Tests action. That is if you have a dynamic variable in the overrides and multiple Run Tests actions in the suite’s workflow, the dynamic variable will be generated twice.

Execute in different environments

It’s common to record tests against one environment, such as a dedicated QA or staging environment, and then run those tests against other environments (such as production). Using a hostname override, you can execute a suite against different environments without creating multiple tests or otherwise changing the workflow.

To execute a Run Tests action against a different environment:

  1. Click the Run Test Suite button on the suite detail page.

  2. Find the “Hostnames” section, enter the original hostname that the test was recorded with, and then enter the replacement hostname that the test run should load instead. You can replace multiple host names.

  3. Click the Run Suite button in the modal to execute the suite with the override.

  4. (optional) Save these overrides on the suite (as described above) and automatically apply them whenever they are executed.

    suite2.png

In the example above, we are replacing qa.example.com with staging.example.com:1234, which means that the replacement hostname specifies a different port for the destination hostname of 1234.

Note

When overriding a hostname, the URL path, protocol, and query parameters will remain the same. If a port was specified in the original URL, it will be preserved unless a new value is specified in the hostname override.

Additional overrides

HTTP query parameters can be applied to the test’s URL, enabling specialized behavior such as bypassing authentication flows with a short-lived token, as in Firebase’s auth tokens. This parameter will be appended to the start URL of each test when test execution begins. If the parameter is already present in the start URL, the parameter’s existing value will be overwritten.

Cookies, request headers, and browser storage are other types of overrides that can be saved on a suite or supplied at run-time.

Schedule a Suite

Along with on-demand invocation methods, you can schedule a suite to execute automatically within API Hub for Test.

To create a schedule:

  1. Click the “Change” button beneath the suite name.

  2. Select your desired schedule from the options in the modal and click the “Save” button:

RE_Screenshot_Suites11.jpg

API Hub for Test will automatically trigger a suite execution at the scheduled times.

Execute a Suite

To execute a suite, click the “Run Test Suite” button. This opens the Run Suite modal, which displays the default execution overrides configured for the suite. You can change these overrides in-line for this specific execution, as described in Configuring a Suite. When you click “Run Suite” to confirm the configuration, the suite execution is queued in API Hub for Test and you are redirected to the suite execution detail page.

Integrate with CI/CD

Suites can be executed automatically via our CI/CD integrations or by using API Hub for Test’s Suite API. Since every suite has a name, each suite also has a transformed identifier based on the name. The identifier (or “slug”) is a lower-case string that removes some special characters from the name and replaces spaces with a hyphen (-).

The suite identifier is shown at the top of the suite detail page next to the suite’s name:

RE_Screenshot_Suites12.jpg

Use this identifier (for example, regression-test-plan) as the suite-id when integrating with the Suites API or our CI/CD integrations.

View Suite Results

The execution detail page has four sections, all dynamically updated as the suite execution progresses.

RE_Screenshot_Suites13.jpg

Statistics

API Hub for Test provides high-level metrics for individual suite results, along with cumulative stats for a given suite and across all suites.

The following metrics are shown for individual suite results:

  • Total Tests: The number of test instances in this execution.

  • Test Pass Rate: The pass rate for all test runs within this execution.

  • Wall Clock Time: The time between initiating the suite execution and its completion or cancellation.

  • Cumulative Execution Time: The sum of individual execution time for all test runs within this execution.

The following metrics are shown when viewing the suite configuration page and represent cumulative stats for a given suite:

  • Total Executions: The number of executions of this suite in the past 30 days.

  • Test Pass Rate: The pass rate for all test runs within this suite in the past 30 days.

  • Avg. Suite Run Time: The average wall clock time from start to completion for all executions of this suite in the past 30 days.

  • Cumulative Execution Time: The sum of individual execution time for all test runs within this suite in the past 30 days.

The following metrics are shown when viewing the Suites list page and represent cumulative stats across all suites:

  • Total Executions: The number of executions across all suites in the last 30 days.

  • Test Pass Rate: The pass rate for all test runs within suite executions in the last 30 days.

  • Avg. Suite Run Time: The average wall clock time from start to completion for all executions in the last 30 days.

  • Cumulative Execution Time: The sum of individual execution time for all test runs within suite executions in the last 30 days.

Workflow

The Workflow section displays the current state of the workflow for this suite execution. If the suite execution is still running, you will see the workflow status update in real time.

You can click on any action in the workflow to open the detail panel on the right side in read-only mode. Once the execution is initiated, it cannot be modified.

Failures

The Failures section displays any test runs that have failed in the execution and the test step or test steps in the runs that failed. You can open the individual test run by clicking “View Test Run”.

Tests

The “Tests” table at the bottom displays the individual test instances in the suite, grouped by their browser and execution overrides. Within this section, you can toggle between a Data Driven view, which shows results in a condensed tabular format, or a Run Details view, which shows test results in a flattened list.

RE_Screenshot_Suites14.jpg

Re-run Failed Tests

When a suite execution completes and there are failed tests, you can re-run them within the suite execution. Thanks to that, you can edit or fix the tests while preserving the suite execution’s overrides or parameterized inputs. The re-run of the suite execution is treated as a new “attempt”, and is displayed on the same suite execution detail page as the original.

To re-run a suite with failed tests, view the suite execution detail page and click “Re-run Failed Tests”.

RE_Screenshot_Suites15.jpg

The new suite execution will only execute the failed tests, and the new test results will overwrite or update the suite execution’s overall results. One exception is that if newly passing tests cause a new Decision branch to be taken, that will execute tests or actions that didn't run initially. Once you've run the new suite execution, the combined results will be shown on the execution detail page by default. However, you can view previous execution attempts using the dropdown in the top right corner.

RE_Screenshot_Suites16.jpg

Cancel a Suite

A suite execution that is still in progress can be canceled by clicking the “Cancel Execution” button at the top right. Canceling an execution prevents any additional tests from being executed, regardless of the workflow action currently being executed.

Note

Tests that are already being executed will still run to completion, and their results will be saved and made available API Hub for Test.

Publication date: