我下载了 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();
})