Skip to main content

Reuse Steps Across Tests: Use Embedded Tests

See how to reuse the same steps across tests so you can update steps in one place and have all your tests up-to-date.

Written by Aaron Collier

Sometimes you have steps that may be repeated in multiple tests. For example, to sign in to go to a particular part of an app, to get to a certain environment, or to create a configuration. If you’re including these steps in multiple tests, it can be painful to update them everywhere. And doing it manually creates the risk that you leave the wrong steps some place.
​

Instead, use embedded tests to change the steps in one place and have them update in multiple tests. Then when the navigation in the app changes, you can just update the embedded test and all of your tests have the right information.

If you want to reuse small bits of content, such as a link to an environment, see how to reuse content across tests.

  1. In the Testlio platform, open the workspace where you want to reuse steps.

  2. Click Tests.

  3. Click New test.

  4. Give the test a name to find it later. You can agree with the team on a convention such as starting the name with [Embed].

  5. Add all of the steps needed. For example, three steps to navigate to a specific part of the app.
    ​

    A test with the title Embed Navigate to Issues report and three steps to take.
  6. If you agree on a standard label with the team, under Labels click + Add and add the agreed label.

  7. Open a test where you would like to reuse these steps.

  8. In the section where you want the reused steps, click Embed a test.

  9. Start typing the name of your test to find it. (This is why a naming convention can help.)

Your test is included with the embedded steps automatically renumbered to fit the test it is in.

A test with 5 steps, with steps 2 through 4 being part of the embedded test previously created.

Now if you ever need to change one of the steps, it will automatically be updated in all tests that use it.
​

You can also see where any test is embedded in the right sidebar under Embedded In… and the number of tests.

The sidebar of a test showing it is embedded in 1 other test with a link to the test, its ID, and its title.

In any test, you can only embed one given test once, but you can embed multiple tests. So Test A can include Test B only once, but it can also include Test C, Test D, and so on.

Did this answer your question?