How do I Generate documentation from my tests
  • 30 Nov 2022
  • 1 Minute to read
  • Contributors
  • Comment
  • Dark
    Light
  • PDF

How do I Generate documentation from my tests

  • Comment
  • Dark
    Light
  • PDF

Article Summary

Living Document is used to take advantage of the use of Specflow where you can generate documentation from your tests.

This video will walk through the living document use:

In the test we add the below additions to the test to provide rich additional info about the test.

image.png

I can also modify the code to get message bodies from the Logic App run history and add them to the specflow logging which will make them appear in the test output as examples.

image.png

We can then modify the devops pipeline to use the Living Document task to publish the documentation to the DevOps extension.

 - task: techtalk.techtalk-specflow-plus.specflow-plus.SpecFlowPlus@0
      displayName: 'SpecFlow Living Doc'
      inputs:
        generatorSource: FeatureFolder
        projectFilePath: '$(System.DefaultWorkingDirectory)/$(RepoFolder)/logicapp.testing.acceptancetests'
        testExecutionJson: '**\TestExecution.json'
        workItemUrlTemplate: https://tfscsc.visualstudio.com/IntegrationPlaybook/_workitems/edit/{id}
        workItemPrefix: "DEVOPS_WI:"

In DevOps I can now see the test documentation

image.png

If we toggle the test output view we can now also see the example messages we captured during the test execution.

image.png


Was this article helpful?