Demo
GUIDE

Selection, state, and date components

3 MIN READ

Picklist or standard dropdown

Use the exact visible option.

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

Do not write choose the prospecting option without naming the field. Do not invent abbreviations or backend values — use the option exactly as shown.

Searchable combobox

Open the control, search if supported, select one exact option, and confirm it.

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"

Opening a combobox is not the same as selecting a value.

Dependent picklists

Set the controller first and allow the dependent option list 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 place a controlling picklist and its dependent picklist in the same grouped instruction.

Multi-select picklist

State the complete desired selection 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"

To remove a value:

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

Dual listbox or transfer list

Name the source and destination lists.

gherkin
When I move "Enterprise" and "Strategic" from "Available Segments" to "Selected Segments"
Then "Enterprise" and "Strategic" should appear under "Selected Segments"
And they should not appear under "Available Segments"

Token or chip input

Confirm tokens, not merely typed text.

gherkin
When I add "finance@example.com" to the "Recipients" token field
Then a recipient token named "finance@example.com" should be present

Radio-button group

Radio buttons represent a single selected state.

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

Never write click the Person Account radio button without stating the desired selection.

Checkbox

Write the desired checked state. The action must be safe to repeat.

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

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

Never write toggle the checkbox or click the checkbox when the intended state matters.

Row checkbox

Scope the checkbox to a unique row.

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

Toggle or switch

Use set to On or set to Off.

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

Segmented control, card, tile, or choice button

Treat these as exclusive choices when only one can be active.

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

Date field or date picker

Use an unambiguous date and name the field.

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

For relative dates, define the calculation:

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

Time field

State the timezone when it matters:

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

Date-time field

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

Date range

Set the start first, then the end, and confirm both:

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