-
Notifications
You must be signed in to change notification settings - Fork 1
Steps Modules
An introduction to Steps Modules.
Step Module - it is an abstraction, which is represented by a class, which plays role for the set of actions, that are applied before and/or after of invocation of different steps. Here, for example, you can analyze step result and do some action based on successful step completed or not.
**Step Module ** - is a class, which implements IStepModule. This interface defines
void AfterExecution(IStep step, StepState state);
and
void BeforeExecution(IStep step);
methods, which are core places to put logic of a step module.
See example of creation of the Step Module:
public class YourStepModule: IStepModule
{
public void BeforeExecution(IStep step) { /// your code. }
public void AfterExecution(IStep step, StepState state){ /// your code. }
}
Step Module may have conditions, set by attributes, which restrict appliance of Step Module to your step. For example, if you want Step Module to be applied to only exact step, you may use the attribute TargetStep:
[TargetStep(typeof(StepOnWhichStepModuleToBeAppliedFor))]
To make Step Module work you have to register it in the constructor of your test class. See example:
RegisterStepModule<YourStepModule>();
You can register as many Step Modules as you want. To cancel the registration you should use:
UnregisterStepModule<YourStepModule>();
Index
- Overview
- Operation manual
- Advanced usage