java.lang.Object
net.serenitybdd.screenplay.Actor
- All Implemented Interfaces:
net.serenitybdd.core.parallel.Agent,net.serenitybdd.core.SkipNested,PerformsTasks
public class Actor
extends Object
implements PerformsTasks, net.serenitybdd.core.SkipNested, net.serenitybdd.core.parallel.Agent
An actor represents the person or system using the application under test.
Actors can have Abilities, which allows them to perform Tasks and Interactions.
Actors can ask Questions about the state of the system.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface net.serenitybdd.core.parallel.Agent
IN_THE_CURRENT_SESSION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T extends Ability>
T<ANSWER> ANSWERvoidassignDescriptionToActor(String description) voidassignName(String name) final voidattemptsTo(Actor.ErrorHandlingMode mode, Performable... tasks) final voidattemptsTo(Performable... tasks) voidAdd all the remembered items for the current actor to the other actor's memoryfinal voidcan(Consequence<?>... consequences) can(T doSomething) describedAs(String description) final voidA method used to declare that an actor is now the actor in the spotlight, without having them perform any tasks.<T> T<T> T<C> CgetAbilityThatExtends(Class<C> extendedClass) Return an ability that extends the given class.getId()getName()Return a list of allAbilitys which implementHasTeardownfinal voidfinal voidhas(Performable... todos) static ActorCreate a new actor with a given name.<T> Tvoid<ANSWER> void<T> Tfinal voidshould(String groupStepName, Consequence<?>... consequences) final voidshould(List<Consequence<?>> consequences) final voidshould(Consequence<?>... consequences) toString()<T extends Ability>
TusingAbilityTo(Class<? extends T> doSomething) A more readable way to access an actor's abilities.usingPronoun(String pronoun) final voidwasAbleTo(Performable... todos) A tense-neutral synonym for addFact() for use with given() clauseswhoCan(T doSomething) Assign an ability to an actor.voidwrapUp()
-
Constructor Details
-
Actor
-
-
Method Details
-
brief
Add all the remembered items for the current actor to the other actor's memory- Parameters:
otherActor-
-
toString
-
named
Create a new actor with a given name. This actor will have no abilities initially, so you will need to assign some abilities using the whoCan() method. -
describedAs
-
getName
- Specified by:
getNamein interfacenet.serenitybdd.core.parallel.Agent
-
getDescription
-
getNameOrPronoun
-
can
-
whoCan
Assign an ability to an actor. -
abilityTo
-
getAbilityThatExtends
Return an ability that extends the given class. Can be a Superclass or an Interface. If there are multiple candidate Abilities, the first one found will be returned.- Type Parameters:
C- the matching Ability cast to extendedClass or null if none match- Parameters:
extendedClass- the Interface class that we expect to find
-
getTeardowns
Return a list of allAbilitys which implementHasTeardown -
usingAbilityTo
A more readable way to access an actor's abilities. -
entersTheScene
public final void entersTheScene()A method used to declare that an actor is now the actor in the spotlight, without having them perform any tasks. -
has
-
has
-
wasAbleTo
A tense-neutral synonym for addFact() for use with given() clauses -
attemptsTo
-
attemptsTo
- Specified by:
attemptsToin interfacePerformsTasks
-
asksFor
- Specified by:
asksForin interfacePerformsTasks
-
can
-
should
-
should
-
should
-
remember
-
remember
-
recall
-
recallAll
-
forget
-
sawAsThe
-
gaveAsThe
-
usingPronoun
-
withNoPronoun
-
assignDescriptionToActor
-
assignName
-
wrapUp
public void wrapUp() -
getId
- Specified by:
getIdin interfacenet.serenitybdd.core.parallel.Agent
-