繁体   English   中英

如何从功能文件-黄瓜中提取Java类文件?

[英]How can I extract java class files from features files - cucumber?

我想从此功能文件中提取测试类:

Feature: Access seleniumframework.com website
Use selenium java with cucumber-jvm and navigate to website
Scenario: Print title, url
When I open seleniumframework website
Then I validate title and URL 

这是黄瓜跑课

package step_definitions;
import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
@RunWith(Cucumber.class)
@CucumberOptions(
    features = "classpath:features",
    plugin = {"pretty", "html:target/cucumber-html-report"},
    tags = {}
)
public class RunCukesTest{

}

步骤定义,即从Gherkin到运行系统的转换,是您必须自己编写的内容。 没有发生任何神奇的事情,您可以重新使用。

此博客文章可能会帮助您入门: http : //www.thinkcode.se/blog/2015/01/30/bdd-with-cucumberjvm-at-geecon-tdd-2015

另一个好的来源可能是黄瓜团队的这个入门项目: https//github.com/cucumber/cucumber-java-skeleton

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM