Skip to content

Latest commit

 

History

History
58 lines (46 loc) · 2.61 KB

IntegratingTestResultsFromSpecRun.md

File metadata and controls

58 lines (46 loc) · 2.61 KB

#Integrating Test Results From SpecRun

It is now possible to integrate test results from SpecRun, a test runner specifically designed for running test cases from SpecFlow. This involves some manual setup work, though: SpecRun outputs an HTML file that is not really suitable for automatic processing. Fortunately the template that produces the HTML file can be changed.

  • Download the "official" SpecRun template: http://go.specflow.org/specrunreporttemplate

  • Copy the ReportTemplate.cshtml file to the directory of the Visual Studio project that contains your SpecFlow/SpecRun scenarios (next to your .srprofile file).

  • Include ReportTemplate.cshtml in your Visual Studio Project and set its "Copy to Output Directory" to "Copy if newer".

  • Adapt your .srprofile file by adding the reportTemplate attribute to the Settings element:

  • Open ReportTemplate.cshtml and add this helper before the html element:

    @helper GetResultForPickles(TestNode testNode) { var summary = GetSummary(testNode); if (summary.Succeeded > 0) {Passed} else if (summary.TotalFailure > 0) {Failed} else if (summary.Ignored > 0) {Ignored} else if (summary.Pending > 0) {Pending} else {Inconclusive} }

  • Still in ReportTemplate.cshtml, add this fragment before the closing /body element:

Congratulations! You have now modified the default SpecRun report template so that it includes additional information that will tell Pickles the results of the scenarios.