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.TextField
testerAvailable - whether Browserless has a dedicated tester for the type or one of its supertypes
testerType - the fully qualified name of the closest supertype that has a dedicated tester, null if none
locator - how to find the component
fieldName - name of the non-private view field holding the component, if any
viewFqn - the fully qualified class name of the current view
insideRenderer - set when the component was created by a Grid renderer
insideOverlay - set when the component is inside an overlay (dialog, notification, popover, context menu)
unresolvableReason - human-readable reason when locator.kind is BrowserlessTargetDescriptor.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.
  • Constructor Details

  • Method Details

    • unresolvable

      public static BrowserlessTargetDescriptor unresolvable(String componentFqn, String reason)
      Creates an unresolvable descriptor.
      Parameters:
      componentFqn - the component type if known
      reason - 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

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • componentFqn

      public String componentFqn()
      Returns the value of the componentFqn record component.
      Returns:
      the value of the componentFqn record component
    • testerAvailable

      public boolean testerAvailable()
      Returns the value of the testerAvailable record component.
      Returns:
      the value of the testerAvailable record component
    • testerType

      public String testerType()
      Returns the value of the testerType record component.
      Returns:
      the value of the testerType record component
    • locator

      Returns the value of the locator record component.
      Returns:
      the value of the locator record component
    • fieldName

      public String fieldName()
      Returns the value of the fieldName record component.
      Returns:
      the value of the fieldName record component
    • viewFqn

      public String viewFqn()
      Returns the value of the viewFqn record component.
      Returns:
      the value of the viewFqn record component
    • insideRenderer

      Returns the value of the insideRenderer record component.
      Returns:
      the value of the insideRenderer record component
    • insideOverlay

      Returns the value of the insideOverlay record component.
      Returns:
      the value of the insideOverlay record component
    • unresolvableReason

      public String unresolvableReason()
      Returns the value of the unresolvableReason record component.
      Returns:
      the value of the unresolvableReason record component