CI/CD Integration
Integrate RocketQA seamlessly into your continuous integration and deployment pipeline to ensure your web applications are thoroughly tested before deployment. This guide provides practical examples for popular CI/CD platforms.
GitHub Actions Example
Section titled “GitHub Actions Example”name: E2E Tests
on: push: branches: [ main, develop ] pull_request: branches: [ main ]
jobs: e2e-tests: runs-on: ubuntu-latest
steps: - uses: actions/checkout@v4
- name: Setup Node.js uses: actions/setup-node@v4 with: node-version: '20'
- name: Install dependencies run: npm ci
- name: Install Playwright browsers run: npx rocketqa install
- name: Run E2E tests run: npx rocketqa test env: WEBSITE_URL: ${{ secrets.STAGING_URL }}
- name: Upload test reports uses: actions/upload-artifact@v4 if: always() with: name: test-reports path: reports/
Jenkins Pipeline
Section titled “Jenkins Pipeline”pipeline { agent any
environment { WEBSITE_URL = credentials('staging-url') }
stages { stage('Setup') { steps { sh 'npm ci' sh 'npx rocketqa install' } }
stage('E2E Tests') { steps { sh 'npx rocketqa test --tags @smoke' } } }
post { always { publishHTML([ allowMissing: false, alwaysLinkToLastBuild: true, keepAll: true, reportDir: 'reports', reportFiles: 'report.html', reportName: 'E2E Test Report' ]) } }}