QA-Automation-Starter / qa-automation

QA automation utilities and project generator
https://qa-automation-starter.aherscu.dev
Other
6 stars 4 forks source link

current jgiven versions do not work well with multiple stages #213

Open adrian-herscu opened 11 months ago

adrian-herscu commented 11 months ago

Current State Scenario classes have to extend with many generic types:

extends ApplicationPerMethodWebSessionTest<TestConfiguration, GoogleFixtures<?>, GoogleActions<?>, GoogleVerifications<?>>

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:

extends ApplicationPerMethodWebSessionTest<TestConfiguration>

and then calling steps:

given(SomeFixtures.class)
  .some_step();
when(SomeActions.class)...
then(SomeVerifications.class)...
adrian-herscu commented 11 months ago

https://github.com/TNG/JGiven/issues/1469