CI/CD Integration for QA: Building a Testing Pipeline From Zero to Production
If you cannot plug your tests into a GitHub Actions or Jenkins pipeline, you are not an SDET — you are a script writer. Here is how to build a real testing pipeline from scratch.
Contents
What Good CI/CD Looks Like for QA
- Consistency: Every test runs in the same environment, every time
- Quality gates: PRs cannot merge without tests passing
- Fast feedback: Results within 10 minutes for PR checks
- Repeatability: Anyone can reproduce a CI failure locally
GitHub Actions: Complete Playwright Pipeline
name: Playwright Tests
on:
pull_request:
branches: [main, develop]
push:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
shard: [1/4, 2/4, 3/4, 4/4]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- run: npm ci
- run: npx playwright install --with-deps chromium
- name: Run tests (shard ${{ matrix.shard }})
run: npx playwright test --shard=${{ matrix.shard }}
- uses: actions/upload-artifact@v4
if: always()
with:
name: results-${{ strategy.job-index }}
path: |
test-results/
playwright-report/
report:
needs: test
if: always()
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
- name: Merge and publish report
run: npx playwright merge-reports --reporter=html ./results-*
- uses: actions/upload-artifact@v4
with:
name: playwright-report
path: playwright-report/
Jenkins Pipeline for Selenium/RestAssured
pipeline {
agent { docker { image 'maven:3.9-eclipse-temurin-21' } }
stages {
stage('Build') {
steps { sh 'mvn clean compile' }
}
stage('Unit Tests') {
steps { sh 'mvn test -Dtest=*UnitTest' }
}
stage('API Tests') {
steps { sh 'mvn test -Dtest=*ApiTest' }
}
stage('UI Tests') {
steps { sh 'mvn test -Dtest=*UiTest -Dbrowser=chrome' }
}
}
post {
always {
junit 'target/surefire-reports/*.xml'
publishHTML(target: [
reportDir: 'target/site/allure',
reportFiles: 'index.html',
reportName: 'Allure Report'
])
}
}
}
Red Flags in Your Pipeline
- Manual approvals at every stage — automate quality gates instead
- Build times over 30 minutes — parallelize and shard
- Frequent pipeline failures unrelated to code changes — fix environment issues
- No test reporting — add Allure, HTML reports, or JUnit XML
- Tests only run on main branch — run on every PR
