Class ScreenplayPlugin
- Namespace
- CSF.Screenplay
- Assembly
- CSF.Screenplay.ReqnrollPlugin.dll
The Screenplay plugin for Reqnroll.
public class ScreenplayPlugin : IRuntimePlugin
- Inheritance
-
ScreenplayPlugin
- Implements
- Inherited Members
Remarks
This plugin class is the test framework integration for Reqnroll. Crucially it adds the Screenplay architecture to the Reqnroll architecture.
Becuase this plugin leverages the Reqnroll/BoDi IObjectContainer, it is likely incompatible with other plugins
which integrate with third party Dependency Injection libraries.
This may be easily worked-around, though. If you are using a third-party DI plugin then do not use this plugin. Instead use the AddScreenplay(IServiceCollection, Action<ScreenplayOptions>) method to add Screenplay to that third-party DI system, when customising the dependency registrations. Adding Screenplay in that way is equivalent to the work done by this plugin.
If you wish to further customise the dependency injection, such as adding injectable services for abilities or implementations of IPersona, add them to the relevant DI container. When using Reqnroll's default BoDi container this is described in the following article https://docs.reqnroll.net/latest/automation/context-injection.html#advanced-options. If using a third-party DI container then you should use that container's appropriate mechanism of adding services.
Properties
Screenplay
Provides static access to the Screenplay instance.
public static Screenplay Screenplay { get; }
Property Value
Remarks
This is required because the bindings for beginning/ending the Screenplay in ScreenplayBinding must be static.
Those bindings use the [BeforeTestRun] and [AfterTestRun] hooks, which must be static, as documented here:
https://docs.reqnroll.net/latest/automation/hooks.html#supported-hook-attributes
Methods
Initialize(RuntimePluginEvents, RuntimePluginParameters, UnitTestProviderConfiguration)
public void Initialize(RuntimePluginEvents runtimePluginEvents, RuntimePluginParameters runtimePluginParameters, UnitTestProviderConfiguration unitTestProviderConfiguration)
Parameters
runtimePluginEventsRuntimePluginEventsruntimePluginParametersRuntimePluginParametersunitTestProviderConfigurationUnitTestProviderConfiguration