JGiven icon indicating copy to clipboard operation
JGiven copied to clipboard

Support nestedSteps for StepFunctions

Open jangalinski opened this issue 8 months ago • 2 comments

When I use NestedSteps as documented:

@NestedSteps
public NestedStage I_fill_out_the_registration_form_with_valid_values() {
    return I_enter_a_name("Franky")
        .and().I_enter_a_email_address("[email protected]")
        .and().I_enter_a_password("password1234")
        .and().I_enter_a_repeated_password("password1234");
}

I get a nicley generated report for "I_enter_a_name" as expected.

When I however use Stepfunctions


private StepFunction<MyStage> stepEnterName() = new StepFunction<>() {
   public  void apply(MyStage stage) {
       stage.I_enter_a_name("Franky")
   }
}

@NestedSteps
public NestedStage I_fill_out_the_registration_form_with_valid_values() {
    return self().$("custom description", stepEnterName());
}

I only get the "custom description" literal, no parameters, no formatting ...

Feature request: I can call a StepFunction without providing a description and when I do so, the regular stepName is used in the report.

Question: is this possible? Looks like there shouldn't be much difference between calling the step directly on the stage instance or doing so inside a step function.

jangalinski avatar Jun 27 '24 12:06 jangalinski