In contrast to ComponentQuerys of unit testing TestBench, ElementQuerys in E2E testing TestBench have (up until now) only provided attribute-based selector methods. This was expanded upon in PR #1774 to provide selector methods for common attributes, such as those for class names, theme, and id. This PR adds condition-based selector methods to ElementQuery to mirror and expand upon those of ComponentQuery. Namely:
withCondition
withPropertyValue[Containing]
withLabel[Containing]
withPlaceholder[Containing]
withCaption[Containing]
withText[Containing]
Elements having their labels in their text (such as buttons) must implement a new, method-less interface HasLabelAsText in their element tester (such as NativeButtonElement for the NativeButton component and ButtonElement for the Button component) in order for the withCaption[Containing] selectors to work for them.
This PR brings the E2E testing selectors up to par with the unit testing selectors. The only one missing is withValue.
Description
In contrast to
ComponentQuery
s of unit testing TestBench,ElementQuery
s in E2E testing TestBench have (up until now) only provided attribute-based selector methods. This was expanded upon in PR #1774 to provide selector methods for common attributes, such as those for class names, theme, and id. This PR adds condition-based selector methods toElementQuery
to mirror and expand upon those ofComponentQuery
. Namely:withCondition
withPropertyValue[Containing]
withLabel[Containing]
withPlaceholder[Containing]
withCaption[Containing]
withText[Containing]
Elements having their labels in their text (such as buttons) must implement a new, method-less interface
HasLabelAsText
in their element tester (such asNativeButtonElement
for theNativeButton
component andButtonElement
for theButton
component) in order for thewithCaption[Containing]
selectors to work for them.This PR brings the E2E testing selectors up to par with the unit testing selectors. The only one missing is
withValue
.Fixes #1183 Add Additional Selectors
Type of change
Checklist
Additional for
Feature
type of change