Skip to content

Jenkins โ€‹

Run your Shiplight E2E tests in a Jenkins pipeline and upload the results to Shiplight Cloud. Jenkins uses the same shiplight CLI as every other provider โ€” only the pipeline syntax differs.

Before you start โ€‹

  • A scaffolded Shiplight test project (/shiplight init). See the CI/CD overview for how the pieces fit together.
  • An org API token from app.shiplight.ai/api-tokens, stored as a Secret text credential (Manage Jenkins โ†’ Credentials). The template references it by ID shiplight-api-token.
  • A Pipeline job pointing at your repository โ€” Jenkins does not auto-discover a Jenkinsfile, so create the job once and set its SCM to your repo.

Pipeline โ€‹

Create a Jenkinsfile at your repository root:

groovy
pipeline {
  agent { docker { image 'node:20' } }
  environment {
    SHIPLIGHT_REPORT_TO_CLOUD = '1'
    SHIPLIGHT_API_TOKEN = credentials('shiplight-api-token') // Jenkins credential ID
  }
  stages {
    stage('Install') {
      steps {
        sh 'npm install'
        sh 'npx playwright install --with-deps chromium'
      }
    }
    stage('E2E tests') {
      steps {
        sh 'npx shiplight test'
      }
      post {
        always {
          sh 'npx shiplight report' // upload even when tests fail
        }
      }
    }
  }
}

Notes โ€‹

  • SHIPLIGHT_API_TOKEN and SHIPLIGHT_REPORT_TO_CLOUD=1 are required on every non-Shiplight runner โ€” they are provided automatically only on Shiplight-hosted GitHub runners.
  • Install Chromium yourself (npx playwright install --with-deps chromium); no stock image ships it.
  • The post { always { โ€ฆ } } block is what makes the upload survive a red run.
  • Not available on Jenkins: Shiplight-hosted runners, the self-healing action cache, automatic LLM credentials, and auto-triage โ€” those are GitHub Actions only.
  • Project in a subdirectory (e.g. tests/e2e)? Wrap the steps in dir('tests/e2e') { โ€ฆ }.

Released under the MIT License.