If you are using JUnit in your testing framework along with the surefire plugin for generating reports, then there is a beautiful way to show these reports in Jenkin console from your pipeline job.
You just need to put one line in your script:
junit '**/target/surefire-reports/*.xml'
stage('Build') {
try {
bat '''mvn clean test -DargLine='-Dkarate.env=QA-US' -Dkarate.options="--tags @SmokeAPI" -Dtest=CucumberReport -DfailIfNoTests=false'''
} finally {
junit '**/target/surefire-reports/*.xml'
}
}
Once you will add this code, your test result will come in this way in Jenkins build console:
No comments:
Post a Comment