繁体   English   中英

如何在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>

我已经定义了亚军类如下:

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 ,关键是在STS上安装Cucumber-jvm插件,它很容易生成步骤。 这个问题也非常有用。

另外,要在Eclipse中运行功能文件,您应该

  1. 打开文件
  2. 右键点击它
  3. 罗斯
  4. 1黄瓜特色

暂无
暂无

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

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