cucumber并发java,如何在Cucumber-JVM中并行运行功能/场景?

I have a set of acceptance tests written for the Cucumber-JVM. In order to reduce the feedback time I would like to run the scenarios (of a feature) in parallel. How do I do that in the simplest and most convenient way?

(I would prefer to be able to express this in Java code, as a regular JUnit test/runner, i.e. I would prefer not to resort to some workaround using the maven-surefire or maven-failsafe plugin which would require(?) twiddling and merging of the Cucumber reports afterwards.)

解决方案

Due to the nature of the cucumber-jvm package, test parallelization is limited for the time being. There are tentative plans for the future to change the API (gherkin3, cucumber-jvm v2), but nothing is available for full parallelization now on the cucumber-jvm.

There is still a way to attain a degree of parallelism on the cucumber-jvm. The Zucchini package (https://github.com/Comcast/Zucchini) can help by providing context-level parallelism, which could help if you have to run a battery of tests against Android / iOS / Chrome / etc. Test results are then merged into a single report.

To start using Zucchini, create a new test class that extends AbstractZucchiniTest and is tagged with @CucumberOptions and ZucchiniOutput. The class should then implement the List getTestContexts() method that returns a list of your specialized contexts.

Zucchini also provides other features such as cross-context barrier synchronization and aggregated test output into an HTML report. If you already have cucumber tests, there isn't much involved in upgrading them to Zucchini tests.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值