possible values for @CucumberOptions(plugin = …)

*爱你&永不变心* 提交于 2021-02-10 05:47:11

问题


I am using @CucumberOptions(plugin = {"pretty"} for test report in cucumber but the default colors for this are really bad..so I am looking to change the font color in output report. Anyone as any idea..how proceed further?


回答1:


For console colors see Console-Colours.

For reports you can specify that the report be output in JSON and then pass the generated JSON to a custom formatter. See Custom-Formatters. BTW, this is how TeamCity creates its reports.

Here is an example of generating both HTML and JSON reports:

@RunWith(Cucumber.class)
@Options(format = { "html:target/cucumber-html-reports", "json:target/cucumber-html-reports/cucumber.json"},
    features = { "."},
    tags = {"~@obsolete", "~@wip", "~@detailed", "~@SP", "@FRA001, @SWZ001"},
    strict = true)

public class CucumberRunnerTest {
}

JSON cucumber-jvm reports are not intended to be readable but to be intermediates that you pass to other applications. See the individual custom formatters for color options that they support.



来源:https://stackoverflow.com/questions/42878832/possible-values-for-cucumberoptionsplugin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!