WebDriverio-无法动态传递输出目录
以下是我的Onprepare&记者。当我在记者中访问result_path时,我的价值为未定义。
onPrepare: function (config, capabilities) {
today = new Date()
date = today.getDate()
time = date + "_" + today.getHours() + "hrs_" + today.getMinutes() + "mins_" + today.getSeconds() + "secs"
result_path = './execution_time_'+ time
if (!fs.existsSync(result_path)) {
fs.mkdirSync(result_path);
}
},
reporters: [['timeline', {
outputDir: result_path+'/',
fileName: 'timeliner-reporter.html',
embedImages: true,
images: {
quality: 80,
resize: false,
reductionRation: 2
},
screenshotStrategy:'before:click'
}]],
Below is my onprepare & reporters. When I access result_path in reporters I got value as undefined.
onPrepare: function (config, capabilities) {
today = new Date()
date = today.getDate()
time = date + "_" + today.getHours() + "hrs_" + today.getMinutes() + "mins_" + today.getSeconds() + "secs"
result_path = './execution_time_'+ time
if (!fs.existsSync(result_path)) {
fs.mkdirSync(result_path);
}
},
reporters: [['timeline', {
outputDir: result_path+'/',
fileName: 'timeliner-reporter.html',
embedImages: true,
images: {
quality: 80,
resize: false,
reductionRation: 2
},
screenshotStrategy:'before:click'
}]],
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论