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

public class CSSValue extends Object implements net.serenitybdd.screenplay.Question<String>
Get the computed CSS value of an element.

Sample usage:

     String color = actor.asksFor(CSSValue.of("#element").named("color"));
     String display = actor.asksFor(CSSValue.of(MY_TARGET).named("display"));
 
  • Method Summary

    Modifier and Type
    Method
    Description
    answeredBy(net.serenitybdd.screenplay.Actor actor)
     
    named(String propertyName)
    Specify the CSS property name to retrieve.
    static CSSValue
    of(String selector)
    Get CSS value for an element identified by a selector.
    static CSSValue
    of(Target target)
    Get CSS value for a Target element.
     

    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 CSSValue of(String selector)
      Get CSS value for an element identified by a selector.
    • of

      public static CSSValue of(Target target)
      Get CSS value for a Target element.
    • named

      public CSSValue named(String propertyName)
      Specify the CSS property name to retrieve.
    • answeredBy

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

      public String toString()
      Overrides:
      toString in class Object