externalSearchInput <NET>
Hierarchy
- InteractionObject<NET>
- SearchInput
Index
Constructors
Methods
Constructors
externalconstructor
Type parameters
- NET
Parameters
externalrootElement: PageElement<NET> | QuestionAdapter<PageElement<NET>>
externaloptionaloptions: InteractionObjectOptions
Returns SearchInput<NET>
Methods
externalisPresent
Checks whether the interaction object's root element is present in the DOM.
Since
InteractionObjectimplementsOptional, you can assert on presence directly:Ensure.that(view, isPresent())Returns Answerable<boolean>
externalvalue
The current value of the search input field.
Returns the text the user has typed (or that was programmatically filled), even if filtering hasn't yet updated the results.
Example
await actor.attemptsTo(
searchInput.enter('checkout'),
Ensure.that(searchInput.value(), equals('checkout')),
);Returns QuestionAdapter<string>
externalplaceholder
The placeholder text of the search input (e.g.
'Search scenarios...').Example
await actor.attemptsTo(
Ensure.that(searchInput.placeholder(), equals('Search scenarios...')),
);Returns QuestionAdapter<string>
externallabel
The
aria-labelattribute of the search input, describing its purpose to assistive technology.Example
await actor.attemptsTo(
Ensure.that(searchInput.label(), equals('Search test scenarios')),
);Returns QuestionAdapter<string>
externalisClearable
Whether the clear button is present in the DOM.
The clear button typically appears only when the input contains text, providing a one-click way to reset the search.
Example
await actor.attemptsTo(
searchInput.enter('checkout'),
Ensure.that(searchInput.isClearable(), equals(true)),
searchInput.clear(),
Ensure.that(searchInput.isClearable(), equals(false)),
);Returns Question<Promise<boolean>>
externalenter
Types text into the search input field, triggering the view's text-based filtering.
Example
await actor.attemptsTo(
searchInput.enter('expired card'),
Ensure.that(searchInput.value(), equals('expired card')),
);Parameters
externalsearchTerm: Answerable<string>
Text to type into the search field
Returns Task
externalclear
Clicks the clear button to reset the search input to empty.
Example
await actor.attemptsTo(
searchInput.enter('checkout'),
searchInput.clear(),
Ensure.that(searchInput.value(), equals('')),
);Returns Task
Interaction object representing a text search input with a clear affordance.
A
SearchInputis composed into views that support text-based filtering (e.g. ScenariosView,ConsistencyView,ErrorsView). Like FilterBar, it is not instantiated directly by integration tests — views expose delegating methods such asfind()at the view level. TheSearchInputinstance is accessible for component tests that exercise the input widget in isolation.Instantiation (within a parent interaction object)
Usage in a component test