Closed fomnus closed 3 weeks ago
@fomnus why don't you link to your whole code. where you are creating myresult.json file you should instead just create the report, you shouldn't need both. Also AI can likely help you as this is not an issue with createHtmlReport
@fomnus I am not sure what is the content of your myResults.json but I think it will contain multiple layers of results, e.g violations, incomplete, etc.
I suggest to use following structure if you want to use raw json file:
const rawAxeResults = require('./rawAxeResults.json');
createHtmlReport({
results: rawAxeResults,
options: { outputDir: 'artifacts', reportFileName: 'reportFromRawAxeResults.html' },
});
This is how raw results may look like: https://github.com/lpelypenko/axe-testcafe-demo/blob/main/testcafe/rawAxeResults.json
I will close the issue since it is not reproducible and author is not responsive.
Trying to run this and getting the following errros
(() => { const rawAxeResults = JSON.parse(readFileSync('myResults.json', 'utf8')) createHtmlReport({ results: { violations: [rawAxeResults] } }) })(); HTML report was not created due to the error Cannot read properties of undefined (reading 'length')