使用此JUnit运行程序运行测试时:
@RunWith(Cucumber.class)
@CucumberOptions (
features = "C:\\myfeature.feature",
glue = {"stepmethods"},
plugin = {pretty},
junit = "--step-notifications",
dryRun = false
)
public class RunTest {
}
并使用标准功能文件
**Given** I'm on the homepage
**When** I enter the correct credentials
**And** I click submit
**Then** I will get a userlist
当我运行此控制台日志时,显示测试以When关键字开始。 (我知道这是因为我偶尔会打印来控制一些检查点。)
如果我注释掉When,And和Then步骤,我会得到正确的输出。
可能是什么问题?
更新:
测试以正确的顺序运行,但它们不会以相同的顺序记录到控制台。
这似乎与plugin = {pretty}
选项有关。当它被排除时,记录似乎很好。
我仍然想保留这个选项。有解决方法吗?
尝试在双引号和添加报表类型之间放置相当。
@CucumberOptions (
features = "C:\\myfeature.feature",
glue = {"stepmethods"},
plugin = {"pretty", "html:some/dir"},
junit = "--step-notifications",
dryRun = false
)