Annotations
tip
Use annotations in meta and avoid them in features where possible.
Annotation | Level(s) | Description |
---|---|---|
@StepDef | Scenario | Turns a Gherkin Scenario into a callable step definition |
@Import | Feature Meta | Loads specific meta files into a feature (or another meta) without relying on automatic discovery or other mechanisms |
@Synchronized | StepDef | Ensures that only one thread can call a StepDef at any one time during parallel execution |
@Synchronised | StepDef | Same as a @Synchronized above but with AU spelling instead |
@DataTable | StepDef | Associates a step definition with a Gherkin data table |
@ForEach | StepDef | Iterates over the records of a Gherkin data table |
@Examples | Scenario Outline | Imports data from a CSV file into an examples table in a Scenario Outline |
@Context | StepDef | Assigns context behavior to a step definition so it can only be called by Given steps |
@Action | StepDef | Assigns action behavior to a step definition so it can only be called by When steps |
@Assertion | StepDef | Assigns assertion behavior to a step definition so it can only be called by Then steps |
@Message | Step | Overrides the default error message for a failed assertion with a custom one |
@Try | Step | Instructs Gwen to ignore a failed step and continue procesing |
@Finally | Step | Forces the last step in a Scenario to always execute even when prior ones fail or are skipped |
@Eager | Step | Immediately evaluates and assigns values to refereces in place instead of at each call site |
@Lazy | Step | Evaluates and assigns values to refereces when they are first used at a call site only |
@Breakpoint | Step | Pauses execution on a step when Gwen is launched in debug mode |
@Hard | Step | Reports an assertion error occurring in a step, raises it as a failure and skips further processing |
@Soft | Step | Reports an assertion error occurring in a step, raises it as failure and continues processing |
@Sustained | Step | Reports an assertion error occurring in a step without raising it as a failure and continues processing |
@DryRun | Step | Forces references to take on certain given values when evaluated in dry runs |
@Ignore | Feature Scenario Rule Background Examples | Ignores and skips over a Gherkin block/node to avoid evaluation |