SLY
SLY

Reputation: 535

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.

Upvotes: 4

Views: 3467

Answers (2)

SLY
SLY

Reputation: 535

Here is another way to do this

   test {
       maxParallelForks=2
       options {
           systemProperties(System.getProperties())
       }
       ...
   }

maxParallelForks allows to set maximum number of forked test processes to execute in parallel with jUnit

Upvotes: 1

selva
selva

Reputation: 1175

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'

Upvotes: 4

Related Questions