Demo
GUIDE

Cases 14–33 · Selection, state, and dates

4 MIN READ

Case 14 — Select a standard picklist option

Name the picklist and use exact visible option text.

gherkin
When I select "Prospecting" from the "Stage" picklist
Then the "Stage" picklist should show "Prospecting"

Do not substitute an abbreviation or backend code for the visible option.

Case 15 — Use a searchable combobox

Opening, searching, and selecting are separate actions.

gherkin
When I open the "Country" combobox
And I search for "United Kingdom" within its options
And I select "United Kingdom"
Then the "Country" combobox should show "United Kingdom"

Case 16 — Set dependent picklists

Set the controller first. Wait for the dependent field to refresh.

gherkin
When I select "United States" from the "Country" picklist
And I wait until the "State" picklist becomes enabled
And I select "California" from the "State" picklist
Then the "Country" picklist should show "United States"
And the "State" picklist should show "California"

Never combine both selections into one instruction.

Case 17 — Set a multi-select picklist

State the complete requested set.

gherkin
When I select "Email" and "SMS" in the "Preferred Channels" multi-select picklist
Then the selected values should be exactly "Email" and "SMS"

Case 18 — Remove one multi-select value

gherkin
When I remove "Phone" from the selected values in the "Preferred Channels" multi-select picklist
Then "Phone" should not be selected
And the remaining selected values should not change

Case 19 — Use a dual listbox

Name both lists and the moved items.

gherkin
When I move "Enterprise" and "Strategic" from "Available Segments" to "Selected Segments"
Then both values should appear under "Selected Segments"
And neither value should remain under "Available Segments"

Case 20 — Add a token or chip

Confirm a committed token rather than typed text.

gherkin
When I add [$.testdata.notification.recipient] to the "Recipients" token field
Then a token named [$.testdata.notification.recipient] should be present

Case 21 — Select a radio option

Radio groups allow one selected option.

gherkin
When I select the "Person Account" option in the "Record Type" radio group
Then "Person Account" should be selected
And every other option in the "Record Type" group should be unselected

Do not write click the radio button; write the desired selection.

Case 22 — Check a checkbox

Write the desired state so the instruction is safe to repeat.

gherkin
When I ensure the "Active" checkbox is checked
Then the "Active" checkbox should be checked

Case 23 — Uncheck a checkbox

gherkin
When I ensure the "Send Notification" checkbox is unchecked
Then the "Send Notification" checkbox should be unchecked

Never use toggle when the final state matters.

Case 24 — Select a row checkbox

Identify the row by a unique business value.

gherkin
When I check the selection checkbox in the row whose "Opportunity Name" is "Renewal 2026"
Then the row for "Renewal 2026" should be selected

Case 25 — Select all visible rows

Define the collection boundary.

gherkin
When I check the "Select All" checkbox for the currently visible results
Then every selectable row on the current page should be selected
And the selected-row count should equal the visible selectable-row count

State whether Select All covers the current page or the full filtered result set.

Case 26 — Set a switch to On

gherkin
When I set the "Enable Notifications" switch to On
Then the "Enable Notifications" switch should show On

Case 27 — Set a switch to Off

gherkin
When I set the "Automatic Renewal" switch to Off
Then the "Automatic Renewal" switch should show Off

Case 28 — Select a card or tile

Use when cards represent choices rather than navigation.

gherkin
When I select the "Business" card in the "Account Type" choices
Then the "Business" card should be selected

If the card navigates, assert the destination instead.

Case 29 — Set a date

Use an unambiguous source date and confirm the displayed date.

gherkin
When I set the "Close Date" date field to `2026-08-31`
Then the "Close Date" field should show `31 Aug 2026`

Case 30 — Set a relative date

Define the calculation precisely.

gherkin
When I set the "End Date" to seven calendar days after the current date
Then the "End Date" should equal the calculated date

State business days instead of calendar days when holidays and weekends must be excluded.

Case 31 — Set a time

gherkin
When I set the "Appointment Time" field to `14:30` in [$.environment.current.timezone]
Then the field should show `2:30 PM`

Case 32 — Set a date and time

gherkin
When I set the "Scheduled Start" date-time field to `2026-08-31 14:30` in [$.environment.current.timezone]
Then the stored date, time, and timezone should match

Case 33 — Set a date range

gherkin
When I set the "Start Date" to `2026-08-01`
And I set the "End Date" to `2026-08-31`
Then the selected range should be `2026-08-01` through `2026-08-31`