簡體   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