Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save adiralashiva8/4be4ee4af3e86e90316129d1211441ff to your computer and use it in GitHub Desktop.
Save adiralashiva8/4be4ee4af3e86e90316129d1211441ff to your computer and use it in GitHub Desktop.
Jenkins pipeline script run robot test cases, re-run test cases, merge report and pass the test report
pipeline {
agent {
label 'qatest'
}
environment {
QA_SERVER = 'https://qa.application.com/'
CT_SERVER = 'http://ct.application.com/'
}
stages {
stage('intialize') {
steps {
sh 'echo "PATH= ${PATH}'
}
}
stage('Run Robot Tests') {
steps {
sh 'python3 -m rflint --ignore LineTooLong myapp'
sh 'python3 -m robot.run --NoStatusRC --variable SERVER:${CT_SERVER} --outputdir reports1 myapp/uiTest/testCases/smokeSuite/'
sh 'python3 -m robot.run --NoStatusRC --variable SERVER:${CT_SERVER} --rerunfailed reports1/output.xml --outputdir reports myapp/uiTest/testCases/smokeSuite/'
sh 'python3 -m robot.rebot --merge --output reports/output.xml -l reports/log.html -r reports/report.html reports1/output.xml reports/output.xml'
sh 'exit 0'
}
post {
always {
script {
step(
[
$class : 'RobotPublisher',
outputPath : 'reports',
outputFileName : '**/output.xml',
reportFileName : '**/report.html',
logFileName : '**/log.html',
disableArchiveOutput: false,
passThreshold : 50,
unstableThreshold : 40,
otherFiles : "**/*.png,**/*.jpg",
]
)
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment