Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: Add support for Markdown gherkin syntax #165

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

temyers
Copy link

@temyers temyers commented Oct 19, 2022

Feature: Add support for gherkin syntax.

Why?

Gherkin supports Markdown syntax for rich text documents. The ability to include images is compelling to improve readability of scenarios and generating living documentation overall.

What

I have raised this PR as a draft to start discussion - it is still WIP.

Where to start:

  • I have added a new markdown feature file. This is not comprehensive, but based on the documentation and (superficial) review of the Gherkin parser test I don't think it needs to be - the resulting AST should be the same irrespective of the Gherkin flavour.
    • If there were any inconsistencies here, I would consider this to be an upstream dependency issue to be resolved in the gherkin project.
  • I have added a new markdown feature file to demonstrate multi-language support.
  • Supporting Markdown through the GherkinInMarkdownTokenMatcher required upgrading the gherkin dependency. Issues have been resolved.
  • It's encouraging to see that the code generation snippet suggestions "just worked". Example Jest output:
 FAIL  specs/step-definitions/markdown-support.steps.ts
  ● Test suite failed to run

    Feature file has a scenario titled "Simple addition", but no match found in step definitions. Try adding the following code:

    test('Simple addition', ({ when, then }) => {
        when(/^I add (\d+) + (\d+)$/, (arg0, arg1) => {

        });

        then(/^the result should be (\d+)$/, (arg0) => {

        });
    });
  • I have also added VSCode development container configuration, since that matches my workflow
    • I can remove them from the PR if required
    • They have had no customisation

I haven't added documentation at this point - would like an initial review and some thoughts on what you'd like documentation wise before I spend the effort

TODO

  • Make unit tests pass
  • Clean up the code
  • Documentation

@temyers temyers marked this pull request as ready for review October 20, 2022 10:05
@temyers
Copy link
Author

temyers commented Oct 31, 2022

@bencompton.

Do you have any timeframe on when you will be able to review this?

I think Markdown is a much richer format for living documentation and think this will be a great addition.
The code is tested and (hopefully) fairly clean

@bencompton
Copy link
Owner

bencompton commented Mar 24, 2024

Sorry this PR collected dust so long, and I'm making an effort to better maintain this repo now. I really love the idea of markdown, and it's something I'd even like to start using myself. Definitely want to get this merged once the following is addressed:

  • Need to merge in latest from master
  • There are some code style issues, which should be easy to address with the recent contributions from @pplancq
  • The dev container changes are unnecessary, IMO. I mostly do k8s stuff myself these days and have no problem with containers in general for deploys, but I generally don't find value in building and maintaining local development containers
  • Needs docs
  • The specs provided should be moved to examples, and this also needs acceptance tests that cover the functionality like the other specs in this repo.
  • The dialect changes would ideally be in another PR, though maybe I'm misunderstanding and it really needs to be in the same PR.

I'm happy to make these changes myself since this PR was ignored so long, but it may be a while before I'm able to circle back around to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants