问题
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