Get element by label input value and by labels concat values #607
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.
What:
getAllLabelsByText
now retrieves label byinput
elements not empty value toogetByLabelText
accepts a new argument namedconcat
that enables retrieving elements by multiple concatenated labelsWhy:
According to #545 retrieving element through
input
labels was impossible as well as using a combination of labels to get a labelled element.How:
queryAllLabelsByText
now makes a query not only on elements of typelabel
but oninput
elements too. The empty input are excluded.queryAllLabelsByText
gets the labels even if the text to be matched is a concatenation of labels, theconcat
argument is passed to thematcher
. Thematcher
checks the value ofconcat
to decide if the condition to be satisfied is an equality or an includes (in case ofconcat
true) condition between thetext
and the candidate label.text
is composed by the found labelsChecklist:
input
type to elements queried byqueryAllLabelsByText
input
elements with empty valueconcat
argument to all the methods called in the chainmatcher
behavior according toconcat
valuetext
to be matcheddocs site
DefinitelyTyped
Like said in #545 comments, I am not sure this is the right way to fix this wrong behavior and probably I am not considering some use case but I would like to receive some suggestions and share thoughts on it.