Interface CurrentStep


public interface CurrentStep
This interface can be injected into a stage by using the ScenarioState annotation. It provides programmatic access to the current executed step.
Since:
0.7.0
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Adds an attachment to the current step
    void
    setComment(String comment)
    Sets the comment of the step.
    void
    setExtendedDescription(String extendedDescription)
    Sets the extended description of the current step
    void
    Sets the name of the current step.
  • Method Details

    • addAttachment

      void addAttachment(Attachment attachment)
      Adds an attachment to the current step
      Parameters:
      attachment - an attachment to add
    • setExtendedDescription

      void setExtendedDescription(String extendedDescription)
      Sets the extended description of the current step
      Parameters:
      extendedDescription - the extended description
      See Also:
    • setName

      void setName(String name)
      Sets the name of the current step. Note that in general it is better to use the As annotation, to change the name of the step, because it can handle arguments in parametrized scenarios. If you use this method in a parameterized scenario and the step varies within that scenario, JGiven will not be able to create a data table.
      Parameters:
      name - the new name of the step
    • setComment

      void setComment(String comment)
      Sets the comment of the step. Not that the comment should be a constant string and not depending on arguments of the step, otherwise the behavior of this method is undefined for parametrized scenarios. See StepComment
      Parameters:
      comment - the comment