简体   繁体   English

黄瓜测试方案并行运行?

[英]Cucumber test scenarios running in parallel?

I've couple test features in my project and so far i'm running them in parallel using runner classes with thread count.. but the problem here is optimising execution time because on of these threads taking longer time to finish test scenarios 我已经在项目中耦合了测试功能,到目前为止,我正在使用带有线程数的运行器类并行运行它们。.但是这里的问题是优化执行时间,因为这些线程花费较长的时间来完成测试方案

Is there any better approach to execute test scenarios in parallel?? 有没有更好的方法可以并行执行测试方案?

Any help.. much appreciated!! 任何帮助..非常感谢!

Take a look at Courgette-JVM 看看Courgette-JVM

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 {
    }

Try using QAF gherkin it runs scenario in parallel rather than feature. 尝试使用QAF小黄瓜,它可以并行运行场景而不是功能。 you need to use factory class provided by the framework and configure your execution using testNG xml. 您需要使用框架提供的工厂类,并使用testNG xml配置执行。 Below is the sample config file: 以下是示例配置文件:

<test name="Gherkin-QAF-Test" parallel="methods">
   <parameter name="step.provider.pkg" value="com.qmetry.qaf.automation.impl.step.qaf" />
   <parameter name="scenario.file.loc" value="resources/features" />
   <classes>
      <class name="com.qmetry.qaf.automation.step.client.gherkin.GherkinScenarioFactory" />
   </classes>
</test>

Above configuration will run scenarios available in feature files under resources/features in parallel. 以上配置将并行运行resources/features下功能文件中可用的方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM