java.lang.Object
net.serenitybdd.screenplay.UseAnAbility

public class UseAnAbility extends Object
A factory to get an Ability of an Actor, when we don't care what it is specifically, just that it can do what we expect it to. Example Usage: UseAnAbility.of(actor).that(CanLevitate.class).hover()
  • Method Details

    • of

      public static UseAnAbility of(Actor actor)
    • that

      public <C> C that(Class<C> implementedInterface)
      If the actor has an Ability that implements the Interface, return that. If there are multiple candidate Abilities, the first one found will be returned.
      Type Parameters:
      C - the implementation of the Interface
      Parameters:
      implementedInterface - the Interface class that we expect to find
      Returns:
      the Ability that implements the interface