behave icon indicating copy to clipboard operation
behave copied to clipboard

Can behave integrate livingDoc, like SpecFlow + LivingDoc?

Open gaomengsuijia opened this issue 1 year ago • 1 comments

Can behave integrate livingDoc, like SpecFlow + LivingDoc?

gaomengsuijia avatar Jul 01 '24 03:07 gaomengsuijia

First: Questions should be posted to Discussions and not to issues.

Living Documentation is a term from BDD and „Specification by Examples“. It means that you can generate a readable documentation for what you are trying to achieve, normally the feature files (in Gherkin) and to a lesser extend the step definitions.

This is rather simple because other documentation tools, like sphinx and pygments make it easy to support this (other documentation tools probably provide similar support), like:

My Features
================

.. literalinclude:: features/alice.feature

.. literalinclude:: features/bob.feature

…

Therefore, it is rather simple to generate such a documentation (if needed) by using a text template engine, like Jinja2, and a simple Python script that uses it.

As alternative, you can easily provide a behave formatter that generates this information, too.

Other parts, like the documentation of existing steps, is supported by behave through the sphinx.steps formatter or the various steps* formatters.

SpecFlow + LivingDoc is their technical solution to „Living Documentation“. Therefore, if you really want to have this solution, you should ask them to support behave and not vice versa.

SEE ALSO:

  • sphinx
  • https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-literalinclude

RELATED: Living documentation

  • https://johnfergusonsmart.com/living-documentation-not-just-test-reports/
  • https://cucumber.io/blog/test-automation/living-documentation-vs-test-reports-whats-the-dif/
  • https://serenity-bdd.github.io/docs/reporting/living_documentation
  • https://specflow.org/tools/living-doc/

jenisys avatar Jul 01 '24 05:07 jenisys

NO REACTION: Answer seems to have been sufficient.

jenisys avatar Jul 06 '24 16:07 jenisys