2017-05-06 80 views
0

我已经看到了它,并且我试图按照其步骤来生成功能文件的步骤。这是我的依赖关系pom.xml如何在STS(Eclipse)中生成黄瓜功能的步骤?

<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 
+0

第一次尝试运行跑步者类 – kushal

回答

0

我并不需要一个RunCukesTest在all.The点是安装Cucumber-jvm插件在STS上,它很容易生成步骤。 This问题也很有用。

此外,为了在Eclipse中运行的特征文件,你应该

  1. 打开文件
  2. 右击它
  3. 罗斯为
  4. 1黄瓜功能