Repository navigation
select: Let UI tests find the search field and combobox input by id - #1433
Open
madcodelife wants to merge 1 commit into
Open
madcodelife wants to merge 1 commit into
madcodelife wants to merge 1 commit into
Conversation
A searchable Select makes its search field inside the popup and a Combobox makes its input inside its root, so the component's testID never reaches them: tests had to find these fields by placeholder or screen reader label, which follow the app's wording and language. Select's searchTestID and Combobox's inputTestID give those parts the app's test id, named after the part as their other props are. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
UI tests could not reach the search field of a searchable
Selector theinput of a
Comboboxby id: the select makes its search field inside thepopup and the combobox makes its input inside its root, and
testIDnamesonly the component's own view. Tests had to find these fields by their
placeholder or screen reader label, which changes with the app's wording
and language.
This adds a test id for each of these parts, named after the part as its
other props are (
searchClass/searchAccessibilityLabel,inputClass/inputStyle):Select:searchTestID(Rust.search_test_id(..)) sets the searchfield's test id.
Combobox:inputTestID(Rust.input_test_id(..)) sets the input'stest id. The combobox has no separate search field; its input is the
search.
Public API
Select.searchTestID?: string/SelectProps::search_test_id: Prop<Option<SharedString>>(builder
.search_test_id(..)): the id UI tests find the search field by.Combobox.inputTestID?: string/ComboboxProps::input_test_id: Prop<Option<SharedString>>(builder
.input_test_id(..)): the id UI tests find the input by.Validation
nsh-basetests: newselect::ui_tests_find_the_search_field_by_its_test_idand
combobox::ui_tests_find_the_input_by_its_test_idfind the field byid:and type into it; theselectandcomboboxsuites pass.base-selectandbase-comboboxset the new props and theirscript reaches the fields by
id:.docs/dev/api-naming.md.cargo +nightly fmt --all,cargo clippy -p nsh-base --all-targets.🤖 Generated with Claude Code