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.
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].”
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 VE test is easy.
- Open the test.
- Click the “Select action or embed a test” dropdown.
- Scroll down to find the test to embed.
You can also type to search for the 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:
- Open the parent test.
- From the Select action or embed a test dropdown, choose the embedded test.
- Save the steps.
Too Deeply Nested
When you reach 4 levels, you can’t select another embedded test; the dropdown displays Too Deeply Nested.
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.”
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.
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.
- Click the popout box to the right of the child test.
- The child displays in a new tab.
- Edit the child test.
Note: that after saving your changes, any parent containing the child is affected immediately.
Many tests begin with an embedded test, such as a login sequence. To embed a test in a parent:
- Hover your mouse on the step where you want to add the child.
- Click the plus icon (+) to add a step, then click the “Select action or embed a test” dropdown.
- Select the test you want to embed.
As with any test, you can move the embedded test up and down.
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.
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.
Updated 4 months ago