Reusable ActionsDirect link to Reusable Actions
Actions are named groups of steps that can be called from any test. They reduce duplication and make tests easier to maintain.
Defining an ActionDirect link to Defining an Action
Create a YAML file in .devassure/actions/:
# .devassure/actions/login_as_admin.yaml
name: login_as_admin
description: Login to the app as admin using Google
steps:
- Open admin portal url
- Click on Google login button
- Enter admin email and password
- If MFA is asked, enter the authenticator OTP
- If allow access is asked, click on allow access
| Field | Description |
|---|---|
name | Unique identifier used to call the action from a test |
description | Short description of what the action does |
steps | Ordered list of natural-language steps |
Using an Action in a TestDirect link to Using an Action in a Test
Reference the action by name in your test's steps list:
steps:
- login_as_admin
- add_manager_user
- Open users list page
- Verify if the manager user is added
Adding Actions from the SidebarDirect link to Adding Actions from the Sidebar
- In the Tests view, the actions tree is shown when
.devassure/actions/exists. - Right-click the actions root or a folder → Add Action to create a new action YAML from a template.