how to run cucumber test using command line

2019-08-07 19:14发布

问题:

I have test cases written in cucumber with java. I am using IDE IntelliJ. I can run from IDE UI by simply right click a feature file. but now the requirement is I need to run tests in jenkins using command line.

explore maven option but has another issue with authentication.

is there any other way to directly run cucumber features through command line?

回答1:

See the JUnit section here: https://cukes.info/running.html

Create the empty class as described and then run the empty class as a junit with something like this:

java -cp .:/usr/share/java/junit.jar org.junit.runner.JUnitCore RunCukesTest


标签: cucumber