繁体   English   中英

如何与其他类型的测试一起运行 cucumber 场景?

[英]How to run cucumber scenarios alongside other type of tests?

我有一些 cucumber 场景运行顺利,但我也想运行其他类型的测试。 比如,“测试页面上的每个组件”不是一个有效的场景,因为 BDD 是用来检查行为的。 我想划分 cucumber 场景和硒/组件测试

这是我的跑步者:

@RunWith(Cucumber.class)
@CucumberOptions(
        monochrome = true,
        features = {"src/test/test/features/"},            
        glue = {"test.steps"},        
        tags = {""},        
        plugin = {"pretty", "com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter:" +
                "path"}
)

您的 Cucumber 测试将在构建期间与其他单元测试 (*Test) 或集成测试 (*IT) 同时运行,具体取决于运行程序的名称(代码片段中缺少该名称)。

根据您是使用 Cucumber 来断言单元测试级别或集成测试级别的行为,请分别命名您的RunCucumberTestRunCucumberIT

例如(使用您提供的选项):

@RunWith(Cucumber.class)
@CucumberOptions(
        monochrome = true,
        features = {"src/test/test/features/"},            
        glue = {"test.steps"},        
        tags = {""},        
        plugin = {"pretty", "com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter:" +
                "path"}
)
public class RunCucumberTest {
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM