Reporter output doesn't output anything even if we have data in reporter-output.html file
See original GitHub issueTestNG Version : 6.8.7 (reproducible in 6.9.8 also)
useDefaultListeners : true (use default listeners)
One of which is org.testng.reporters.jq.Main
Now log anything from test cases using Reporter.log
.
For reproduction, I used 2 test cases with retry mechanism in place using IRetryAnalyzer
.
I am failing both the tests intentionally.
When I see the reports, in target/surefire-reports/index.html
(produced by org.testng.reporters.jq.Main
) doesn’t show anything in Reporter
output section, sometimes it shows entry for one test case and not for the other. While data is always there in target/surefire-reports/old/<suite_name>/reporter-output.html
.
While debugging, I found when we create report in org.testng.reporters.jq.Main class
.
It goes to following method in ReporterPanel
to get data from Reporter
:
public String getContent(ISuite suite, XMLStringBuffer main) {
XMLStringBuffer xsb = new XMLStringBuffer(main.getCurrentIndent());
for (ITestResult tr : getModel().getAllTestResults(suite)) {
List<String> lines = Reporter.getOutput(tr);
if (! lines.isEmpty()) {
xsb.push(D, C, "reporter-method-div");
xsb.addRequired(S, Model.getTestResultName(tr), C, "reporter-method-name");
xsb.push(D, C, "reporter-method-output-div");
for (String output : lines) {
xsb.addRequired(S, output, C, "reporter-method-output");
}
xsb.pop(D);
xsb.pop(D);
}
}
return xsb.toXML();
}
In this, Reporter
is coming as null
, due to which it doesn’t get any data.
I also tried to disable all reporters except this to give it first chance to access Reporter
, but no luck.
Issue Analytics
- State:
- Created 7 years ago
- Comments:8
Working on creating a sample
Could you try with 6.9.10 (latest on maven central) or later (available on bintray) ?