Closed mcelotti closed 6 years ago
Would you mind making a pull request? Shouldn't it be:
if (test.error) {
testCase.stacktrace(test.error.stack) // <-- stack instead of message
testCase.failure(test.error.message)
testCase.standardError(`\n${test.error.stack}\n`)
}
Yes, I've used the test.error.message because we did not want to see the complete stacktrace, but your note is right. I did not create a PR because honestly I'm not really sure that this is the right thing to do, maybe for other tools it's better to use the standard error() method.
@mcelotti so what would you suggest?
Maybe we could use a configuration flag to choose between error or failure + stacktrace? Or something similar, since we have 4 options: testCase.error / testCase.failure / testCase.stacktrace / testCase.standardError, and I think all could be useful depending on the situation
@mcelotti I think an option would be fine for that, would you mind proposing a PR for it?
No, no problem, I'll take a look
Hi, I'm importing the test results to Jira using the Xray plugin but the error message for failed tests is ignored.
Versions I've used: JIRA v7.7.0 Xray 2.3.2 wdio-junit-reporter 0.3.1
After a bit of debugging I found out that the fix is:
from
to
In my case failure(message) was not enough to let Jira show the error message, so the combination of failure and stacktrace did the trick.
Thanks