Class CfAbstractLocator

java.lang.Object
dev.comfast.cf.CfAbstractLocator
All Implemented Interfaces:
CfLocator
Direct Known Subclasses:
SeleniumLocator

public abstract class CfAbstractLocator extends Object implements CfLocator
  • Field Details

  • Constructor Details

    • CfAbstractLocator

      public CfAbstractLocator(SelectorChain chain)
  • Method Details

    • hasClass

      public boolean hasClass(String cssClass)
      Specified by:
      hasClass in interface CfLocator
      Parameters:
      cssClass - name
      Returns:
      if element have given css class
    • getText

      public String getText()
      Specified by:
      getText in interface CfLocator
      Returns:
      text of element
    • innerHtml

      public String innerHtml()
      Specified by:
      innerHtml in interface CfLocator
      Returns:
      inner html of element
    • outerHtml

      public String outerHtml()
      Specified by:
      outerHtml in interface CfLocator
      Returns:
      outer html of element
    • getValue

      public String getValue()
      Specified by:
      getValue in interface CfLocator
      Returns:
      value of element
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • action

      protected <T> T action(Supplier<T> actionFunction, String name, Object... params)
      Does an action, wraps it into: - Event: can set Before and After listeners to it - Waiter - action will be repeated in case of fail var someText = action(() -> grabSomeText(1), "grab some text", 1)
      Parameters:
      actionFunction - actionFunction
      name - our name of action, e.g. method name
      params - action params, e.g. method params
      Returns:
      actionFunction result
    • action

      protected void action(Runnable actionFunction, String name, Object... params)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object