Skip to main content
In this tutorial, we will create a for . By the end, you will have a reusable ctrf attestation type in Kosli that validates test reports and enforces a zero-failures compliance rule.

Prerequisites

Download the CTRF schema

Download the official for CTRF to a file named ctrf-schema.json:
curl -o ctrf-schema.json https://ctrf.io/schemas/schema.json

Create the attestation type

Use kosli create attestation-type to define the new type with a that requires zero failed tests:
kosli create attestation-type ctrf \
  --description "Attestation for Common Test Report Format (CTRF)" \
  --schema ctrf-schema.json \
  --jq '.results.summary.failed == 0'
You should see: attestation-type ctrf was created. You can verify it exists by running:
kosli get attestation-type ctrf

Report a CTRF attestation

Once your tests have run and produced a CTRF report (e.g. ctrf-report.json), report it to Kosli:
kosli attest custom \
  --type ctrf \
  --name playwright-tests \
  --flow <your-flow-name> \
  --trail <your-trail-name> \
  --attestation-data ctrf-report.json
Kosli will validate ctrf-report.json against the schema and evaluate the jq rule. If .results.summary.failed is 0, the attestation will be marked as compliant.

What you’ve accomplished

You have created a reusable ctrf custom attestation type and used it to report a test result to Kosli. Any team in your organisation can now use this same type to uniformly enforce a zero-failures quality gate across all projects, regardless of which testing framework they use. From here you can:
Last modified on March 10, 2026