问题
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