Table of Contents

Enum PerformancePhase

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

Enumerates the phases of a performance

public enum PerformancePhase

Fields

Given = 1

The 'Given' phase of a performance is for set-up and fulfilling preconditions

In the "Arrange", "Act", "Assert" manner of describing test logic, this phase corresponds to "Arrange".

In the Given phase, perform whatever tasks/actions are required to set up the test, or in other words, whatever needs to be done so that we can get to the When phase. In a test, if part of the Given performance fails, then it would be reasonable to expect that another test should also be failing. In the context of this single test/performance, the Given phase should be just that - taken as a given.

Then = 3

The 'Then' phase of a performance is where the results of the When phase are as expected; is it a pass or a fail?

In the "Arrange", "Act", "Assert" manner of describing test logic, this phase corresponds to "Assert".

In the Then phase, perform whatever is required to conclusively determine whether or not the activity in the When phase was a success or not. Typically this involves using performables which return result values, in order to interrogate the app state.

Unspecified = 0

Indicates that no phase has been specified

When = 2

The 'When' phase of a performance describes the activity which is under test

In the "Arrange", "Act", "Assert" manner of describing test logic, this phase corresponds to "Act".

In the When phase, the actor(s) should perform the tasks/actions that are being tested; this is the part which matters to the test.

Remarks

It is common for a IPerformance to occur in phases. This is especially true when Screenplay is being used as a testing tool. This type enumerates the possible phases.

If phases are irrelevant to your usage of Screenplay then feel free to use Unspecified, which is the default phase when no phase has been specified.