I have created pipeline in Jenkins for running my postman collection via Newman on centOS7.6. collection is running successfully but failing at stage of creating a report with below error -- ERROR: No test report files were found. Configuration error? Finished: FAILURE*
Could you help in resolving the problem?
pipeline:
currentBuild.displayName="Prod-API-AUtomation-#"+currentBuild.number
pipeline{
agent any
tools {nodejs "NodeJS"}
stages{
stage("Building"){
steps{
sh 'npm install -g newman'
sh 'npm install -g newman-reporter-htmlextra'
}
}
stage("Execute Collection"){
steps{
script{
try{
sh "newman run Test.postman_collection.json -e Test.postman_environment.json -r cli,junit,htmlextra --reporter-junit-export $WORKSPACE/newman/prod_report.xml --reporter-htmlextra-export $WORKSPACE/newman/prod_Report.html"
currentBuild.result="SUCCESS"
}catch(Exception ex){
currentBuild.result="FAILURE"
}
}
}
}
stage("Generating Report"){
steps{
publishHTML([allowMissing: false, alwaysLinkToLastBuild: true, keepAll: false, reportDir: 'newman', reportFiles: '$WORKSPACE/newman', reportName: 'HTML Report', reportTitles: ''])
junit '$WORKSPACE/newman/prod_report.xml'
}
}
}
}