Stages are sort of "flat steps" with body following the call within current context (test or step body). End of context or another stage start should finish a stage.
Proposed API: Allure::startStage(?string $name = null): void. We cannot use annotations with this API, so we'll have to use Allure::* shortcuts to decorate stage.
Problems: As for now, shortcuts such as Allure::parameter() deal with "current test" context; to implement effective stages we'll have to make them work with "current test or step" context, changing "classic" behavior. Another way to solve this problem is to provide alternate shortcuts, either in Allure::stepParameter() or AllureStep::parameter() form. We can also change "classic" behavior but provide fallbacks like Allure::testParameter() for those who want to decorate test from within a step. And one more way is to return StepContextInterface from stage starting method.
Stages are sort of "flat steps" with body following the call within current context (test or step body). End of context or another stage start should finish a stage.
Proposed API:
Allure::startStage(?string $name = null): void. We cannot use annotations with this API, so we'll have to useAllure::*shortcuts to decorate stage.Problems: As for now, shortcuts such as
Allure::parameter()deal with "current test" context; to implement effective stages we'll have to make them work with "current test or step" context, changing "classic" behavior. Another way to solve this problem is to provide alternate shortcuts, either inAllure::stepParameter()orAllureStep::parameter()form. We can also change "classic" behavior but provide fallbacks likeAllure::testParameter()for those who want to decorate test from within a step. And one more way is to returnStepContextInterfacefrom stage starting method.