Skip to main content

Test Flows

Overview of Test Flows

The “Test Flow” feature in Sparrow is designed to enable users to build and manage comprehensive test sequences for API behavior validation within their projects. This functionality is crucial for verifying API performance under various conditions and scenarios.

Different Ways to Add Test Flows

There are several methods to add a Test Flow connection in your application. Below are the primary approaches:

1. From Main Screen

Users can easily add a Test Flow connection directly from the main screen of the application. This method provides a straightforward interface, allowing for quick setup without navigating through multiple menus.

Usingvariables

2. From the Left-Panel Section

Users can also add a Test Flow from the left panel for quick access.

Steps:

  • Open the application.
  • Click the "+" button present on the left side of the panel.
  • Select the "Add Test Flow" option from the dropdown.

Usingvariables

3. From the Test Flows Section

Users can also add a Test Flow from the Test Flows section.

Steps:

  • Open the application.
  • Click the "Test Flow" option present on the left side of the panel.
  • Click on the "+ Add New Flow" option.

Usingvariables

Default Test Flow Interface

When the user clicks on "Add Flow," they will be directed to the Test Flow home page. This page includes several key elements:

  • Flow Name: A field to enter the name of the test flow.
  • Save and History Buttons: Options to save the current flow and view the history of previously created flows.
  • Start Button: This button initiates the test flow execution.
  • Add Block Button: Users can click this to add new blocks, allowing for the inclusion of multiple steps or scenarios within the test flow.

Usingvariables

How to Create a Test Flow

  1. Open the Sparrow Application: Launch the Sparrow application on your device.
  2. Click on "+ Test Flow": On the main menu, select the "+ Add Test Flow" option.

Usingvariables

  1. Add a Block: Click on the Add Block button to open a new block for adding APIs.

Usingvariables

  1. Select REST API: You can either drag and drop the REST API from the left panel or choose the required REST API from the dropdown menu in the block (Collection-Folder-REST API).

Usingvariables

Usingvariables

  1. Proceed to the Next Step: Click the Next button to continue adding the selected REST API to the flow.

Usingvariables

  1. Add API to the Flow: Complete the process by adding the selected REST API into the test flow.

Usingvariables

How to Edit or Delete API Blocks

Users have the capability to edit or delete API blocks within the test flow. Editing allows users to modify existing APIs to better fit their testing needs. If a block is no longer required or relevant, users can easily delete it, ensuring that the test flow remains organized and focused. This functionality enhances the flexibility and efficiency of managing test flows.

Edit/Change the API Present in the Block

To edit or change the API present in a block, follow these steps:

  1. Click on the API: Select the API present in the block that you wish to change.

Usingvariables

  1. Select New API Location: Choose the location of the new API by selecting the appropriate collection and folder.
  2. View Updated API: The newly updated API will appear in that block, reflecting your changes.

Usingvariables

Delete the Block

To delete a block, follow these steps:

  1. Click on the Three Horizontal Dots: Select the three horizontal dots present on the block that you want to delete.
  2. Choose the Delete Option: Click on the Delete option from the menu.

Usingvariables

  1. Confirm Deletion: A delete pop-up will appear. Click on Delete to confirm your action.

Usingvariables

  1. Impact on Subsequent Blocks: If there are blocks following the deleted block, those blocks will also be removed.

Usingvariables

How to Execute Created Test Flows

To execute the created test flow, you can use one of the following options:

  1. Click on the Start Button: Press the Start button to initiate the execution of the entire test flow.

Usingvariables

  1. Use the Run Button: After adding blocks to the flow, a Run button will appear in the user interface. Click on this Run button to execute the specific block within the flow.

Usingvariables

When you run the test flow, each block will execute sequentially. If the API call in a block is successful, that block will be highlighted in green, indicating a successful execution. Conversely, if the API call fails, the block will turn red, signaling an error in the execution. This color-coding helps users quickly identify the status of each step in the test flow.

Usingvariables

Upon completion of the Test Flow execution, a toast message will be displayed, indicating the number of tests that passed and the number that failed.

Usingvariables

How to Analyze Test Flows Results

Execution Time and Status Code

After the execution of each block, users will receive detailed information about the status code of the API call and the execution time measured in milliseconds. This data helps users assess the performance and reliability of each API request within the test flow.

Usingvariables

Detailed Execution History

After execution, if you want to see the detailed response of a specific block, simply click on that block. This action will display the request and response details, allowing you to review the results. You will also be able to perform various operations similar to those available in a REST API tool, enhancing your ability to analyze and troubleshoot the API interactions.

Usingvariables

How to View the Test Flows History

To view the previous execution history, simply click on the See History button located in the top right corner. The history will then open below, displaying all previous execution details.

Usingvariables

How to Save the Test Flows

To save the test flow, click on the Save button located in the top right corner. A success toast message will appear once the test flow is saved, confirming the action. You will then be able to see the saved flow in the left-hand side panel under Test Flows.

Usingvariables