Visual Editor Embedded Tests

Learn how to include tests within tests to execute common instructions such as logging in.

Overview

Any test can leverage an embedded test as a building block. When creating a Visual Editor (VE) test suite, consider instructions that repeat across multiple tests. These may be complete processes, such as logging in to an app. Or they can represent a portion of a process, such as filling out a form.

By embedding common instructions, test writing becomes faster; you can update an entire test suite more efficiently. Consider this example. Recently, your team updated the login process with 2-factor authentication (2FA). If each test in the suite has its own set of login instructions, you must edit every test. But if the login instructions are contained in an embedded test, you only update once.

Common Use Cases

  • Login instructions
  • State setup steps
    Examples include setting up an account, adding items to your cart, and going through a checkout process.
  • Email confirmation

🚧

Embedded Test Types

When embedding tests, you can’t mix and match VE and Plaint-Text Editor (PTE) tests. In other words, a VE parent testparent test - A test that contains one or more child (embedded) tests. can only contain a VE child testchild test - A test that’s embedded in a parent test.. The same goes for PTE tests.

Creating a Visual Editor Embedded Test

When creating an embedded test, make sure to include the steps necessary to accomplish a single task, such as logging in to an application. Remember, an embedded test is a building block to be used in other tests.

Create the test as you normally would. For more information, see How to Create a Visual Editor Test. Ensure the steps provide a logical start and stop. Note that there’s no need to add a notation such as “[Embed]” or “[Stub].”

Identifying Embedded tests

Embedded tests are marked with an embedded icon on the All Tests page for easy identification. If a test is no longer embedded in other tests, the icon disappears. Use the Embedded Status filter on the All Tests page to view all your embedded tests.

Embedding a Test

Embedding a VE test is easy.

  1. Open the test.
  2. Click the “Select action or embed a test” dropdown.
  3. Scroll down to find the test to embed.
    You can also type to search for the test.
Embedding a Visual Editor test.Embedding a Visual Editor test.

Embedding a Visual Editor test.

Embedding a Test in Another Embedded Test

You can embed an embedded (child) test in another embedded test. This is referred to as nested embedded tests. Though the number of children you can embed in a parent is unlimited, you can only nest embedded tests up to 4 levels deep. Consider this example:

  1. Open the parent test.
  2. From the Select action or embed a test dropdown, choose the embedded test.
  3. Save the steps.

🚧

Too Deeply Nested

When you reach 4 levels, you can’t select another embedded test; the dropdown displays Too Deeply Nested.

Exceeding 4 levels of nesting.Exceeding 4 levels of nesting.

Exceeding 4 levels of nesting.

Here’s a suggestion, using the previous example. If you hit the nesting limit, try making “Embedded Test 5” another child of “Embedded Test 3.”

Can’t Find a Test?

Embedded tests are shown alphabetically at the bottom of the Select action or embed a test dropdown. Here are some reasons you might not be able to find a test:

  • The test no longer exists.
  • The test would cause a circular reference to occur.
  • The test isn’t embedded because you hit the nesting limit.

Updating Embedded Tests

You update an embedded test like any other test. To edit, choose the embedded test from the All Tests page. Alternatively, you can select the embedded test from its parent.

  1. Click the popout box to the right of the child test.
  2. The child displays in a new tab.
  3. Edit the child test.

Note: that after saving your changes, any parent containing the child is affected immediately.

Editing an embedded test.Editing an embedded test.

Editing an embedded test.

Embedding a Test

Many tests begin with an embedded test, such as a login sequence. To embed a test in a parent:

  1. Hover your mouse on the step where you want to add the child.
  2. Click the plus icon (+) to add a step, then click the “Select action or embed a test” dropdown.
  3. Select the test you want to embed.
An embedded test example.An embedded test example.

An embedded test example.

As with any test, you can move the embedded test up and down.

Previewing Embedded Test Steps

Click the checkbox next to the embedded test, then click the Preview Actions button to play the test actions. Note that you can expand the embedded test to aid in debugging.

Previewing an embedded test.Previewing an embedded test.

Previewing an embedded test.

Embedded Test Starting URL

A test’s starting URL is used to preload the platform for testing. When a test is embedded, its starting URL is ignored, and the parent’s URL is used instead. If an embedded test requires a specific URL, add a Navigate action and specify the URL.


If you have any questions, reach out to us at [email protected] or via the chat bubble below.


Related Articles & Links
Did this page help you?