Record Class BrowserlessTargetDescriptor
java.lang.Object
java.lang.Record
com.vaadin.copilot.testrecordergenerator.browserless.BrowserlessTargetDescriptor
- Record Components:
componentFqn- the fully qualified Flow component class name, e.g.com.vaadin.flow.component.textfield.TextFieldtesterAvailable- whether Browserless has a dedicated tester for the type or one of its supertypestesterType- the fully qualified name of the closest supertype that has a dedicated tester, null if nonelocator- how to find the componentfieldName- name of the non-private view field holding the component, if anyviewFqn- the fully qualified class name of the current viewinsideRenderer- set when the component was created by a Grid rendererinsideOverlay- set when the component is inside an overlay (dialog, notification, popover, context menu)unresolvableReason- human-readable reason whenlocator.kindisBrowserlessTargetDescriptor.LocatorKind.UNRESOLVABLE
public record BrowserlessTargetDescriptor(String componentFqn, boolean testerAvailable, String testerType, BrowserlessTargetDescriptor.Locator locator, String fieldName, String viewFqn, BrowserlessTargetDescriptor.InsideRenderer insideRenderer, BrowserlessTargetDescriptor.InsideOverlay insideOverlay, String unresolvableReason)
extends Record
Describes how a recorded target can be located in a Browserless test. It is
resolved against the live server-side UI while the component still exists,
i.e. at record time.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordThe overlay containing the component.static final recordLocation of a component created by a Grid component renderer.static final recordA query that finds exactly one component.static enumKind of a locator, in priority order.static enumScope of a locator query. -
Constructor Summary
ConstructorsConstructorDescriptionBrowserlessTargetDescriptor(String componentFqn, boolean testerAvailable, String testerType, BrowserlessTargetDescriptor.Locator locator, String fieldName, String viewFqn, BrowserlessTargetDescriptor.InsideRenderer insideRenderer, BrowserlessTargetDescriptor.InsideOverlay insideOverlay, String unresolvableReason) Creates an instance of aBrowserlessTargetDescriptorrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanWhether this descriptor can be used to locate the component.Returns the value of thecomponentFqnrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefieldNamerecord component.final inthashCode()Returns a hash code value for this object.Returns the value of theinsideOverlayrecord component.Returns the value of theinsideRendererrecord component.locator()Returns the value of thelocatorrecord component.booleanReturns the value of thetesterAvailablerecord component.Returns the value of thetesterTyperecord component.final StringtoString()Returns a string representation of this record class.static BrowserlessTargetDescriptorunresolvable(String componentFqn, String reason) Creates an unresolvable descriptor.Returns the value of theunresolvableReasonrecord component.viewFqn()Returns the value of theviewFqnrecord component.
-
Constructor Details
-
BrowserlessTargetDescriptor
public BrowserlessTargetDescriptor(String componentFqn, boolean testerAvailable, String testerType, BrowserlessTargetDescriptor.Locator locator, String fieldName, String viewFqn, BrowserlessTargetDescriptor.InsideRenderer insideRenderer, BrowserlessTargetDescriptor.InsideOverlay insideOverlay, String unresolvableReason) Creates an instance of aBrowserlessTargetDescriptorrecord class.- Parameters:
componentFqn- the value for thecomponentFqnrecord componenttesterAvailable- the value for thetesterAvailablerecord componenttesterType- the value for thetesterTyperecord componentlocator- the value for thelocatorrecord componentfieldName- the value for thefieldNamerecord componentviewFqn- the value for theviewFqnrecord componentinsideRenderer- the value for theinsideRendererrecord componentinsideOverlay- the value for theinsideOverlayrecord componentunresolvableReason- the value for theunresolvableReasonrecord component
-
-
Method Details
-
unresolvable
Creates an unresolvable descriptor.- Parameters:
componentFqn- the component type if knownreason- why the target cannot be located- Returns:
- a descriptor
-
canBeLocated
public boolean canBeLocated()Whether this descriptor can be used to locate the component.- Returns:
- true if resolvable
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
componentFqn
Returns the value of thecomponentFqnrecord component.- Returns:
- the value of the
componentFqnrecord component
-
testerAvailable
public boolean testerAvailable()Returns the value of thetesterAvailablerecord component.- Returns:
- the value of the
testerAvailablerecord component
-
testerType
Returns the value of thetesterTyperecord component.- Returns:
- the value of the
testerTyperecord component
-
locator
Returns the value of thelocatorrecord component.- Returns:
- the value of the
locatorrecord component
-
fieldName
Returns the value of thefieldNamerecord component.- Returns:
- the value of the
fieldNamerecord component
-
viewFqn
Returns the value of theviewFqnrecord component.- Returns:
- the value of the
viewFqnrecord component
-
insideRenderer
Returns the value of theinsideRendererrecord component.- Returns:
- the value of the
insideRendererrecord component
-
insideOverlay
Returns the value of theinsideOverlayrecord component.- Returns:
- the value of the
insideOverlayrecord component
-
unresolvableReason
Returns the value of theunresolvableReasonrecord component.- Returns:
- the value of the
unresolvableReasonrecord component
-