Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run cucumber jvm test scenarios in parallel using Gradle?

I couldn't find best solution for running cucumber test scenarios in parallel using gradle

The best possible solution found so far is this.. but I can't run it locally successfully

Any help much appreciated!!

Thanks in advance.

like image 709
Ranjith's Avatar asked Feb 05 '23 00:02

Ranjith's


1 Answers

Take a look at Courgette-JVM

You can execute this with a gradle task.

It has added capabilities to run cucumber tests in parallel on a feature level or on a scenario level.

It also provides an option to automatically re-run failed scenarios.

Usage

@RunWith(Courgette.class)
@CourgetteOptions(
    threads = 10,
    runLevel = CourgetteRunLevel.SCENARIO,
    rerunFailedScenarios = true,
    showTestOutput = true,
    cucumberOptions = @CucumberOptions(
            features = "src/test/resources/features",
            glue = "steps",
            tags = {"@regression"},
            plugin = {
                    "pretty",
                    "json:target/courgette-report/courgette.json",
                    "html:target/courgette-report/courgette.html"}
    ))
    public class RegressionTestSuite {
    }
like image 91
Prashant Ramcharan Avatar answered Feb 07 '23 19:02

Prashant Ramcharan