When using the --xunit=/path/to/report.xml casperjs is using the message
as property for the name of the testcase node in xml report.
This means if you fail a test like:
1
casper.fail('A really long and expressive message');
the resulting xml would look something like:
123
<testcaseclassname="a-custom-test-case-name"name="A really long and expressive message"time="0.023"><failuretype="fail">A really long and expressive message</failure></testcase>
Imagine you want to capture and provide an stacktrace from a jsp page
as message..
Here comes the optional argument FTW.
As stated above, pass in a arbitrary object with a name property like:
<testcaseclassname="a-custom-test-case-name"name="stacktrace"time="0.023"><failuretype="fail">Exception in thread "main" java.lang.NullPointerException
at Test.test(Test.java:6)
at Test.main(Test.java:10)
</failure></testcase>