Open abelnation opened 10 years ago
Hi ran into this today as well, any update on how to resolve?
I found a workaround. You can override xunit on the file specified on --includes. Say you have something like:
options = {
casperjsOptions: ['--includes=./test/casper-setup.js'],
}
Then on ./test/casper-setup.js you can:
casper.cli.options.xunit = './artifacts/test/results-' + new Date().toISOString() + '.xml';
This will generate a new results-.xml file with Date's toISOString appended. Then maybe after all casperjs tests are run you can aggregate all .xml files into one or, if your xunit processor accepts multiple xml files, leave it this way.
@inerte Saved my day! Is it necessary to put the config in its own JS file or can you just slap it in the Gruntfile? I only had success with the former.
Hey @darwin604 , I am glad I was able to help. I think you can only manipulate the casper object in casper included files, either specified on --includes or the actual files with the tests.
If you have a single target that runs multiple src files, and specifies an xunit path. The xunit file will be overwritten by each subsequent file that is run.