Class BrowserlessTargetResolver
java.lang.Object
com.vaadin.copilot.testrecordergenerator.browserless.BrowserlessTargetResolver
Resolves a live server-side component to a
BrowserlessTargetDescriptor that a generated Browserless test can use
to find the same component.
Candidate locators are tried in priority order against the live UI tree and
the first one that matches exactly one component is used. The matching rules
mirror the ones used by Browserless ComponentQuery so that the
generated find(...).single() calls succeed:
- the tree is walked depth-first from the UI using
Component.getChildren() - the type matches with
instanceof withTestIdusesComponent.getTestId()withLabeluses thelabelelement propertywithTextusesElement.getText()
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionresolve(com.vaadin.flow.component.UI ui, com.vaadin.flow.component.Component target) Resolves the given component.
-
Constructor Details
-
BrowserlessTargetResolver
public BrowserlessTargetResolver()
-
-
Method Details
-
resolve
public BrowserlessTargetDescriptor resolve(com.vaadin.flow.component.UI ui, com.vaadin.flow.component.Component target) Resolves the given component.- Parameters:
ui- the UI that contains the componenttarget- the component to resolve- Returns:
- the descriptor, never null
-