/Format-Pester

Powershell module for documenting Pester's results

Primary LanguagePowerShellMIT LicenseMIT

Build status

Format-Pester

Powershell module for documenting Pester's results.

All the formating work is done by the module PScribo.

Reports are generated base on a custom PowerShell object returned by Invoke-Pester run with the parameter PassThru. NUnit style files generated by Pester are not supported at that moment by Format-Pester.

If you can't generate report on a computer where tests are executed please save tests results piping them to Export-Clixml.

You can be interested also in the ReportUnit tool what is a report generator for the test-runner family. It uses stock reports from NUnit, MsTest, xUnit, TestNG and Gallio and converts them HTML reports with dashboards.

Report example

Screenshot from HTML report generated by Format-Pester v. 1.3.0, PScribo v. 0.7.11

More examples you can find here.

Supported languages

Since version 1.3.0 internationalization of generated reports is supported. Internalization means that report parts e.g. section names, columns headers, etc. can be wrote in a language different than English.

Currently available languages

  • en-US - English United Staes - main language
  • pl-PL - Polish

If would you like add support for your language please read the section Information for translators in the project wiki.

Requirements

  • Powershell v.4.x
  • Pester
  • PScribo - preferred the version >= 0.7.12.47 due to bug

Usage

Format-Pester is the PowerShell module so before usage it you need import it - more instruction you can find in wiki.

Example 1

  Invoke-Pester -PassThru | Format-Pester -Path . -Format HTML,Word,Text

This command will document the results of the Pester's tests. Documents will be store in the current path and they will be available in 3 formats (.html,.docx and .txt).

Example 2

    Invoke-Pester -PassThru | Export-Clixml -Path .\Test-Result.xml
    
    Import-Clixml -Path .\Test-Result.xml | Format-Pester -Format .\ -BaseFileName Test-Result -Format HTML -FailedOnly

The first command you can run e.g. on a server where PScribo and Format-Pester is not installed. The tests results will be stored in a file as xml representation of object.

After copy the file to the computer where PScribo and Format-Pester are available you can generate report. The html file will be generated with results of failed tests only.

Online help

You can read online version of help - online help generated by platyPS module.

Initial author

Contributors

License

Copyright 2016 Erwan Quelin and the community.
Licensed under the MIT License