Articles on: Running tests

How to RUN or REUSE test scripts from another test script

Using the TEST.run() command will allow the user to RUN or REUSE the test script in another test script.

Why should you use TEST.run command?

Using the TEST.run command will allow the user to use 1 test on multiple or different test scripts, this will greatly help the user to have a more efficient way of testing and editing the test.

Sample: A Login module that will be used in multiple cases or in different cases. Instead of creating a login module in each individual test scripts the user can create 1 test file for the login module and use the TEST.run command in other test script to import the login module as seen below.

This is a Step by Step procedure on how to use the TEST.run command in a basic way.

Step I: Create the "Login Module" test file and create the login flow inside it



Step II: Create another Test File where the TEST.run will be execute



NOTE: The placement of the TEST.run is important in this kind of scenario, when the TEST.run is placed on the lower part, the test will execute it after executing the I.wait and I.see commands.

Step III: Run and Observe the Test...



Notice that the Login Module flow (highlighted in the red box) has been imported and automatically executed the flow before the I.wait and I.see commands.

The above screenshot(s) showcases how to use and how the TEST.run works.

Updated on: 19/09/2023

Was this article helpful?

Share your feedback

Cancel

Thank you!