Casperjs 1.1 does not generate XUnit xml file

2019-08-05 06:41发布

问题:

I am running CasperJS tests. I tried to generate xUnit xml file in output rendering. But this fails when ever a single FAILure occurs. Actually the executing stopped when a single FAIL occurs.

Here is the script that I am working on

casper.test.begin('Site login', '', function suite(test) {
   casper.start(mysite, function () {    
      test.assertExists('form#index', "Login Form found"); //Pass
      test.assertExists('form#index1', "Login Form found"); //Fail
   });

   casper.run(function (){
      test.done();
      test.renderResults(true, 0, 'test1.xml');
   });
});

回答1:

Try using casperjs test with the --xunit=<filename> option.