Skip to content

thapovan-inc/nightwatch-html-reporter

 
 

Repository files navigation

nightwatch-reporter

Generates an HTML view of the Nightwatch.js test reports with Screenshots by either parsing the XML files generated by Nightwatch or by using the Nightwatch reporter options.

Need to replace in package.json, the existing package nightwatch-html-reporter , with this @webng/nightwatch-reporter and use compact Theme in globals.js.

Usage

Using Built in Nightwatch reporter

Requires Nightwatch >= 0.5.32.

/* In nightwatch/globals.js */
const HtmlReporter = require('nightwatch-reporter');
const reporter = new HtmlReporter({
    openBrowser: true,
    reportsDirectory: 'output/reports',
    reportFilename: 'index.html',
    themeName: 'compact',
    appFaviconUrl: 'https://www.palassets.com/favicon.ico',
    appLogoUrl: 'https://www.palassets.com/sprites/paltalk_logo_white.svg',
    relativeScreenshots: true
});
module.exports = {
    reporter: reporter.fn
};

It must be noted that, for a screenshot to be associated with an assertion in the report being generated:

  1. the assertion message string must be equal the screenshot filename..
  2. Screenshots must be placed in the directory /output/screenshot

Assertion:
    browser.waitForElementVisible('@DownloadExe', 5000, false, () => {}, `User registered successfully`)


Screenshot:
     browser.saveScreenshot('./output/screenshots/User registered successfully.png');```

About

Generates an HTML view of the Nightwatch.js test reports by either parsing the XML files generated by Nightwatch or by using the Nightwatch reporter options.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 63.3%
  • HTML 22.7%
  • CSS 14.0%