xunit not writing out file

183 views
Skip to first unread message

Michael Reust

unread,
Jul 24, 2013, 6:53:06 PM7/24/13
to casp...@googlegroups.com
PhantomJS: 1.9.1
CasperJS: 1.0.2

I'm running a single test file with the xunit flag, but no log.xml file is created.



Lokesh Yadav

unread,
Jul 25, 2013, 8:34:29 AM7/25/13
to casp...@googlegroups.com
Hey Michael, 

It would be great if you share the code snippet and also the command you are using to generate the logs.xml


Thanks,
Lokesh Yadav

Michael Reust

unread,
Jul 25, 2013, 4:58:28 PM7/25/13
to casp...@googlegroups.com
I've tried a very simple example:

-----simpleTest.js-----------

var casper = require('casper').create();

casper.start('www.google.com', function(){

this.test.pass('test 1');
this.test.pass('test 2');

});

casper.run();

I run that simple test with the --unit modifier and no file is created.

Nicolas Perriault

unread,
Jul 25, 2013, 5:28:08 PM7/25/13
to casp...@googlegroups.com
On Thu, Jul 25, 2013 at 10:58 PM, Michael Reust <re...@betterment.com> wrote:

> I run that simple test with the --unit modifier and no file is created.

The --xunit (note the 'x') option only works using the `casperjs
test`subcommand.

Test script:

// test.js
casper.start('http://google.com', function() {
this.test.pass('plop');
});

casper.run(function() {
this.test.done();
});

Execution (using casper 1.0.2):

$ casperjs test test.js --xunit=log.xml
Test file: test.js
PASS plop
PASS 1 test executed in 0.071s, 1 passed, 0 failed, 0 dubious, 0 skipped.
Result log stored in log.xml

$ cat log.xml
<testsuite time="0"><testcase classname="test" name="plop"
time="0.056"></testcase></testsuite>

As a side note, you should consider switching to 1.1-beta1 which
provides a better XUnit output.

++

--
Nicolas Perriault
https://nicolas.perriault.net/
Phone: +33 (0) 660 92 08 67

Michael Reust

unread,
Jul 25, 2013, 5:49:46 PM7/25/13
to casp...@googlegroups.com, nic...@perriault.net
Thanks Nicolas, that code sample worked.  This line at the beginning of my example, seems to cause it to not work:

var casper = require('casper').create();





Message has been deleted

Nuruddin Iminohunov

unread,
Feb 26, 2015, 2:28:59 AM2/26/15
to casp...@googlegroups.com
In my case also , i am running casperjs test sometest.js --xunit=log.xml but can't succeed

vatsal...@gmail.com

unread,
Apr 6, 2015, 3:23:26 AM4/6/15
to casp...@googlegroups.com

Hi I am running 
Casperjs - 1.1.0-beta3
PhantomJS  - 1.9.7
On Ubuntu 14.04 

I am trying to use the --xunit on a set of test files in a folder (written in JS) and the XML file output doesnt get generated unless I run the test files individually.
Any way to get it to work on an entire directory of files?
Reply all
Reply to author
Forward
0 new messages