TestKase Docs
AutomationCI/CD Platforms

GitLab CI

Set up TestKase test reporting in your GitLab CI pipelines.

GitLab CI

GitLab CIGitLab CI

Setup Steps

  1. Go to your GitLab project → SettingsCI/CDVariables. Add TESTKASE_PAT (masked).
  2. Add the reporting stage to your .gitlab-ci.yml.
  3. Update the CLI flags to match your project.
  4. Push to trigger your pipeline.

Pipeline Template

stages:
  - test
  - report

test:
  stage: test
  image: node:20
  script:
    - npm ci
    - npm test -- --reporter=junit --outputFile=test-results/junit.xml
  artifacts:
    paths:
      - test-results/
    when: always
  allow_failure: true

report-to-testkase:
  stage: report
  image: node:20
  when: always
  dependencies:
    - test
  script:
    - 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 "$CI_PIPELINE_IID"

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