Reusable Flow
A reusable flow (also known as a sub-test or child test) is a custom flow test which contains a set of steps that run inside other tests. This feature enables test reusability by allowing you to incorporate pre-defined flows into new tests, ensuring efficiency and consistency across test scenarios.
For example, if there is a login process used in multiple tests, you could create a reusable flow opens the login page, enters credentials, and clicks the login button. You can then include this flow as steps in other tests.
You can also create a reusable flow from a group of steps in an existing test. For example, if you have a test with steps to register and validate registration (e.g., open the registration page, fill in user details, and click Submit), you can turn these steps into a separate reusable flow and then add the flow to other tests.
By default, when you run a reusable flow from a parent test, the start URL step, visual assertions, and textual assertions are ignored.
To run a reusable flow, the test containing the reusable flow and the test that calls the flow must belong to the same application.
Running an Existing Reusable Flow
If you have previously created a reusable flow, such as a login test, you can run it as part of a new test.
To Run an Existing Reusable Flow
-
Open or create a new custom flow test.
-
Add a new user action step and type Run. When you press SPACE after the word Run, a list of other custom flow tests in the application appears.
-
Click the name of the reusable test to add it and press ENTER. The test is inserted inside the parent test. Use
or
to contract or expand the steps in the test.
-
To modify settings for the child test, click
> Settings, and change any of the following options:
-
Ignore start url step
-
Skip visual assertions steps
-
Skip textual assertions steps
-
-
Click Update or Create to save changes to the test.
Note that if you make changes to the steps in the reusable flow, the changes will affect all other tests that run the flow.
Creating a Reusable Flow from an Existing Test
You can extract steps from an existing test to create a new reusable flow, which can then be added to other tests. When you create a test from steps in a existing step, the system automatically adds a start URL step based on the test that it was created from.
To Create a Reusable Flow from an Existing Test
-
Open an existing custom flow test.
-
Click
to display a check box next to each step.
-
Select the required steps and click Create flow. Note that you cannot select step 1 (Go to Start URL) as this step is automatically created in the new test.
-
Enter a name for the new flow and click Create.
-
Autonomous creates a new flow. The start URL of the new flow is the same as the test that it was created from.
-
To add or remove steps in the reusable flow, next to a step click
> Move to child or Move to parent.
In the Tests page, you can filter the list to display only tests that run selected reusable flows.
If no filter is applied, the Ran by column on the Tests page shows a list of tests that include another test.