Cucumber execution order in Jenkins

情到浓时终转凉″ 提交于 2020-01-25 08:14:34

问题


I have over 20 Cucumber features, when I execute test on my computer - test are running with alphabetic order, but when I execute test in remote Jenkins, order is always the same, but not in alphabetical order. Do you know how execution order in jenkins is set? I have problem with that because I have rerun class and I want to execute it at the end of tests


回答1:


I have the same situation as you. But i create the order of execution from runner class in cucumber. In tags i identify the order of all my features like this

tags = {"@Login-Feature,@Account,@Transfer,@Check,@Log-Out"}

During the execution in Jenkins it takes this order, it doesn't create from alphabetic.




回答2:


First, As you can see in the cucumber release notes, there is --order options for feature files.

Second, If you define feature files with in order under CucumberOptions like following it is also gonna run in order you define.

@Cucumber.Options(features={"automatedTestingServices.feature", "smoketest.feature"})

Third, And also you can give your execution order from terminal.(You didn't mentioned how you trigger and run your tests from jenkins)

cucumber login.feature order.feature account.feature


来源:https://stackoverflow.com/questions/58281049/cucumber-execution-order-in-jenkins

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!