【问题标题】:How do I run Serenity web tests in parallel with gradle?如何与 gradle 并行运行 Serenity Web 测试?
【发布时间】:2016-05-20 16:12:32
【问题描述】:

无法弄清楚如何与 gradle 并行运行 Serenity Web 测试。 Here 是 maven + jenkins 的一个例子。但我需要 gradle 一样的东西。

【问题讨论】:

    标签: selenium gradle thucydides serenity-bdd


    【解决方案1】:

    您可以按照以下步骤进行操作

    第 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'

    【讨论】:

    • 您能解释一下步骤 1 吗?应该如何创建 Suite 文件?
    【解决方案2】:

    这是另一种方法

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

    maxParallelForks 允许设置与 jUnit 并行执行的最大分叉测试进程数

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-06-24
      • 1970-01-01
      • 2014-07-11
      相关资源
      最近更新 更多