如何从命令行运行Cucumber-JVM功能文件 [英] How to run a Cucumber-JVM feature file from the command line
本文介绍了如何从命令行运行Cucumber-JVM功能文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个文件扩展名为 .feature
的文件。如何从命令行运行它?
I have a file with file extension .feature
. HOw do run this from the command line?
为了为每个功能创建批处理文件。我正在将黄瓜-JVM 与Java和硒。
In order to make a batch file for each feature. I am using Cucumber-JVM with Java and Selenium.
推荐答案
黄瓜- JVM基于JUnit,因此就像从命令行运行任何单元测试一样
Cucumber-JVM is based on JUnit so its just like running any unit tests from the command line
java -cp /path/to/junit.jar org.junit.runner.JUnitCore [test class name]
其中测试类名
带有 @CucumberOptions
其 功能
是指功能文件。如果您使用Maven,则可以使用
where test class name
is annotated with @CucumberOptions
whose features
refer to the feature file. If youre using Maven you could use
mvn test
这篇关于如何从命令行运行Cucumber-JVM功能文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文