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

Cannot generate feature file with Rule: keyword #55

Open
GuillaumeMorinQc opened this issue Mar 14, 2023 · 2 comments
Open

Cannot generate feature file with Rule: keyword #55

GuillaumeMorinQc opened this issue Mar 14, 2023 · 2 comments

Comments

@GuillaumeMorinQc
Copy link

I cannot generate rst file from a feature file containing Rule: keyword . i'm using version 6.1.3 of sphinx_gherkindoc.
Here an example :

Feature: Gherkin v6 Example -- with Rules
  Feature description line 1.

  Background: Feature.Background
    Given feature background step_1

  Rule: R1 (with Rule.Background)
    Rule R1 description line 1.

    Scenario: R1.Scenario_1
      When rule R1 scenario_1 step_1
      Then rule R1 scenario_1 step_2

The following error happened:

Traceback (most recent call last):
  File "/home/guimor1/repos/opflo/.venv/bin/sphinx-gherkindoc", line 8, in <module>
    sys.exit(main())
  File "/home/guimor1/repos/opflo/.venv/lib/python3.8/site-packages/sphinx_gherkindoc/cli.py", line 309, in main
    process_args(args, gherkin_path, output_path, args.doc_project)
  File "/home/guimor1/repos/opflo/.venv/lib/python3.8/site-packages/sphinx_gherkindoc/cli.py", line 105, in process_args
    feature_rst_file = feature_to_rst(
  File "/home/guimor1/repos/opflo/.venv/lib/python3.8/site-packages/sphinx_gherkindoc/writer.py", line 365, in feature_to_rst
    feature = feature_class(root_path, source_path)
  File "/home/guimor1/repos/opflo/.venv/lib/python3.8/site-packages/sphinx_gherkindoc/parsers/behave.py", line 39, in __init__
    self._data = behave.parser.parse_file(source_path)
  File "/home/guimor1/repos/opflo/.venv/lib/python3.8/site-packages/behave/parser.py", line 18, in parse_file
    return parse_feature(data, language, filename)
  File "/home/guimor1/repos/opflo/.venv/lib/python3.8/site-packages/behave/parser.py", line 26, in parse_feature
    result = Parser(language).parse(data, filename)
  File "/home/guimor1/repos/opflo/.venv/lib/python3.8/site-packages/behave/parser.py", line 148, in parse
    self.action(line)
  File "/home/guimor1/repos/opflo/.venv/lib/python3.8/site-packages/behave/parser.py", line 292, in action
    raise ParserError(msg, None, self.filename)
behave.parser.ParserError: Failed to parse "/home/guimor1/repos/opflo/src/OtdrOpflo/otdr_opflo_app/test/bdd/features/application/version6.feature":
Parser failure in state steps, at line 7: "Rule: R1 (with Rule.Background)"

Is it somethting specific to configure for it to work?
I was assuming that since behave parser covers gherkin version 6 that this simple file should work

@GuillaumeMorinQc
Copy link
Author

Fix the problem using a dev version(1.2.7.dev0) of behave parser.
But now nothing is generated after i hit a rule in the gherkin.

Is some work has been done to convert rules in rst ?

@dgou
Copy link
Contributor

dgou commented Mar 19, 2023

I am not aware of any work to convert to support "Rule" at this time...
A PR to does that would be happily reviewed and shepherded through to merge though!

Given the extra level of nesting, I don't have a feel for how much work this might be, but I'm not against supporting it.

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

No branches or pull requests

2 participants