Testing testcafe中的Html testrail报告不正确

Testing testcafe中的Html testrail报告不正确,testing,automated-tests,report,testcafe,testrail,Testing,Automated Tests,Report,Testcafe,Testrail,我下载了testcafe reporter html testrail,并在我的testcafe项目中使用它。如果我为报告提供自定义名称,则报告无法正确保存,即报告不完整,几乎为空,只有几行……但是,如果我没有提供自定义名称,则报告将以report_TIMESTAMP.html格式保存,例如:report_16_5_2018_14_46_46.html 我做错了什么 const createTestCafe = require('testcafe'); let testcafe = null;

我下载了testcafe reporter html testrail,并在我的testcafe项目中使用它。如果我为报告提供自定义名称,则报告无法正确保存,即报告不完整,几乎为空,只有几行……但是,如果我没有提供自定义名称,则报告将以report_TIMESTAMP.html格式保存,例如:report_16_5_2018_14_46_46.html 我做错了什么

const createTestCafe = require('testcafe');
let testcafe = null;

createTestCafe()
.then(tc => {
    testcafe     = tc;
    const runner = testcafe.createRunner();

    let id;
    const deadlinePromise = new Promise((resolve,reject) => {
        id=setTimeout(() => {
       clearTimeout(id);
       reject('testcase couldnt meet the actual preferred time');
        },215000)
     });

const runPromise=runner
    .src(test1.ts)  
    .browsers('chrome:headless')
     // what am I doing wrong in the below step? the report is not saving properly
    .reporter('html-testrail', 'Reports/report1.html')        
    .run({skipJsErrors:true})             


race =Promise.race([runPromise,deadlinePromise])
race.then((res) => console.log(res))      

})

       .catch(failedCount => {
           console.log('Tests1 failed: ' + failedCount);
            testcafe.close();
        })

要为“testcafe reporter html testrail”reporter指定自定义输出文件,您需要按照中所述指定相应的环境变量。

要为“testcafe reporter html testrail”reporter指定自定义输出文件,您需要按照中所述指定相应的环境变量。

html testrail reporter忽略输出选项,而是使用html\u REPORT\u路径和html\u REPORT\u名称环境变量。您可以使用process.env修改环境变量并将报告保存在所需位置:

process.env.HTML_REPORT_PATH=PATH.resolve'Reports'; process.env.HTML_REPORT_NAME='report1.HTML'; html testrail reporter忽略输出选项,而是使用html_REPORT_PATH和html_REPORT_NAME环境变量。您可以使用process.env修改环境变量并将报告保存在所需位置:

process.env.HTML_REPORT_PATH=PATH.resolve'Reports'; process.env.HTML_REPORT_NAME='report1.HTML';
环境变量是在index.js中自动创建的,我需要知道的是,我是否必须更改index.js中的任何内容,以便在提供自定义名称时正确显示报告?我有这样的印象。reporter'html-testrail'、'Reports/report1.html'覆盖testcafe中index.js中的默认设置,并创建一个报告名为report1.html的报告,但这并没有发生。环境变量在index.js中自动创建,我需要知道的是,我是否必须更改index.js中的任何内容,以便在提供自定义名称时报告能够正确显示?我当时的印象是,reporter'html-testrail'、'Reports/report1.html'覆盖了testcafe中index.js中的默认设置,并创建了一个报告名为report1.html的报告,但事实并非如此。