【问题标题】:How do I show scenario name instead of feature name in Cucumber html report如何在 Cucumber html 报告中显示场景名称而不是功能名称
【发布时间】:2022-01-31 11:01:47
【问题描述】:

默认情况下,黄瓜报告显示特征名称。 由于我在 1 个功能文件中有多个场景, 我想显示场景名称而不是功能名称。 使报告更详细 我的黄瓜选项是:

 cucumberOptions = @CucumberOptions(
            features = "src/test/resources/features",
            monochrome = true,
            glue = "stepDefinitions",
            tags = {"not @disable"},
            plugin = {
                    "pretty",
                    "json:build/cucumber-report/cucumber.json",
                    "html:build/cucumber-report/cucumber.html"},
            strict = true
    )

【问题讨论】:

    标签: java jenkins cucumber cucumber-jvm


    【解决方案1】:

    我的报告也显示了场景信息。我正在使用 courgette-jvmtestNG 这是我的设置

    package com.test;
    
    import courgette.api.CourgetteOptions;
    import courgette.api.CourgetteRunLevel;
    import courgette.api.CucumberOptions;
    import courgette.api.testng.TestNGCourgette;
    import io.cucumber.testng.AbstractTestNGCucumberTests;
    import org.testng.annotations.DataProvider;
    import org.testng.annotations.Test;
        @Test
        @CourgetteOptions(
                threads = 10,
                runLevel = CourgetteRunLevel.SCENARIO,
                rerunFailedScenarios = true,
                rerunAttempts = 1,
                showTestOutput = true,
                reportTitle = "Courgette-JVM Example",
                reportTargetDir = "build",
                environmentInfo = "browser=chrome; git_branch=master",
                cucumberOptions = @CucumberOptions(
                        features = "src/test/resources/com/test/",
                        glue = "com.test.stepdefs",
                        //tags = {"@post or @get"},
                        publish = true,
                        plugin = {
                                "pretty",
                                "json:target/cucumber-report/cucumber.json",
                                "html:target/cucumber-report/cucumber.html"}
                ))
        class AcceptanceIT extends TestNGCourgette {
        }
    

    包 com.test;

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-06-10
      • 2023-03-08
      • 2023-01-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多