Skip to main content

Step Quick Reference

All available steps at a glance. Click step names for detailed documentation.

API Steps (@api or @hybrid)

StepDescription
When I GET {string}Send GET request
When I POST {string} with JSON body:Send POST with JSON
When I PUT {string} with JSON body:Send PUT with JSON
When I PATCH {string} with JSON body:Send PATCH with JSON
When I DELETE {string}Send DELETE request
Then the response status should be {int}Assert status code
Then the response should be a JSON objectAssert JSON object
Then the response should be a JSON arrayAssert JSON array
Then the value at {string} should equal {string}Assert JSON value
Then the value at {string} should contain {string}Assert value contains
Then the value at {string} should match {string}Assert regex match
And I store the value at {string} as {string}Store response value
Given I am authenticated as an admin via APIAdmin auth
Given I am authenticated as a user via APIUser auth
Given I set header {string} to {string}Set request header

Full API Steps Reference


UI Steps (@ui or @hybrid)

StepDescription
Given I navigate to {string}Go to URL path
Given I open {string} pageOpen page
When I go back in the browserBrowser back
When I reload the pageRefresh page

Clicking

StepDescription
When I click the button {string}Click button by name
When I click the {string} buttonClick button (alt syntax)
When I click the link {string}Click link by text
When I click the element {string}Click by CSS selector

Form Input

StepDescription
When I fill the field {string} with {string}Fill by label
When I fill in {string} with {string}Fill by label (alt syntax)
When I fill the placeholder {string} with {string}Fill by placeholder
When I select {string} from dropdown {string}Select dropdown option
When I fill the form:Fill multiple fields

Assertions

StepDescription
Then I should see text {string}Assert visible text
Then the URL should contain {string}Assert URL contains
Then I should be on page {string}Assert URL (alt syntax)
Then the element {string} should be visibleAssert element visible
Then the element {string} should not be visibleAssert element hidden
Then the element {string} should have value {string}Assert input value
Then the element {string} should be checkedAssert checkbox checked
Then the element {string} should not be checkedAssert unchecked

Waiting

StepDescription
Then I wait {string} secondsWait fixed time
Then I wait for the page to loadWait for load states

Debugging

StepDescription
When I pause for debuggingOpen Playwright Inspector
Then I log the current URLPrint URL
Then I print visible textPrint page text
Then I save a screenshot as {string}Capture screenshot

Full UI Steps Reference


TUI Steps (@tui)

StepDescription
When I spawn the terminal with {string}Start terminal with command
When I type {string} in terminalType text
When I press Enter in terminalPress Enter key
When I press {string} in terminalPress any key
When I send Ctrl+C to terminalSend interrupt
Then I should see {string} in terminalAssert text visible
Then the terminal should contain text matching {string}Assert regex match
Then the terminal output should not be emptyAssert has output
Then the terminal process should exitAssert process ended
Then the terminal process should exit with code {int}Assert exit code

Full TUI Steps Reference


Shared Steps (All tags)

StepDescription
Given I generate a UUID and store as {string}Create unique ID
Given I set variable {string} to {string}Set variable
Then the variable {string} should equal {string}Assert variable
Given I register cleanup for {string} {string}Register cleanup

Full Shared Steps Reference


Tag Requirements

TagAvailable Steps
@apiAPI steps, Shared steps
@uiUI steps, Shared steps
@tuiTUI steps, Shared steps
@hybridAPI steps, UI steps, Shared steps

Common Patterns

API: Create and verify resource

@api
Scenario: Create user
Given I am authenticated as an admin via API
When I POST "/users" with JSON body:
"""
{ "email": "test@example.com", "name": "Test User" }
"""
Then the response status should be 201
And I store the value at "id" as "userId"
And the value at "email" should equal "test@example.com"

UI: Login flow

@ui
Scenario: Login
Given I navigate to "/login"
When I fill in "username" with "testuser"
And I fill in "password" with "secret123"
And I click the button "Sign In"
Then I should see text "Welcome"
And the URL should contain "/dashboard"

Hybrid: API setup, UI verify

@hybrid
Scenario: Create via API, verify in UI
Given I am authenticated as an admin via API
When I POST "/users" with JSON body:
"""
{ "email": "newuser@test.com" }
"""
Then the response status should be 201

Given I navigate to "/admin/users"
Then I should see text "newuser@test.com"