我很擅长学习并试图编写一个gradle任务来生成和打开诱惑报告。我正在尝试使用gradle node plugin(com.moowork.node)来使用“allure-commandline”nodejs包。当我有一个自定义节点脚本时,报告运行正常,但是当从gradle中使用默认的allure-commandline脚本执行相同操作时,报告运行正常。我认为报告过程在后台运行,因此无法打开。
task allure(type: NodeTask){
script =file('node_modules/allure-commandline/index.js')
args = ["allure","generate","allureResults","--clean","-o","allureReport"]
args = ["allure","open","allureReport"]
}
此节点任务有效:
task nodeAllure(type: NodeTask){
script =file('allure.js')
}
我的allure.js:
var allure = require('allure-commandline');
// returns ChildProcess instance
var generation = allure(['generate', 'reports/allure-results','--clean','-o','allure-report']);
generation.on('exit', function(exitCode) {
allure(['open','allure-report']);
});
答案 0 :(得分:0)
有Allure Gradle插件可供您处理所有工作。有关详细信息,请参阅文档https://docs.qameta.io/allure/2.0/#_gradle_3