Gulp 如何将html报告添加到cucumber/chimp e2e测试中

Gulp 如何将html报告添加到cucumber/chimp e2e测试中,gulp,cucumber,e2e-testing,Gulp,Cucumber,E2e Testing,我使用的是黑猩猩网站上提供的示例,用于gulp chimp gulp.task('chimp-options', () => { return chimp({ features: './features', browser: 'phantomjs', singleRun: true, debug: false, output: { screenshotsPath: './scre

我使用的是黑猩猩网站上提供的示例,用于gulp chimp

gulp.task('chimp-options', () => {
    return chimp({
        features: './features',
        browser: 'phantomjs',
        singleRun: true,
        debug: false,
        output: {
            screenshotsPath: './screenshots',
            jsonOutput: './cucumber.json',
        },
        htmlReport: {
            enable: true,
            jsonFile: './e2e_output/cucumber.json',
            output: './e2e_output/report/cucumber.html',
            reportSuiteAsScenarios: true,
            launchReport: true,
        }
    });
});
我面临的问题是,当我运行吞咽黑猩猩选项时,我会得到:

Unable to parse cucumberjs output into json: './e2e_output/cucumber.json' SyntaxError: ./e2e_output/cucumber.json: Unexpected end of JSON input

What am I doing wrong ?

我相信chimp只是多个框架/库的包装器,我很确定它们只是用来生成HTML报告的

如果仍然无法通过chimp自动运行,只需像往常一样生成选项文件,然后npm安装html reporter,然后使用它生成相同的报告

创建一个名为generate_html_report.js的单独文件,并粘贴到正在使用的代码中。然后将其添加到npm脚本中,以便在测试套件完成后运行。我不想把它放在你的后钩子里,因为我以前遇到过这样的问题,JSON文件在它试图运行脚本之前并没有完全生成,而脚本期望JSON文件在那里