Class StageBase<SELF extends StageBase<?>>

  • Type Parameters:
    SELF - the type of the subclass
    Direct Known Subclasses:
    Etapa, Etape, Fase, Stage, Stufe

    public class StageBase<SELF extends StageBase<?>>
    extends java.lang.Object
    Useful base class for step definitions as it provides a self() method to create fluent interfaces.

    Direct subclasses should provide introduction words (see IntroWord).

    Typically one derives from one of the language-specific step definition classes, which already provide a handful of useful introduction words.

    See Also:
    Stage, Stufe
    • Constructor Summary

      Constructors 
      Constructor Description
      StageBase()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      SELF $​(java.lang.String description)
      A simple helper to provide a description
      SELF $​(java.lang.String description, StepFunction<? super SELF> function)
      A step method for creating ad-hoc steps using lambdas.
      SELF self()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • StageBase

        public StageBase()
    • Method Detail

      • $

        public SELF $​(java.lang.String description,
                      @Hidden
                      StepFunction<? super SELF> function)
               throws java.lang.Exception
        A step method for creating ad-hoc steps using lambdas.

        Example Usage

        
             given().$( "Two negative arguments", stage -> {
                stage.given().argument( -5 )
                     .and().argument( -6 );
             });
         
        Parameters:
        description - the description of the step
        function - the implementation of the step in form of a function where the parameter is the stage the step is executed in
        Throws:
        java.lang.Exception
        Since:
        0.7.1
      • $

        public SELF $​(java.lang.String description)
        A simple helper to provide a description

        Example Usage

        
             given().$( "a description to improve the report, but is not related to any code that needs to be executed");
             );
         }
        Parameters:
        description - the description of the step
        Since:
        0.15.4