我面临一个与黄瓜标签和Junit设置有关的问题,因为老黄瓜和最新黄瓜之间存在差异。
在第一种情况下,@ facing,@When,@标记工作正常,但在Junit安装程序中,Cucumber.class和Cucumber.Options()会遇到问题。
第二种情况是CucumberOptions(..)(最新版本的更新版)工作正常,但与“Given”、“时间”、“然后”不一致。
请有人提供正确的黄瓜标签和JUnit设置有关的jar版本。
案例1:pom.xml
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-java</artifactId>
<version>1.0.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-junit</artifactId>
<version>1.0.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>Junit Runner:
import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions;
@RunWith(Cucumber.class)
@CucumberOptions(plugin={"pretty","html:reports/test-report"},tags= "@Smoketest")
public class JunitRunner {
}Case2:pom.xml
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-java</artifactId>
<version>1.2.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-junit</artifactId>
<version>1.2.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>Junit Ruuner
@RunWith(Cucumber.class)
@CucumberOptions(plugin={"pretty","html:reports/test-report"},tags= "@Smoketest")
public class JunitRunner {
}在1.2.2中,黄瓜标签面临问题,如下所示:

发布于 2016-11-14 15:59:24
你应该用这些进口品--
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;https://stackoverflow.com/questions/40592593
复制相似问题