Test Case Steps
Our generated tests may have steps that are not needed or require a simple update to fit what you're looking for. Instead of deleting the entire Test Case, you have the ability to add, delete, and edit the Test Case Steps!
List of Test Case Steps
Every Test Case will have a Steps
tab that shows its list of steps and their order. To view this:
- Click on any Test Case within a Test Folder
- Click on the
Steps
tab
Edit or Add a Test Case Step
You can edit an existing step or add a step before or after any step in the Test Case. Remember, we use Playwright, so any valid Python Playwright should work! To get started, open the Steps
tab on any Test Case:
- Hover the step and click the
add
oredit
button that appears to the right - There are a few things you can fill in the modal:
- Step Name (required)
- Locate: Find a single element to interact with
- Act: Perform one or more actions on the element located
- Assert: Check one or more expectations
When editing a step, some of these fields will be auto-populated
Use Trace Viewer to Locate Elements
When using the Trace Viewer to locate elements, you can easily add steps that interact with elements without worrying about manual self-healing. If there's an element you don't want self-healed, make sure the self-healing toggle is disabled when adding a new step. Afterward, you can manually insert Playwright code for precision. The Trace Viewer allows you to locate an element and assert it in your code, saving you from manually inspecting the DOM or understanding complex CSS and XPath selectors. This makes it much simpler to include accurate element selectors in your test steps.
element = page.locator("[data-testid='button]")
element.click()
See Playwright's Docs to learn the different ways to locate elements