Search code examples
playwrightplaywright-test

generating multiple reporting folder in playwright


enter image description hereI'm trying to generate multiple reporting folders inside a folder for JUnit and HTML reports, seems like playwright will override the other folder. after tests, I can see only the HTML report folder and other JUnit results won't be available. is there any way to have multiple results folders under one folder?


Solution

  • outputDir is used for another purpose other than test results based on the information available here. So I would recommend against storing test results inside it. Instead, you can do something like this.

    const path = require('path');
    const resultsDir = path.resolve('./', 'output')
    
    reporter: [ ['json', { outputFile: `${resultsDir}/json/results.json` }] ]