【发布时间】:2015-02-13 11:59:39
【问题描述】:
在 Eclipse 中创建我的功能文件后,我将其作为 Cucumber 功能运行。我使用控制台给我的步骤定义来创建测试文件的第一个基础
@Given("^the input is <(\\d+)> <(\\d+)>$")
这些应该由控制台输出,但目前它显示的功能没有步骤定义。
Feature: this is a test
this test is to test if this test works right
Scenario: test runs # src/test/resources/Test.feature:4
Given: i have a test
When: i run the test
Then: i have a working test
0 Scenarios
0 Steps
0m0,000s
这个功能只是为了检查黄瓜是否正常工作。
跑步者:
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
import org.junit.runner.RunWith;
@RunWith(Cucumber.class)
@CucumberOptions(
monochrome = true,
dryRun = false,
format = "pretty",
features = "src/test/resources/"
)
public class RunCukes {
}
控制台没有显示所有信息的原因是什么?
TL:DR 控制台不显示缺少步骤的步骤正则表达式
编辑:添加功能文件
Feature: this is a test
this test is to test if this test works right
Scenario: test runs
Given: i have a test
When: i run the test
Then: i have a working test
【问题讨论】:
-
请同时发布您的功能文件。
标签: java cucumber cucumber-jvm cucumber-junit