0
votes

I'm using Cucumber Js and Webdriverio. I trying generate report automatically, without execute the command allure says (allure generate "outPut dir" && allure open).

I thinked maybe, executing the command in the hooks of webdriver io file (wdio.conf.js) but i can`t do.

1

1 Answers

0
votes

One way of doing that would be using NPM.

In your package.json you can add script called allure and the value of it as allure generate "outPut dir" && allure open

This is how we have it:

"scripts": {
"test": "wdio",
"allure-reports": "node_modules/.bin/allure generate ./reports/allure/allure-results/  -o ./reports/allure/allure-report/ --clean && allure open ./reports/allure/allure-report"

}

Now while triggering the test, you can use the command npm run test && npm run allure-reports

This way, npm would first run the wdio test and once that is completed it would trigger the allure script.

Please try that and let us know whether