1. junit 配置@RunWith(Cucumber.class)@CucumberOptions(format ={"pretty","html:target/cucumber"},features={"src/main/java/demoapp"},tags={"@third"})public class test { }# language: zh-CN功能:测试@third场景大纲:一些测试假如 firstw "demo"当 demoinfo 那么 appdemo 例子:|name| info||first|dalong||second|aaaaa|Feature:Belly@firstScenarioOutline: a few cukesGiven firstw "demo"When demoinfo Then appdemo Examples:|name| info||first|dalong||second|aaaaa|publicclassMyStepdefs{@Given("I have (\\d+) cukes in my belly")publicvoid I_have_cukes_in_my_belly(int cukes){System.out.format("Cukes: %n\n", cukes);}@When("^I wait (\\d+) hour$")publicvoid i_wait_hour(int arg1)throwsThrowable{// Write code here that turns the phrase above into concrete actionsthrownewPendingException();}@Then("^dodemo$")publicvoid dodemo()throwsThrowable{// Write code here that turns the phrase above into concrete actionsSystem.out.println("dodemo");}@Given("^first \"([^\"]*)\"$")publicvoid first(String arg1)throwsThrowable{// Write code here that turns the phrase above into concrete actionsSystem.out.println("first"+": "+ arg1);}@Then("^my belly should growl$")publicvoid my_belly_should_growl()throwsThrowable{// Write code here that turns the phrase above into concrete actionsthrownewPendingException();}@Given("^first demo$")publicvoid first_demo()throwsThrowable{// Write code here that turns the phrase above into concrete actionsSystem.out.println("first_demo");}@When("^user names$")publicvoid user_names(DataTable arg1)throwsThrowable{// Write code here that turns the phrase above into concrete actions// For automatic transformation, change DataTable to one of// List , List >, List