我想創建黃瓜HTML報告,我是新來的節點JS,我試圖尋找它,我用下面的如何創建硒黃瓜HTML報告與節點JS
this.registerHandler('AfterFeatures', function(callback) {
try {
var options = {
theme: "bootstrap",
jsonFile: "/report/cucumber.json",
output: "/report/cucumber_report.html",
reportSuiteAsScenarios: true,
launchReport: true,
metadata: {
"App Version": "0.0.1"
}
};
reporter.generate(options);
} catch (e) {
console.log(e);
}
callback();
});
但是,當我運行碼,黃瓜功能的場景會被執行並且它最終給了我一個錯誤,說明,
Unable to parse cucumberjs output into json: '/report/cucumber.json' { Error: /report/cucumber.json: ENOENT: no such file or directory, open '/report/cucumber.json'
at Object.fs.openSync (fs.js:652:18)
at Object.fs.readFileSync (fs.js:553:33)
at Object.readFileSync (/Users/sarav/Documents/GitHub/automationtests/node_modules/jsonfile/index.js:67:22)
at isValidJsonFile (/Users/sarav/Documents/GitHub/automationtests/node_modules/cucumber-html-reporter/lib/reporter.js:404:48)
at Object.generate (/Users/sarav/Documents/GitHub/automationtests/node_modules/cucumber-html-reporter/lib/reporter.js:426:9)
at Object.generateReport [as generate] (/Users/sarav/Documents/GitHub/automationtests/node_modules/cucumber-html-reporter/index.js:30:21)
at /Users/sarav/Documents/GitHub/automationtests/features/support/hooks.js:49:22
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickCallback (internal/process/next_tick.js:180:9)
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: '/report/cucumber.json' }
執行上面的代碼自動生成以.json和.html文件或需要我們手動創建一個以.json文件,並轉換到這一個html報告。
我一直在使用Java,它會在執行結束時自動創建json和html報告。
由於這是很新的,我無法弄清楚什麼缺少的一部分
感謝