From 108072f59675df55da0483c7c071d93d6eb6128e Mon Sep 17 00:00:00 2001 From: erinn Date: Thu, 27 Jan 2022 14:11:22 -0800 Subject: [PATCH] gherkin --- index2.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 index2.js diff --git a/index2.js b/index2.js new file mode 100644 index 00000000..dffeea30 --- /dev/null +++ b/index2.js @@ -0,0 +1,20 @@ + +var fs = require("fs"); +var reporter = require('cucumber-html-reporter'); +const reportRootDir = 'integration_test/gherkin/reports/' +const jsonReportPath = `${reportRootDir}json_report.json`; +const htmlReportPath = `${reportRootDir}cucumber_report.html`; +const reportFile = fs.readFileSync(`${reportRootDir}integration_response_data.json`); +//const jsonReport = JSON.parse(JSON.parse(reportFile).gherkin_reports)[0]; +const jsonReport = JSON.parse(reportFile); +fs.writeFileSync(jsonReportPath, JSON.stringify(jsonReport)); + +var options = { + theme: 'bootstrap', + jsonFile: jsonReportPath, + output: htmlReportPath, + reportSuiteAsScenarios: true, + launchReport: false, +}; + +reporter.generate(options);