'How to convert cucumber gherkin feature files into JSON or AST format?
I am working in a project where i need to understand gherkin parsing better than ever. Also need to implement certain higher order functionalities based on content.
I wanted to know how to convert cucumber gherkin feature files into JSON or to get it into AST Tree. I tried using Gherkin package from npm repo but i am not able to get the stream out into json with all the content. Can someone help me with an example or sample code to extract a feature step to AST or JSON format. Please help..
Thanks in advance.
Solution 1:[1]
According to the Gherkin documentation, you can use the Gherkin CLI to produce an AST as a JSON object. There are plenty of examples of the output and command-line parameters on their GitHub repository. Since you are parsing Gherkin, which is programming language-agnostic, you can use whichever implementation of Gherkin you prefer.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Steven Hunt |
