Search code examples
seleniumgradlethucydidesserenity-bdd

How do I run Serenity web tests in parallel with gradle?


Can't figure out how to run Serenity web tests in parallel with gradle. Here is an example with maven + jenkins. But I need the same thing with gradle.


Solution

  • you can do this by following the steps

    Step 1: Create Suite file

    Step 2: Enter the following task code in gradle

    task runAParallelSuite(type: Test) {
        def forks =2
        exclude ('**/Library.java')
        println "The Maximum parallel is $forks"
        // uncomment maxParallelForks if you prefer to use the Gradle process forker
        // which also requires a complete change of how the suite class works
        maxParallelForks = forks
        include '**/**TestSuite.class'
        // testReportDir = file("${reporting.baseDir}/AParallelSuite")
        // testResultsDir = file("${buildDir}/test-results/AParallelSuite")
        // show standard out and standard error of the test JVM(s) on the console
        testLogging.showStandardStreams = true
    }
    

    now run the command in cmd prompt 'gradle clean runAParallelSuite aggregate'