01
Jul

Jenkins file for SoapUI Projects

node(‘w5’){
deleteDir();
checkout scm;

def jenkinsWorkspace = pwd();
def actualCmd =””;

def APP_NAME = APP_NAME
def EMAIL = EMAIL

stage(“SOA QA Validation”){

def Executable_filename = “SOAP_UI_ETOXML_AUTO.xml”
command = ‘cmd /c “C:/Program Files/SmartBear/ReadyAPI-2.2.0/bin/testrunner.bat” -j -S ‘+”${jenkinsWorkspace}”+”/”+Executable_filename

actualCmd = command + ‘\necho “Exit Code of TestRunner program call is “${LastExitCode}’
echo “Command to run for ReadyAPI TestRunner Call ===> ” + actualCmd
def status = powershell returnStatus: true, script: actualCmd
}

stage(“EMAIL NOTIFICATION”){
if( actualCmd.toString().contains(“0”) ) {
emailext body: ‘SOA Automation Test for the application ${APP_NAME} is completed. nPFA MasterExcelReport for SOA test execution’,subject: ‘SOA Automated test report for ${APP_NAME}’,to: EMAIL, attachmentsPattern: ‘TestResult/MasterReport.xlsx’
}
else if( actualCmd.toString().contains(“-1”) ) {
echo “Error triggering ReadyAPI in Remote machine w5”
}
else {
echo “Internal error happened. Please check build logs for more detail.”
}
}
}