Current Execution Context in the Hook

  • To get additional information about the current specification, scenario and step executing, an additional ExecutionContext parameter can be added to the hooks method.

Java
C#
Ruby
public class ExecutionHooks {

    @BeforeScenario
    public void loginUser(ExecutionContext context) {
      String scenarioName = context.getCurrentScenario().getName();
      // Code for before scenario
    }

    @AfterSpec
    public void performAfterSpec(ExecutionContext context) {
      Specification currentSpecification = context.getCurrentSpecification();
      // Code for after step
    }
}
This feature is not yet supported in Gauge-CSharp.
Please refer to https://github.com/getgauge/gauge-csharp/issues/53 for updates.
before_spec do |execution_info|
    puts execution_info.inspect
end

after_spec do |execution_info|
    puts execution_info.inspect
end

results matching ""

    No results matching ""