Hello Katalon experts!
I am looking for a bit of advice. I am running Katalon through a Jenkins server, and want to grab the Suite ID, Suite Name, # of total test cases, and the # of passed/failed/error test cases from the suite after it completes, so I can have it posted in the Slack message after completion. Here is my Jenkins pipeline:
def getBuildUser() {
return currentBuild.rawBuild.getCause(Cause.UserIdCause).getUserId()
}pipeline {
environment { BUILD_USER = '' REPORT_DIR = '/var/lib/jenkins/workspace/Pipeline/Test_Suite/Reports' SLACK_CHANNEL = 'test-slack-plugin' } agent { docker { image 'katalonstudio/katalon:7.4.0' args "-u root" } } stages { stage('Checkout') { steps { git credentialsId: 'jenkins_git', url: '**************' } } stage('Test') { steps { sh 'katalonc.sh -browserType="Chrome (headless)" -window-size=1280,1024 -retry=0 -statusDelay=15 -testSuitePath="Test Suites/Pipeline Test" -projectPath=$PWD/Katalon.prj -executionProfile="default" -apiKey=**********************' } } } post { always { archiveArtifacts artifacts: 'Reports/**/*.*', fingerprint: true script { BUILD_USER = getBuildUser() } slackSend channel: "${SLACK_CHANNEL}", color: COLOR_MAP[currentBuild.currentResult], message: "*${currentBuild.currentResult}:* Job ${env.JOB_NAME} build ${env.BUILD_NUMBER} by ${BUILD_USER}\n More info at: ${env.BUILD_URL}" slackUploadFile channel: "${SLACK_CHANNEL}", filePath: "${REPORT_DIR}/**/*.pdf", initialComment: "*${env.JOB_NAME}*" } }
}