vaadin / testbench

Vaadin TestBench is a tool for automated user interface testing of Vaadin applications.
https://vaadin.com/testbench
Other
20 stars 22 forks source link

feat: add conditional (non-attribute) selectors to ElementQueries #1784

Closed joelpop closed 2 months ago

joelpop commented 2 months ago

Description

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:

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.

Fixes #1183 Add Additional Selectors

Type of change

Checklist

Additional for Feature type of change