我已经在JenkinsFile中定义了以下步骤,该步骤在运行Jenkins流水线时生成HTML报告:
stage('Run Integration Tests') {
steps {
dir("${env.WORKSPACE}/test/integration") {
sh'''
npm install -g newman
npm install -g newman-reporter-htmlextra
newman run postman_collection.json -e ''' +APIGEE_ENVIRONMENT+'''.postman_environment.json --reporters cli,htmlextra --reporter-htmlextra-export "newman_result.html"
'''
}
}
}
我尝试发布这份报告,但无论尝试什么,都不能显示报告,只显示一个空的HTML页面。我可能在配置上弄错了些什么,已经被卡了好几个小时了。希望有人能找到缺失的部分。非常感谢您的帮助。
stage('Artifacts') {
steps {
publishHTML(target: [
alwaysLinkToLastBuild: false,
allowMissing: false,
keepAll: true,
reportDir: "${WORKSPACE}",
reportFiles: 'newman_result.html',
reportName: 'Integration Test Results',
reportTitles: ''
])
}
}