Skip to main content

Annotations

tip

Use annotations in meta and avoid them in features where possible.

AnnotationLevel(s)Description
@StepDefScenarioTurns a Gherkin Scenario into a callable step definition
@ImportFeature
Meta
Loads specific meta files into a feature (or another meta) without relying on automatic discovery or other mechanisms
@SynchronizedStepDefEnsures that only one thread can call a StepDef at any one time during parallel execution
@SynchronisedStepDefSame as a @Synchronized above but with AU spelling instead
@DataTableStepDefAssociates a step definition with a Gherkin data table
@ForEachStepDefIterates over the records of a Gherkin data table
@ExamplesScenario OutlineImports data from a CSV file into an examples table in a Scenario Outline
@ContextStepDefAssigns context behavior to a step definition so it can only be called by Given steps
@ActionStepDefAssigns action behavior to a step definition so it can only be called by When steps
@AssertionStepDefAssigns assertion behavior to a step definition so it can only be called by Then steps
@MessageStepOverrides the default error message for a failed assertion with a custom one
@TryStepInstructs Gwen to ignore a failed step and continue procesing
@FinallyStepForces the last step in a Scenario to always execute even when prior ones fail or are skipped
@EagerStepImmediately evaluates and assigns values to refereces in place instead of at each call site
@LazyStepEvaluates and assigns values to refereces when they are first used at a call site only
@BreakpointStepPauses execution on a step when Gwen is launched in debug mode
@HardStepReports an assertion error occurring in a step, raises it as a failure and skips further processing
@SoftStepReports an assertion error occurring in a step, raises it as failure and continues processing
@SustainedStepReports an assertion error occurring in a step without raising it as a failure and continues processing
@DryRunStepForces references to take on certain given values when evaluated in dry runs
@MaskedStepMasks (hides) the value returned by a data binding
@TrimStepTrims strings when performing comparison operations
@IgnoreCaseStepIgnores case when performing comparison operations
@IgnoreFeature
Scenario
Rule
Background
Examples
Ignores and skips over a Gherkin block/node to avoid evaluation