Module: Kensho
- Defined in:
- lib/kensho/cucumber/formatter.rb,
lib/kensho/_schema.rb,
lib/kensho/cucumber.rb,
lib/kensho/cucumber/version.rb
Overview
Cucumber 7+ formatter that emits Kensho v1 results.
Cucumber-Ruby’s formatter API gives us a ‘Cucumber::Configuration` and a `config.on_event(:event_name)` event bus. We subscribe to:
:test_run_started — open the output dir
:test_case_started — start accumulating per-scenario data
:test_step_finished — append a step result
:test_case_finished — write cases/<id>.json
:test_run_finished — write run.json
Each scenario becomes a Kensho case; each Gherkin step becomes a Kensho step. Data tables on a step are emitted as ‘step.parameters[]`. The scenario’s ‘attach` calls (Cucumber’s built-in attachment API) are routed into ‘case.attachments[]`.
Tags drive metadata:
@severity:critical → case.severity
@critical / @blocker / ... → case.severity (shorthand)
@kensho.label.team=growth → case.labels.team = 'growth'
@kensho.link.jira=PROJ-123 → case.links += { kind: 'jira', label: 'PROJ-123', url: 'PROJ-123' }
@kensho.url.jira=https://… → case.links (full url form)
any other @tag → case.tags