Embedded tests are building blocks that make test creation and editing easier, faster, and more stable.
When creating a Visual Editor test suite, consider instructions that repeat across multiple tests or multiple times within a single test. 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.
Any test can be used as an embedded test, and any test can embed other tests. There are no additional actions or preparation that needs to be done. This allows for ultimate flexibility as the test suite is created and edited.
By embedding common instructions, test writing becomes faster. Consider this example. Your login process was updated with 2-factor authentication (2FA). If each test in the suite has its own login instructions, you must edit every test. But if the login instructions are contained in embedded tests, you only need to 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
As noted earlier, any test can be an embedded test. However, make sure to include all the steps necessary to accomplish a single task, such as logging in to an application. Remember that an embedded test is a building block to be used in other tests.
Create the test as you normally would. Ensure the steps provide a logical start and stop. The only thing left to do is embed the test in other tests. See How to Create a Visual Editor Test for more information.
You can create an embedded test by cutting-and-pasting steps from an existing test. You might decide to do it after creating your test suite or when there’s a significant change in functionality. When working on tests, repeating steps is bound to happen. Cutting-and-pasting makes test maintenance easier.
See our article on how to copy steps for more information on how to use existing steps to create a new embedded test.
Embedding a Visual Editor test is easy and can be done anytime.
- Open or create a test you want to work on.
- Click the Select action or embed a test dropdown at the step where you want to embed the test.
- Scroll down and select the test to embed.
You can also type to search for the test.
The test is now embedded. As with any other step in the parent, you can move the embedded test around and even remove it.
Editing an embedded test updates the steps across all the parent tests.
- Click the edit icon (pencil and paper) next to the embedded test.
- Make your changes.
- Click the Save Changes button.
- Click the “I’m aware, save my changes” button to confirm you want to update all parent tests.
Like any other step in a test, you can easily remove an embedded test.
- Click the checkbox next to the embedded test.
- Click Delete at the top.
- Click Delete in the Delete Action popup.
The embedded test is now removed from the parent. Note that the embedded test itself is not deleted. You can still use it elsewhere if needed.
Tests that are available to be embedded 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.
- You’ve reached the nesting limit.
Embedded tests are marked with an Embedded icon on the All Tests page for easy identification. The icon disappears if a test is no longer embedded in other tests. Use the Embedded Status filter on the All Tests page to view all currently embedded tests.
Remember that any test can serve as an embedded test. Functionally, there’s no difference between an embedded test and a non-embedded test. To make things easier, though, tests that are embedded:
- Can be filtered on the All Tests page by selecting “Embedded” from the Embedded Status option.
- Have the Embedded icon noted in front of the test name
If a test that was embedded is no longer embedded, its status and icon are updated automatically to be a “regular” test.
You update an embedded test like any other test. Choose the embedded test from the All Tests page and edit to make changes. Alternatively, you can select the embedded test directly from its parent test.
- Click the pop-out box to the right of the embedded test.
- The embedded test steps are displayed.
- Edit the embedded test.
- Click the back arrow at the top to return to the parent test. Save changes if needed.
- Click the X at the top to go to the All Tests page. Save changes if needed.
Note: Any changes made to the embedded test take effect immediately.
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.
- Open the test (that you want to embed another test into).
- From the Select action or embed a test dropdown, choose the embedded test to embed.
- Continue to edit as needed.
- Save the test.
Too Deeply Nested
When you reach four levels, you can’t select another embedded test; the dropdown displays Too Deeply Nested.
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 and run with the automation service, the embedded 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 a visual editor test has an embedded test as its first test and it's run with the tester community, then the
embedded test's start URL will be used.
If you have any questions, reach out to us at [email protected].
Updated about 2 months ago