Demo
GUIDE

Cases 1–13 · Text entry and search

3 MIN READ

Case 1 — Fill a value in a text field

Use the visible field label and state the final value. Here, {timestamp} appends a runtime-generated uniqueness suffix to the fixed value Automation Account.

gherkin
When I fill "Automation Account {timestamp}" in the "Account Name" text field
Then the "Account Name" field should contain "Automation Account {timestamp}"

Do not write fill the account name; the value and field must both be explicit.

Case 2 — Replace an existing text value

Use replace so the previous value is not appended.

gherkin
When I replace the value in the "Subject" text field with "Updated request {timestamp}"
Then the "Subject" field should contain exactly "Updated request {timestamp}"

Case 3 — Clear a text field

State that blank is the required state.

gherkin
When I clear the "Middle Name" text field
Then the "Middle Name" field should be empty

Case 4 — Fill a masked password

Keep the value in test data and confirm the login outcome, not the masked characters.

gherkin
When I fill [$.testdata.login.password] in the "Password" field
And I click the "Sign In" button
Then the "Dashboard" heading should be visible

Never hardcode a password or ask TestZeus to report it.

Case 5 — Fill multiline text

Name the textarea and preserve required line order.

gherkin
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 order

Case 6 — Fill plain content in a rich-text editor

Name the editor, not only the business field.

gherkin
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 sentences

Case 7 — Apply formatting in a rich-text editor

Select the text, use the editor's named toolbar action, and confirm formatting separately from content.

gherkin
When I select the text "Critical customer" in the "Case Description" rich-text editor
And I click the "Bold" toolbar button for the "Case Description" editor
Then "Critical customer" should be bold in that editor

If several editors exist, always scope the toolbar to the editor.

gherkin
When I select "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]

Case 9 — Fill a number

Use a numeric value and confirm the application's displayed normalisation.

gherkin
When I fill `250` in the "Employee Count" number field
Then the "Employee Count" field should show `250`

Case 10 — Fill currency

Separate the numeric value from locale formatting.

gherkin
When I fill `12500.50` in the "Annual Revenue" currency field
Then the field should show [$.testdata.locale.expected_revenue_format]

Case 11 — Fill a percentage

gherkin
When I set the "Discount" percentage field to `15`
Then the "Discount" field should show `15%`

Searching and receiving results are separate states.

gherkin
When I search for [$.testdata.account.name] using the "Search Accounts" field
And I wait until the results finish loading
Then a result named [$.testdata.account.name] should be visible

Case 13 — Use autocomplete or typeahead

Searching does not commit the suggestion. Select one exact result.

gherkin
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"