hae-uitest
Version:
A UI Test Framework for Huawei HAE
37 lines (34 loc) • 1.07 kB
JavaScript
//generate log content
var path = require('path');
module.exports = function(taskConf, callback) {
var log = {}, err = null;
try {
log = {
wtsPath: path.join(taskConf.wtsPath, taskConf.fulldate, taskConf.timestamp),
screenshotPath: path.join(taskConf.screenshotPath, taskConf.fulldate, taskConf.timestamp),
reportPath: path.normalize(taskConf.reportPath + path.sep + taskConf.timestamp + '.' + taskConf.reporter),
logPath: path.normalize(taskConf.logPath + path.sep + taskConf.timestamp + '.log')
}
log.testScripts = taskConf.testScripts.map(function(tml) {
return {
tmlPath: tml.filePath,
capabilities: {
browserName: tml.browserName,
version: tml.version,
platform: tml.platform
},
desc: tml.desc,
wtsList: tml.wtsList.map(function(wts) {
return {
wtsPath: path.join(log.wtsPath, wts.timestamp + '.wts'),
dataGroup: wts.dataGroup
}
})
};
});
log = JSON.stringify(log, null, ' ');
} catch (e) {
err = e;
}
callback(err, log);
}