【发布时间】:2016-05-20 16:12:32
【问题描述】:
无法弄清楚如何与 gradle 并行运行 Serenity Web 测试。 Here 是 maven + jenkins 的一个例子。但我需要 gradle 一样的东西。
【问题讨论】:
标签: selenium gradle thucydides serenity-bdd
无法弄清楚如何与 gradle 并行运行 Serenity Web 测试。 Here 是 maven + jenkins 的一个例子。但我需要 gradle 一样的东西。
【问题讨论】:
标签: selenium gradle thucydides serenity-bdd
您可以按照以下步骤进行操作
第 1 步:创建套件文件
第二步:在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
}
现在在 cmd 提示符下运行命令'gradle clean runAParallelSuite aggregate'
【讨论】:
这是另一种方法
test {
maxParallelForks=2
options {
systemProperties(System.getProperties())
}
...
}
maxParallelForks 允许设置与 jUnit 并行执行的最大分叉测试进程数
【讨论】: