2017-05-06 74 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黃瓜功能