YAML Step Reference
Use this page when generating .devassure/tests/*.yaml. Write Tests covers how to add files. This page is the schema and phrasing catalog.
O2 does not parse a keyword DSL. There is no closed verb list that the CLI rejects. Each step is plain English that the agent executes against the live page. The patterns below are the forms used in official examples — prefer them so generated tests stay unambiguous.
Do not put CSS selectors, XPath, test IDs, or Playwright/Cypress code in steps.
Test case schema
Files live under .devassure/tests/ as .yaml or .yml.
| Field | Required | Type | Notes |
|---|---|---|---|
summary | Yes | string | One-line intent. Shown in reports and used by filters/--query. |
steps | Yes | list of strings | Ordered. Each item is one action, one assertion, or one action name. |
priority | No | P0 | P1 | P2 | P3 | Reporting and --priority filters. Does not change execution order. |
tags | No | list of strings | For --tag filters (e.g. smoke, regression, login). |
summary: Login and verify dashboard
steps:
- Open the application url
- Log in with admin credentials from test data
- Verify dashboard loads and shows admin menu
- Log out
priority: P0
tags:
- smoke
- login
Several cases in one file — only when they belong to the same feature. Use a top-level YAML list:
- summary: Login and verify dashboard
steps:
- Open the application url
- Log in with admin credentials from test data
- Verify dashboard loads and shows admin menu
priority: P0
tags: [smoke, login]
- summary: Login welcome message includes the user name
steps:
- Open the application url
- Log in with admin credentials from test data
- Verify the welcome message contains the user name
priority: P2
tags: [login]
CSV uses the same fields as columns (Summary, Steps, Priority, Tags unless remapped in csv_mapping.yaml). See Write Tests.
Step rules
- One action or assertion per line. Do not combine "click Save and verify success" in a single step.
- Intent, not implementation. Write
Click Search, notclick the button with id #search-btn. - Do not hardcode the environment URL. Use
Open the application url/load the url. The base URL comes fromtest_data.yamlor--url. - Pull credentials and fixtures from test data. Write
Log in with admin credentials from test data, not a pasted password. - End every case with at least one verification. A flow with no
Verify/Validatestep has no pass/fail signal.
Navigation and load
| Pattern | Example |
|---|---|
| Open the app | Open the application url |
| Open a named surface | Open the users list page |
| Open a portal | Open admin portal url |
| Load (Cloud Agent phrasing) | load the url |
| Navigate | Navigate to checkout |
| Navigate to a form | Navigate to the property creation form |
| Go back | Click the back button to return to the property list |
Input
| Pattern | Example |
|---|---|
| Enter into a labeled field | Enter test-user@example.com in Email |
| Enter a value as a field | Enter "Sunset Villa" as the property name |
| Enter from test data | Enter admin email and password |
| Fill a flow | enter a destination |
| Select an option | Select "Available" as the status |
| Select a saved value | Select the saved payment method |
Clicks and UI actions
| Pattern | Example |
|---|---|
| Click a labeled control | Click Login |
| Click on a named control | Click on Google login button |
| Click a result | Click on the first property in the list |
| Click Save / Create | Click Save |
| Log in / log out | Log in with admin credentials from test data |
| Wait for UI | Wait for the property list to load |
Conditionals
Use If …, … when the UI may or may not appear:
- If MFA is asked, enter the authenticator OTP
- If allow access is asked, click on allow access
Enable the authenticator library tool when OTP is required. See Library Tools.
Assertions
Start assertion steps with Verify, Verify that, Verify if, or Validate.
Presence and load
| Pattern | Example |
|---|---|
| Page loaded | Verify if the page loads successfully |
| Screen shown | Verify Dashboard is displayed |
| Element shown | Verify that the property detail view opens |
| Empty / negative | Verify that no properties are displayed |
| Negative visibility | Verify UPI option is NOT visible |
| Reappearance | Verify UPI option becomes visible again |
Content
| Pattern | Example |
|---|---|
| Contains text | Verify the welcome message contains the user name |
| Exact listing | Verify that the newly created property appears in results |
| Count | Verify that the property count shows 2 results |
| Field values | Verify that the property price is displayed |
| Computed values | Verify Total due today equals (subtotal - discount) + tax |
Errors and APIs
| Pattern | Example |
|---|---|
| No UI errors | Verify if there are no error messages |
| Console | Verify that there are no blocking console errors |
| API | Verify that the login API returns success |
| Validation failed | Verify that validation errors are displayed for the required fields |
| Form did not submit | Verify that the form does NOT submit successfully |
Business outcomes
| Pattern | Example |
|---|---|
| Results match input | validate the search results are inline with the data entered |
| Combined filters | Verify that the results show properties matching ALL filters |
| Policy / copy | Verify the reply explains the refund rules in plain language |
Reusable actions
Actions are named step groups in .devassure/actions/. Call them by exact name as a step.
# .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
# in a test
steps:
- login_as_admin
- Open users list page
- Verify if the manager user is added
| Field | Required | Description |
|---|---|---|
name | Yes | Identifier used as a step in tests |
description | Yes | What the action does |
steps | Yes | Same natural-language steps as tests |
See Reusable Actions.
What not to write
# Wrong — selectors / automation API
- Click #login-btn
- page.locator('[data-testid=email]').fill('user@test.com')
- xpath=//button[@type='submit']
# Wrong — URL belongs in test_data.yaml or --url
- Open https://staging.myapp.com/login
# Wrong — two intents in one step
- Click Save and verify the success toast
# Right
- Open the application url
- Enter the default user email from test data in Email
- Click Login
- Verify dashboard loads and shows admin menu
Related
- Write Tests — adding YAML/CSV files
- Configuration files —
test_data.yaml,app.yaml, personas - Library Tools — faker, authenticator OTP
- Flutter Web Testing — same YAML; O2 unlocks Flutter semantics or uses visual reasoning