如何在STS(Eclipse)中生成黄瓜特征的步骤?
How to generate steps of cucumber features in STS (Eclipse)?
我看过了,也试过按照它的步骤生成特征文件的步骤。这是我在 pom.xml
中的依赖项:
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.4.0</version>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-junit</artifactId>
<version>1.2.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-java8</artifactId>
<version>1.2.5</version>
<scope>test</scope>
</dependency>
</dependencies>
我定义了亚军 class 如下:
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
import org.junit.runner.RunWith;
@RunWith(Cucumber.class)
@CucumberOptions(plugin = {"pretty", "html:target/cucumber"})
public class RunCukesTest {
}
并且特征文件位于项目中的src/features
:
问题是,当我 right click on the feature file-> Run as-> Cucumber
没有任何反应。
我希望,黄瓜跑步者会跑,并给我步骤
那么,怎么了?
特征是:
特征:特征的标题
我要将数据提交到注册表中
Scenario: Register into the forum
Given I want to register into the main forum
When I enter name
And I enter passwrod
And I repeat the password
And I enter username
And I enter email
Then I click the submit
我不需要 RunCukesTest
在 all.The 点是在 STS 上安装 Cucumber-jvm
插件,它很容易生成步骤。 This 问题也很有用。
此外,对于 运行 Eclipse 中的功能文件,您应该
- 打开文件
- 右击它
- 俄罗斯
- 1 个黄瓜功能
我看过了,也试过按照它的步骤生成特征文件的步骤。这是我在 pom.xml
中的依赖项:
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.4.0</version>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-junit</artifactId>
<version>1.2.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-java8</artifactId>
<version>1.2.5</version>
<scope>test</scope>
</dependency>
</dependencies>
我定义了亚军 class 如下:
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
import org.junit.runner.RunWith;
@RunWith(Cucumber.class)
@CucumberOptions(plugin = {"pretty", "html:target/cucumber"})
public class RunCukesTest {
}
并且特征文件位于项目中的src/features
:
问题是,当我 right click on the feature file-> Run as-> Cucumber
没有任何反应。
我希望,黄瓜跑步者会跑,并给我步骤
那么,怎么了?
特征是:
特征:特征的标题 我要将数据提交到注册表中
Scenario: Register into the forum
Given I want to register into the main forum
When I enter name
And I enter passwrod
And I repeat the password
And I enter username
And I enter email
Then I click the submit
我不需要 RunCukesTest
在 all.The 点是在 STS 上安装 Cucumber-jvm
插件,它很容易生成步骤。 This 问题也很有用。
此外,对于 运行 Eclipse 中的功能文件,您应该
- 打开文件
- 右击它
- 俄罗斯
- 1 个黄瓜功能