What does HackerNews think of hitchstory?
Type-safe YAML integration tests. Tests that write your docs. Tests that rewrite themselves.
Nonetheless, there is a small number of projects where they either work around these constraints or it doesn't matter as much, so it can work. I find that most people that apply gherkin to their projects run into a brick wall though - usually for one of the above reasons.
I built https://github.com/hitchdev/hitchstory as an alternative that has straightforward syntax (YAML), very strict type safety (StrictYAML), low verbosity and the ability to abstract scenarios.
It is explicitly designed as a source for generating markdown documentation so that you can create richer docs like https://github.com/hitchdev/hitchstory/blob/master/examples/... for your users rather than more test-like documents like https://github.com/diaspora/diaspora/blob/develop/features/m...
https://github.com/hitchdev/hitchstory (there are a few toy examples listed there)
Depending on the app the docs might also embed artefacts generated under test - e.g. screenshots from playwright.
If your specification is self rewriting, can be tested and can be used to generate docs then maintenance costs plummet.
https://github.com/hitchdev/hitchstory
There's a REST API example.
If your specification can be used as a test and to generate docs and the spec can be rewritten based upon program output then the maintenance cost plunges.
It would integrate with this quite easily - the script to generate the docs and the jinja2 would need tweaking - thats all.
I built this tool to let people generate evergreen markdown documentation from annotated type-safe YAML integration tests:
If you write tests in a strongly typed, non-turing complete markup (in this case, StrictYAML), you can then use it with a template and test artefacts (e.g. app screenshots) to generate readable how-to/tutorial docs which are guaranteed to stay up to date.
https://github.com/hitchdev/hitchstory
This isn't a new idea, but I find that people are often skeptical because there's a history of people getting their fingers burned by Gherkin's language design or YAML's weak typing (both of which are completely valid).
* Excessive verbosity
* Not type safe
* It lacks story abstractions (i.e. you can't flexibly create variations on a scenario, extend existing scenarios, etc.).
* You need to fiddle with regexes.
A side effect of these semantic/syntactic problems is that gherkin stories end up being too vague to be useful - i.e. the meat of the story is often missing.
I created a StrictYAML based alternative with python that I think has all of the benefits, fixes those 4 problems and doesnt suffer from traditional "YAML" problems: https://github.com/hitchdev/hitchstory
I call this "BDD with meat".
Like you I also dont want to go back. Declarative tests are the future.
With it you can write integration tests with typesafe YAML which double as user friendly documentation.
It also has inheritance (which gherkin doesnt) - e.g. a "buy golf clubs" story can inherit from "put golf clubs in shopping basket" story which can inherit from a "log in" story, etc.
https://github.com/hitchdev/hitchstory
Project with README that is partially generated from the code samples in the tests:
https://github.com/crdoconnor/strictyaml
with the README template:
https://github.com/crdoconnor/strictyaml/blob/master/docs/in...
that grabs code snippets and their expected outputs from the story:
https://github.com/crdoconnor/strictyaml/blob/master/hitch/s...
The whole idea being that you don't want the story to be turing complete (there are no loops or conditionals with a story), but the code that executes it needs to be turing complete.
It's designed so that you can write tests that are the basis of the "how to" documentation - with a small script and some jinja2 you can generate readable documentation in the form of markdown from the test:
Original test (behavioral example) : https://github.com/crdoconnor/strictyaml/blob/master/hitch/s...
Example docs generated from that test : https://hitchdev.com/strictyaml/using/alpha/scalar/email-and...
It's also designed so that the testing framework can be programmed to rewrite the test automatically for simple code changes (e.g. changing the wording of that exception).
This makes building tests much quicker and much, much less tedious and perfectly in sync docs almost becomes a side effect.
Essentially "how to" documentation and example driven behavioral tests are the same thing for all projects. It's just that most people don't realize and don't treat them as such.