Text-entry components
Single-line text field
Use for names, subjects, identifiers, addresses, and other plain text.
When I fill "Automation Account {timestamp}" in the "Account Name" text field
Then the "Account Name" field should contain "Automation Account {timestamp}"Use replace when the field already contains a value:
When I replace the value in the "Subject" text field with "Updated request {timestamp}"
Then the "Subject" field should contain exactly "Updated request {timestamp}"Use clear when blank is the intended state:
When I clear the "Middle Name" text field
Then the "Middle Name" field should be emptyDo not write fill the name without naming the exact field and value.
Email, phone, URL, and password fields
Name the visible field and keep the value externalised:
When I fill [$.testdata.contact.email] in the "Email" field
And I fill [$.testdata.contact.phone] in the "Phone" field
And I fill [$.testdata.contact.website] in the "Website" fieldFor passwords, confirm the outcome rather than attempting to read the masked value:
When I fill [$.testdata.login.password] in the "Password" field
And I click the "Sign In" button
Then the "Dashboard" heading should be visibleMultiline textarea
Use textarea or multiline field, and state whether line breaks matter:
When I fill the "Internal Notes" textarea with the following text:
"""
Customer requested expedited handling.
Manager approval is attached.
"""
Then the "Internal Notes" textarea should contain both lines in the same orderRich-text editor
Treat content and formatting as separate responsibilities.
For content only:
When I fill the "Case Description" rich-text editor with:
"""
Customer cannot access the portal.
Reset attempted twice.
"""
Then the "Case Description" rich-text editor should contain both sentencesFor formatting:
When I select the text "Critical customer" in the "Case Description" rich-text editor
And I click the "Bold" toolbar button for that editor
Then "Critical customer" should be bold in the "Case Description" editorFor links:
When I select the text "Support policy" in the "Resolution" rich-text editor
And I use the "Insert Link" toolbar action with URL [$.testdata.case.policy_url]
Then "Support policy" should link to [$.testdata.case.policy_url]Always scope toolbar buttons to their editor when more than one editor is present.
Numeric, currency, percentage, and spinbutton fields
State the semantic type and the expected normalisation:
When I fill `12500.50` in the "Annual Revenue" currency field
Then the "Annual Revenue" field should show the value `12,500.50`
When I set the "Discount" percentage field to `15`
Then the "Discount" field should show `15%`Do not include currency symbols in the input unless the control requires them. Confirm the displayed value using the application's locale.
Search field or search bar
Use search for the query action. Keep searching separate from choosing a
result:
When I search for [$.testdata.account.name] using the "Search Accounts" field
And I wait until the search results finish loading
Then a result named [$.testdata.account.name] should be visibleAutocomplete or typeahead
Searching is not selection. Always select a result and confirm the committed value:
When I search for "San" using the "City" autocomplete field
And I select "San Francisco" from the suggestions
Then the "City" field should show "San Francisco"