๐Ÿš€ Freelancers & Solo Developers: Klority is 100% Free Forever for 1 User. No credit card required! Create Free Workspace โ†’

CI/CD Test Automation Ingestion

Klority provides a native REST API to ingest execution results directly from your CI/CD pipelines. Connect your Playwright, Cypress, Jest, PyTest, or JUnit suites to Klority in minutes with a single cURL command.

Why Ingest CI/CD Results into Klority?

  • Single Source of Truth: Manual and automated test results live in the same project dashboard.
  • Automated Test Cycles: Every CI pipeline execution creates a clean, timestamped Test Cycle.
  • Stack Trace Capture: Failing assertions and stack traces are preserved for immediate review.
  • AI Root Cause Diagnostics: One-click Amazon Bedrock AI failure analysis and auto-filing of bug tickets.
  • Requirements Traceability: Automated runs update the live Traceability Matrix in real-time.

1. Generate a Project API Token

To authenticate requests from your CI/CD runners, generate a Personal Access Token in Klority:

  1. Open your project in Klority (e.g. https://app.klority.com/projects/WEB/settings).
  2. Navigate to Project Settings → Access Tokens.
  3. Click Generate New Token, provide a descriptive name (e.g. github-actions-ci), and copy the generated token starting with klor_pat_....
  4. Save this token as a secret in your repository (e.g. KLORITY_API_TOKEN in GitHub Secrets).
๐Ÿ””

API Token Security

Treat your project tokens like passwords. Never commit raw API tokens to source control. Always inject them as environment variables or CI/CD secrets.

2. Ingest Endpoint Specification

Klority accepts JUnit XML reports via HTTP POST:

POST https://api.klority.com/api/projects/:projectIdOrKey/test-runs/ingest-junit

# Headers:
Authorization: Bearer klor_pat_...
Content-Type: application/xml (or multipart/form-data)

cURL Example (Raw XML)

curl -X POST "https://api.klority.com/api/projects/FIR/test-runs/ingest-junit" \
  -H "Authorization: Bearer $KLORITY_API_TOKEN" \
  -H "Content-Type: application/xml" \
  --data-binary @results.xml

cURL Example (Multipart File Upload)

curl -X POST "https://api.klority.com/api/projects/FIR/test-runs/ingest-junit" \
  -H "Authorization: Bearer $KLORITY_API_TOKEN" \
  -F "file=@cypress/results/junit.xml"

3. Framework Configuration Guides

Playwright

Configure Playwright to generate standard JUnit XML output in playwright.config.ts:

export default defineConfig({
  reporter: [['junit', { outputFile: 'results.xml' }], ['html']],
});

Or pass it directly in the command line: npx playwright test --reporter=junit:results.xml

Cypress

Install the JUnit reporter: npm install -D mocha-junit-reporter

Add to cypress.config.ts:

export default defineConfig({
  reporter: 'mocha-junit-reporter',
  reporterOptions: {
    mochaFile: 'results.xml',
    toConsole: true
  }
});

Jest / Vitest

Install jest-junit: npm install -D jest-junit

Run your suite with output configuration:

JEST_JUNIT_OUTPUT_NAME=results.xml npx jest --ci --reporters=default --reporters=jest-junit

PyTest (Python)

PyTest includes native JUnit XML reporting out of the box:

pytest --junitxml=results.xml

4. GitHub Actions CI/CD Workflow

Add this ready-to-use step to your .github/workflows/test.yml file:

name: Run Tests & Ingest to Klority
on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
      - run: npm ci
      - run: npx playwright test --reporter=junit:results.xml
        continue-on-error: true # Ensure reporting step runs even on test failures

      - name: Ingest Results to Klority QA
        if: always()
        run: |
          curl -X POST "https://api.klority.com/api/projects/YOUR_PROJECT_KEY/test-runs/ingest-junit" \
            -H "Authorization: Bearer ${{ secrets.KLORITY_API_TOKEN }}" \
            -H "Content-Type: application/xml" \
            --data-binary @results.xml

5. Inspecting Ingested Results in Klority

Once ingested:

  • Navigate to Projects → Test Hub → Test Cycles.
  • You will see a newly created cycle named Automated Run (<timestamp>).
  • Click Report to view the visual pass/fail breakdown, duration, and error logs.
  • Click any failed test case and hit "AI Auto-Diagnose Bug" to let Amazon Bedrock draft complete reproduction steps and log the defect directly into your sprint backlog or Linear!