and additional stages can be added via annotated fields or direct calls.
Annotated fields do not work with TestNG parallel modes.
Direct calls require boilder-plate like:
protected SomeElasticSearchVerifications<?> elasticSearchVerifications() {
val s = addStage(SomeElasticSearchVerifications.class);
s.beforeScenarioConfigurePolling();
return s;
Note the direct call to beforeScenarioConfigurePolling -- all JGiven annotations are not activated when stages are directly called.
How to make it better
Reusing stages should be like this:
Current State Scenario classes have to extend with many generic types:
and additional stages can be added via annotated fields or direct calls. Annotated fields do not work with TestNG parallel modes. Direct calls require boilder-plate like:
Note the direct call to
beforeScenarioConfigurePolling
-- all JGiven annotations are not activated when stages are directly called.How to make it better Reusing stages should be like this:
and then calling steps: