picuscreative / testcafe-reporter-html

The HTML reporter for TestCafe
https://picuscreative.com/
22 stars 30 forks source link

Not able to implement the Report in Runner class #26

Closed bhatnagars closed 4 years ago

bhatnagars commented 4 years ago

Please help in getting the reports generated through runner class

runner class === const createTestCafe = require ('testcafe'); let testcafe = null;

createTestCafe('localhost', 1337) .then(tc => { testcafe = tc; const runner = testcafe.createRunner();

return runner .src(['tests/my-demo.js']) .browsers(['safari']) .reporter('Reports/') .run(); }) .then(failedCount => { console.log('Tests failed: ' + failedCount); testcafe.close(); });

==== Getting below error TestCafe nimit$ node runner.js Error: The provided "html:Reports/" reporter does not exist. Check that you have specified the report format correctly. at /Users/nimit/TestCafe/node_modules/testcafe/src/runner/bootstrapper.js:146:27 at processTicksAndRejections (internal/process/task_queues.js:93:5) at async Promise.all (index 0) Nimits-MacBook-Pro:TestCafe nimit$ node runner.js Error: The provided "Reports/" reporter does not exist. Check that you have specified the report format correctly. at /Users/nimit/TestCafe/node_modules/testcafe/src/runner/bootstrapper.js:146:27 at processTicksAndRejections (internal/process/task_queues.js:93:5) at async Promise.all (index 0)

bhatnagars commented 4 years ago

got it finally on my own

iJimmyWei commented 4 years ago

For anyone encountering this issue, the format for the reporter should be .reporter("html", "report.html") when instantiating the runner class i.e

return runner
   .src('test.js')
   .browsers(['chrome'])
   .reporter("html", "report.html")
   .run();
Tester-Dolores commented 3 years ago

Global installation is required npm install -g testcafe-reporter-html