首页 文章

如何使用@tags在黄瓜框架中从testrunner类文件运行多个标签?

提问于
浏览
0
@RunWith(Cucumber.class)
@CucumberOptions( plugin = {"pretty","html:target/html/automation"},
                features = {"resource/***.feature"},
                glue={},
                tags={"@login","@Products"}
        )

这是我的功能文件

@登录

功能:登录应用程序

场景:这是验证应用程序是否已成功记录给定导航到Panasonic应用程序然后验证应用程序的 Headers 然后注销应用程序

@Products

功能:登录应用程序

背景:用户应该导航到应用程序的主页

给定用户使用有效凭据登录主页

单击主页上的目录链接时

场景:验证是否能够在产品页面中创建十个以上的产品

并检查目录的子菜单是否显示在 Headers 中

并查看我的产品目录表

1 回答

  • 2

    这是一个样本黄瓜Junit跑步者模板:

    @RunWith(Cucumber.class)
    @CucumberOptions(features = { "classpath:features/*.feature" }, glue = "packagename(s) or class name(s) containing the step definitions", plugin = {
            "pretty:target/prettyReport.txt", "html:target/cucumber", "json:target/cucumber.json", "rerun:target/rerun.txt",
            "junit:target/junit-report.xml", "testng:target/testng-output.xml" }, monochrome = true, tags = {"~@Ignore"})
    public class FeatureRunnerTest {
    
    }
    

    希望这可以帮助!!
    编辑:"~"符号..用于否定..运行除了标记为忽略标记的所有功能 . 另一方面,您可以在标签属性逗号中指定标签列表,以便仅运行那些测试

相关问题