On this page4 sections
CommandsIntermediate5-7 min reference

Jenkins for QA

Jenkins is still the CI server many test suites run on, driven by a Jenkinsfile. This sheet is the QA-relevant pipeline syntax — stages, parallelism, artifacts, and test reporting — not a full Jenkins admin guide. For CI/CD concepts and the GitHub Actions equivalent see the CI/CD for Testers sheet; for a ready Jenkinsfile see the Configs library (both linked below).

Declarative pipeline skeleton

pipeline {
  agent any
  stages {
    stage('Install') { steps { sh 'npm ci' } }
    stage('Test')    { steps { sh 'npm test' } }
  }
  post {
    always  { junit 'reports/**/*.xml' }       // publish results
    failure { archiveArtifacts 'screenshots/**' }
  }
}

The blocks QA cares about

BlockPurpose
agentWhere it runs (label, docker { image })
stages / stagePipeline steps (Build, Test, Deploy)
stepsShell commands (sh, bat)
postRun after — always, success, failure, unstable
environmentEnv vars / credentials
parametersManual run inputs (browser, env)
parallelRun suites concurrently
optionstimeout, retry, timestamps

Reporting & artifacts

  • junit '**/test-results/*.xml' — trend graphs + per-test results.
  • archiveArtifacts — keep screenshots, videos, traces, HTML reports.
  • publishHTML (HTML Publisher plugin) — Playwright/Allure reports.
  • Mark a build unstable (not failed) on test failures vs infra failures.

Common mistakes

  • Publishing results only on success — use post { always { junit … } } so failures still report.
  • Not archiving screenshots/traces, leaving failures undebuggable.
  • One giant stage instead of Install/Test/Report stages (no visibility).
  • Hard-coded secrets instead of Jenkins credentials.
  • Confusing failed (infra) with unstable (tests failed) status.

// Related resources