cucumber / json-formatter

Provides a language-agnostic command-line tool to convert cucumber messages into a JSON document.
MIT License
21 stars 6 forks source link

Build

Cucumber Standalone JSON Formatter

This standalone JSON Formatter provides a language agnostic tool to convert cucumber messages into a JSON document.

Installation

The Standalone JSON Formatter is a prebuilt executable. (It's written in Go). It can be downloaded from GitHub Releases where you'll find executables for various operating systems and CPU architectures.

MacOS

At the last step, you may get a security warning from MacOS. If you do, open System Preferences. Go to Security Settings. You should see a question asking if you want to open it anyway. Say yes.

Windows

Linux

Usage

First, generate Cucumber messages using Cucumber's built-in message formatter and make sure it's saved to a file (e.g. cucumber-messages.ndjson).

Next, generate JSON:

cat cucumber-messages.ndjson | cucumber-json-formatter > cucumber-results.json

That's it. If you are the maintainer of a tool that consumes the legacy Cucumber JSON format you should consider updating your tool to consume Cucumber Messages instead.