Closed aliu145 closed 6 years ago
Basically, 'single' and 'multi' options don't work. If I just put in:
outputFileFormat: function(opts) { return "results-${opts.cid}.${opts.capabilities}.xml" }
It will work..
ping @mcelotti ^^^
Hi @aliu145 what version of wdio-junit-reporter do you have in package.json?
@mcelotti the version is set to "^0.3.1"
You need to check (npm ls wdio-junit-reporter) if you're using the latest version (0.4.2). Or you could set it manually in package.json replacing "^0.3.1" with "0.4.2".
Thanks that worked! If I wanted to include run information in the file name i.e. browser type (Chrome), date/time, etc how could I access that?
Great! With the 'single' option you only get the config param since capabilities and cid are not applicable. In your case I think you could do something like:
outputFileFormat: {
single: (config) => `chrome-${new Date().getTime()}.xml`
}
This creates a file with a timestamp like 'chrome-1520895982563.xml' but you can customize to have a MM/dd/yyyy format or similar
I guess this can get closed then
When I try to add option to generate just one xml file (by adding outputFileFormat 'single' option), like below:
When I run my code now, no xml file is generated in the output directory (vs if I remove the 'outputFileFormat' var, it is generated when code is run). Any ideas why this may be happening?