java.lang.Object
net.serenitybdd.screenplay.playwright.questions.Focused
All Implemented Interfaces:
net.serenitybdd.screenplay.Question<Boolean>

public class Focused extends Object implements net.serenitybdd.screenplay.Question<Boolean>
Check if an element has focus.

Sample usage:

     Boolean focused = actor.asksFor(Focused.of("#email"));
     Boolean focused = actor.asksFor(Focused.of(EMAIL_FIELD));
 
  • Method Summary

    Modifier and Type
    Method
    Description
    answeredBy(net.serenitybdd.screenplay.Actor actor)
     
    static Focused
    of(String selector)
    Check if an element identified by a selector has focus.
    static Focused
    of(Target target)
    Check if a Target element has focus.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface net.serenitybdd.screenplay.Question

    as, asADate, asADate, asBigDecimal, asBoolean, asCollectionOf, asDouble, asEnum, asFloat, asInteger, asListOf, asLong, asString, describedAs, getSubject, map, mapEach
  • Method Details

    • of

      public static Focused of(String selector)
      Check if an element identified by a selector has focus.
    • of

      public static Focused of(Target target)
      Check if a Target element has focus.
    • answeredBy

      public Boolean answeredBy(net.serenitybdd.screenplay.Actor actor)
      Specified by:
      answeredBy in interface net.serenitybdd.screenplay.Question<Boolean>
    • toString

      public String toString()
      Overrides:
      toString in class Object