-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add conditional (non-attribute) selectors to ElementQueries #1784
Merged
Conversation
This file contains 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
Adding CaptionComponent & CaptionElement for ITs. Adding ITs.
Added more unit tests.
…dition # Conflicts: # vaadin-testbench-core-junit5/src/test/java/com/vaadin/testbench/ElementQueryTest.java # vaadin-testbench-core/src/test/java/com/vaadin/testbench/ElementQueryTest.java # vaadin-testbench-integration-tests-junit5/frontend/template-view.ts # vaadin-testbench-integration-tests-junit5/src/test/java/com/vaadin/tests/ElementQueryIT.java # vaadin-testbench-integration-tests/frontend/template-view.ts # vaadin-testbench-integration-tests/src/test/java/com/vaadin/tests/ElementQueryIT.java # vaadin-testbench-shared/src/main/java/com/vaadin/testbench/ElementQuery.java
…r label. Altered implementation of withCaption to support button text and prioritize labels over placeholders. Expanded method documentation. Added and updated unit and integration tests.
mcollovati
requested changes
Apr 12, 2024
vaadin-testbench-shared/src/main/java/com/vaadin/testbench/ElementQuery.java
Show resolved
Hide resolved
vaadin-testbench-shared/src/main/java/com/vaadin/testbench/ElementQuery.java
Show resolved
Hide resolved
vaadin-testbench-integration-tests-junit5/src/test/java/com/vaadin/tests/ElementQueryIT.java
Show resolved
Hide resolved
vaadin-testbench-integration-tests-junit5/src/test/java/com/vaadin/tests/ElementQueryIT.java
Outdated
Show resolved
Hide resolved
vaadin-testbench-integration-tests-junit5/src/test/java/com/vaadin/tests/ElementQueryIT.java
Outdated
Show resolved
Hide resolved
vaadin-testbench-integration-tests-junit5/src/test/java/com/vaadin/tests/ElementQueryIT.java
Outdated
Show resolved
Hide resolved
vaadin-testbench-integration-tests-junit5/src/test/java/com/vaadin/tests/ElementQueryIT.java
Show resolved
Hide resolved
vaadin-testbench-integration-tests-junit5/src/test/java/com/vaadin/tests/ElementQueryIT.java
Show resolved
Hide resolved
vaadin-testbench-integration-tests-junit5/src/test/java/com/vaadin/tests/ElementQueryIT.java
Show resolved
Hide resolved
vaadin-testbench-integration-tests-junit5/src/test/java/com/vaadin/tests/ElementQueryIT.java
Show resolved
Hide resolved
mcollovati
changed the title
Feature: add conditional (non-attribute) selectors to ElementQueries
feat: add conditional (non-attribute) selectors to ElementQueries
Apr 12, 2024
Improved comparison documentation in ElementQuery. Added slot to LabelPlaceholder component and support for setText/getText. Added LabelPlaceholder components to test view via Flow. Added and improved integration tests. Simplified implementation (via SonarLint action) of HasPlaceholder's getPlaceholder implementation, which now mirrors that of HasLabel, HasLabelAsText, and HasHelper.
mcollovati
reviewed
Apr 15, 2024
vaadin-testbench-shared/src/main/java/com/vaadin/testbench/ElementQuery.java
Show resolved
Hide resolved
mcollovati
requested changes
Apr 16, 2024
vaadin-testbench-shared/src/main/java/com/vaadin/testbench/ElementQuery.java
Outdated
Show resolved
Hide resolved
vaadin-testbench-shared/src/main/java/com/vaadin/testbench/ElementQuery.java
Show resolved
Hide resolved
mcollovati
approved these changes
Apr 17, 2024
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.
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