Table of Contents

Interface IPersona

Namespace
CSF.Screenplay
Assembly
CSF.Screenplay.Abstractions.dll

A persona is a factory for a commonly-used Actor

public interface IPersona : IHasName
Inherited Members

Remarks

In Screenplay is is recommended to use & reuse memorable actors, which are widely understood and recognisable to the development team. This is easier if the composition of an actor is the same across every IPerformance in which they participate. Personas facilitate this; the persona class serves as a consistent factory which creates the same named actor in the same manner every time.

Developers should create an implementation of this interface for each actor which they wish to define, ideally named the same as the name as the Actor. Each persona implementation should name the actor and grant them the abilities which are appropriate.

Instance of persona classes are resolved from the Dependency Injection container, so it is appropriate and correct to constructor-inject any services which are required in order to get the ability instances.

Methods

GetActor(Guid)

Gets the actor which is associated with the current persona

Actor GetActor(Guid performanceIdentity)

Parameters

performanceIdentity Guid

A unique identity for the currently-executing performance

Returns

Actor

Remarks

Implementors should not only create and return the actor from this method, but also configure the actor with the standard abilities associated with this persona.