steve
steve

Reputation: 49

How to setup allure-report in nightwatch?

I am pretty new to allure-report. Can someone share the setup and configuration part of allure-report in nightwatch ?.

enter image description here

global module

const path = require('path');
const cwd = process.cwd();

module.exports = {
    reporter: function(results , done) {
      let srcResult = path.join(cwd,'/reports/client','*.xml');
      console.log('path to the reports'+srcResult);
      var generation = allure(["generate", "--clean", srcResult]);
      generation.on ('exit',()=>{
        done();
      });
    }
};

path to the reportsC:\uiautomation\reports\client\*.xml
C:\uiautomation\reports\client\CHROME_80.0.3987.122_Windows_user_registration.xml is not a directory
Report successfully generated to allure-report```


Upvotes: 0

Views: 1452

Answers (1)

Hendry Ang
Hendry Ang

Reputation: 40

you can try to use allure-commandline for this.

try this:

  • run npm install allure-commandline --save-dev
  • create external global.js with following code:

var allure = require("allure-commandline");

module.exports = {
    reporter: function(results , done) {
      let srcResult = "../path/to/your/xml/result";
      var generation = allure(["generate", "--clean", srcResult]);
      generation.on ('exit',()=>{
        done();
      });
    }
};

after this, you should be able to find allure result folder , and to open them u can use allure open command. also please remember to configure your globals_path in your nightwatch conf file.

Upvotes: 1

Related Questions