gradle / test-retry-gradle-plugin

Gradle plugin to retry tests that have failed to mitigate test flakiness.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TestNg Cucumber Test Suite is repeated as a whole

realdadfish opened this issue · comments

We're using cucumber-testng-7.8.1 together with testng-7.6.1 and try to setup test retry with this Gradle plugin.

This is one test class for a big set of tests that are largely divided by Cucumber tags:

@CucumberOptions(
    features = [
        "src/test/resources/features/"
    ],
    glue = [
        "our.glue.code",
        "more.shared.glue.code"
    ],
    plugin = [
        "pretty",
        "io.qameta.allure.cucumber7jvm.AllureCucumber7Jvm",
        "junit:build/reports/junit/test-results.xml",
        "json:build/reports/cucumber/cucumber-json-report.json"
    ],
    tags = "@dab-gsd and (not @ignore)"
)
@Test
@Listeners(TestLifecycleListenerGsd::class)
class TestRunnerGsd : AbstractTestNGCucumberTests()

Now we figured that when a single test fails not the single test is re-executed, but the whole TestRunnerGsd at once. We've configured no class filters or the like, just enabled the plugin and set maxRetries to 3.

Is retrying Cucumber tests on a per-scenario level supported by this plugin?

It does not support TestNG and might not fit your use-case, but if you just want individually retry-able cucumber tests, you might want to take a look at https://github.com/gradle/cucumber-companion.