TestKase Docs
AutomationCI/CD Platforms

Jenkins

Set up TestKase test reporting in your Jenkins pipelines.

Jenkins

JenkinsJenkins

Setup Steps

  1. Go to Manage JenkinsManage Credentials. Add "Secret text" credentials for testkase-pat.
  2. Add the reporting stage to your Jenkinsfile.
  3. Update the CLI flags to match your project.
  4. Run your pipeline.

Pipeline Template

pipeline {
    agent any
    environment {
        TESTKASE_PAT = credentials('testkase-pat')
    }
    stages {
        stage('Install') {
            steps { sh 'npm ci' }
        }
        stage('Test') {
            steps { sh 'npm test -- --reporter=junit --outputFile=test-results/junit.xml' }
        }
    }
    post {
        always {
            sh """
                npx @testkase/reporter report \\
                    --token $TESTKASE_PAT \\
                    --project-id PRJ-1 \\
                    --org-id 1173 \\
                    --cycle-id TCYCLE-5 \\
                    --format junit \\
                    --results-file test-results/junit.xml \\
                    --build-id "${env.BUILD_NUMBER}"
            """
        }
    }
}

--cycle-id is optional. If not provided, results are reported to TCYCLE-1 — the master test cycle for the project.