Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pretty output of Gherkin feature files

Tags:

We're building up a specification in Gherkin, and we'd like to present the feature files to the business stakeholders. How can we export all our feature files in some sort of 'pretty' format?

For example:

  • Generate a document containing all features
  • OR integrate features into other documentation
  • OR publish the feature files on a web portal (nicely formatted)
like image 789
dgmstuart Avatar asked Nov 08 '11 10:11

dgmstuart


People also ask

How do you use the pretty Gherkin?

Pretty Gherkin is a Chrome extension for viewing Gherkin feature files through the browser with syntax highlighting. After installing it, make sure to enable the “Allow access to the file URLs” option on the Chrome Extensions page (chrome://extensions/).

What are Gherkin feature files?

Features file contain high level description of the Test Scenario in simple language. It is known as Gherkin. Gherkin is a plain English text language. Cucumber Feature File consist of following components – Feature: A feature would describe the current test script which has to be executed.

How many parts does a common Gherkin feature file have?

Each scenario/test can be basically broken down into three parts: Precondition to the test, which represent with (Given) keyword. Test step execution, which represent with (When) keyword. Verification of the output with expected result, which represent with (Then)

How do I arrange a feature file?

There's nothing worse than trying to find a specific piece of information in poorly organized documentation, so feature files should be organised in a logical way. A typical way to structure documentation is to use chapters, sections, sub-sections and so on. Each scenario documents an example of the system's behaviour.


2 Answers

The best I've seen so far is Pickles; http://github.com/picklesdoc/pickles

It's work in process but looks good already. Please supply your feedback on GitHub

like image 166
Marcus Hammarberg Avatar answered Sep 30 '22 19:09

Marcus Hammarberg


Our team is currently using relish, a code project to nicely format your gherkins onto a website.

It does however have some drawbacks - it is only "free while in beta", but this might still give you some ideas.

A nice feature of relish is that your dev team can choose to push the gherkins whenever they are ready, and the stakeholders don't need to manage/receive new emails / documents etc - they can just refresh the project webpage.

like image 42
perfectionist Avatar answered Sep 30 '22 19:09

perfectionist