Skip to content

Commit

Permalink
Merge pull request #33 from it-praktyk/v1.5.1
Browse files Browse the repository at this point in the history
Full support for Skipped, Pending, Inconclusive tests added
  • Loading branch information
equelin authored Jun 20, 2017
2 parents cbf452d + cb63a90 commit 5498c16
Show file tree
Hide file tree
Showing 35 changed files with 2,617 additions and 305 deletions.
8 changes: 4 additions & 4 deletions Format-Pester/Format-Pester.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ RootModule = 'Format-Pester.psm1'
# Version number of this module.
# If you are increasing ModuleVersion please change also the values of variable 'ScriptVersion' in the Format-Pester.ps1 file
# Verify also translations and increase the values of msg00 fields
ModuleVersion = '1.4.2'
ModuleVersion = '1.5.1'

# ID used to uniquely identify this module
GUID = 'daa609a5-1293-4f62-9467-1a120c529e87'
Expand Down Expand Up @@ -71,13 +71,13 @@ RequiredModules = @('pester','pscribo')
FunctionsToExport = 'Format-Pester'

# Cmdlets to export from this module
CmdletsToExport = '*'
CmdletsToExport = ''

# Variables to export from this module
VariablesToExport = '*'
VariablesToExport = ''

# Aliases to export from this module
AliasesToExport = '*'
AliasesToExport = ''

# DSC resources to export from this module
# DscResourcesToExport = @()
Expand Down
525 changes: 381 additions & 144 deletions Format-Pester/Public/Format-Pester.ps1

Large diffs are not rendered by default.

119 changes: 81 additions & 38 deletions Format-Pester/Public/en-US/Format-Pester.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,88 @@
#Read also Get-Help about_Script_Internationalization

#The language en-US file prepared by Wojciech Sciesinski, wojciech[at]sciesinski[dot]net
#String aligned to version - see msg00 value
#String aligned to version - see the value of msgA000

#Translate values, don't touch 'msgxx' fields !
#Translate values, don't touch 'msgxxxx' fields !

# culture="en-US"
# Groups of translation strings
# A = general
# X - temporary deprecation messages
# B = passed tests
# C = failed tests
# D = skipped tests
# E = pending tests
# F = inconclusive tests

# culture = "en-US"
ConvertFrom-StringData @'
msg00 = 1.4.2
msg01 = Table of Contents
msg02 = Total Tests
msg03 = Passed Tests
msg04 = Failed Tests
msg05 = Skipped Tests
msg06 = Pending Tests
msg07 = Results summary
msg08 = Evaluating tests results for
msg09 = Passed
msg10 = Details for passed tests
msg11 = Details for passed tests by Describe block:
msg12 = Details for passed tests by Context block:
msg13 = Found passed tests in Describe blocks
msg14 = Found passed tests in Context block
msg15 = Describe
msg16 = Context
msg17 = Name
msg18 = Failed
msg19 = Details for failed tests
msg20 = Details for failed tests by Describe block:
msg21 = Details for failed tests by Context block:
msg22 = Found failed tests in Describe blocks
msg23 = Found failed in Context blocks
msg24 = Failure Message
msg25 = Passed tests
msg26 = Failed tests
msg27 = The language
msg28 = is not supported. Language en-US will be used.
msg29 = Version of used language file is diffrent than than version of Format-Pester.ps1 file. Some texts can not be displayed correctly.
msg30 = Performing action for
msg31 = amount of results
#Type of encoding used for write text files
#Supported vales: ASCII,Unicode,UTF7,UTF8
msg32 = ASCII
msgA000 = 1.5.1
msgA001 = Table of Contents
msgA002 = Total Tests
msgA003 = Passed Tests
msgA004 = Failed Tests
msgA005 = Skipped Tests
msgA006 = Pending Tests
msgA007 = Inconclusive Tests
msgA008 = Results summary
msgA009 = Evaluating tests results for
msgA010 = Describe
msgA011 = Context
msgA012 = Name
msgA013 = The language
msgA014 = is not supported. Language en-US will be used.
msgA015 = Version of used language file is different than than version of Format-Pester.ps1 file. Some texts can not be displayed correctly.
msgA016 = Performing action for
msgA017 = amount of results
#Type of encoding used for write text files
#Suppurted vales: ASCII,Unicode,UTF7,UTF8
msgA018 = ASCII
msgA019 = Value of the parameter PesterResult can't be null or empty.
msgA020 = The test result named: '{0}' is duplicated in the ResultOrder parameter values. It will be skipped to avoid duplicating of a report section.
msgA021 = The test result named: '{0}' in unrecognized and will not be included in a report.
msgA022 = Documents will be exported with options:
msgX001 = The parameter '{0}' is deprecated and will be removed in the further version of Format-Pester. Please use the parameters Include instead.
msgX002 = The parameter Order is deprecated and will be removed in the further version of Format-Pester. Please use the parameter ResultOrder instead."
msgX003 = The parameter PassedFirst parameter was used but passed results are not included in the report.
msgX004 = The parameter FailedFirst parameter was used but failed results are not included in the report.
msgB000 = Passed
msgB001 = Details for passed tests
msgB002 = Details for passed tests by Describe block:
msgB003 = Details for passed tests by Context block:
msgB004 = Found passed tests in Describe blocks
msgB005 = Found passed tests in Context block
msgB006 = NOT_EXISTS
msgB007 = Passed tests
msgC000 = Failed
msgC001 = Details for failed tests
msgC002 = Details for failed tests by Describe block:
msgC003 = Details for failed tests by Context block:
msgC004 = Found failed tests in Describe blocks
msgC005 = Found failed tests in Context blocks
msgC006 = Failure Message
msgC007 = Failed tests
msgD000 = Skipped
msgD001 = Details for skipped tests
msgD002 = Details for skipped tests by Describe block:
msgD003 = Details for skipped tests by Context block:
msgD004 = Found skipped tests in Describe blocks
msgD005 = Found skipped tests in Context blocks
msgD006 = Skip Message
msgD007 = Skipped Tests
msgE000 = Pending
msgE001 = Details for pending tests
msgE002 = Details for pending tests by Describe block:
msgE003 = Details for pending tests by Context block:
msgE004 = Found pending tests in Describe blocks
msgE005 = Found pending tests in Context blocks
msgE006 = Pending Message
msgE007 = Pending Tests
msgF000 = Inconclusive
msgF001 = Details for inconclusive tests
msgF002 = Details for inconclusive tests by Describe block:
msgF003 = Details for inconclusive tests by Context block:
msgF004 = Found inconclusive tests in Describe blocks
msgF005 = Found inconclusive tests in Context blocks
msgF006 = Inconclusive Message
msgF007 = Inconclusive Tests
'@
117 changes: 80 additions & 37 deletions Format-Pester/Public/pl-PL/Format-Pester.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,88 @@
#Read also Get-Help about_Script_Internationalization

#The language pl-PL file prepared by Wojciech Sciesinski, wojciech[at]sciesinski[dot]net
#String aligned to version - see msg00 value
#String aligned to version - see the value of msgA000

#Translate values, don't touch 'msgxx' fields !
#Translate values, don't touch 'msgxxxx' fields !

# Groups of translation strings
# A = general
# X - temporary deprecation messages
# B = passed tests
# C = failed tests
# D = skipped tests
# E = pending tests
# F = inconclusive tests

# culture="pl-PL"
ConvertFrom-StringData @'
msg00 = 1.4.2
msg01 = Spis treści
msg02 = Testy ogółem
msg03 = Testy zdane
msg04 = Testy niezdane
msg05 = Testy pominięte
msg06 = Testy trwające
msg07 = Podsumowanie testów
msg08 = Przetwarzanie rezultatów testów dla
msg09 = Zdane
msg10 = Szczegóły zdanych testów
msg11 = Szczegóły zdanych testów dla bloku Describe:
msg12 = Szczegóły zdanych testów dla bloku Context:
msg13 = Znaleziono zdane testy dla bloku Describe
msg14 = Znaleziono zdane testy dla bloku Context
msg15 = Describe
msg16 = Context
msg17 = Nazwa
msg18 = Niezdane
msg19 = Szczegóły niezdanych testów
msg20 = Szczegóły niezdanych testów dla bloku Describe:
msg21 = Szczegóły niezdanych testów dla bloku Context:
msg22 = Znaleziono niezdane testy dla bloku Describe
msg23 = Znaleziono niezdane testy dla bloku Context
msg24 = Komunikat niezdanego testu
msg25 = Zdane testy
msg26 = Niezdane testy
msg27 = Język
msg28 = nie jest wspierany. Będzie użyty język domyślny tj. en-US.
msg29 = Wersja pliku języka jest inna niż wersja funkcji Format-Pester.ps1. Niektóre teksty mogą być wyświetlane niepoprawnie.
msg30 = Wykonywanie operacji dla
msg31 = liczba rezultatów
#Type of encoding used for write text files
#Supported values: ASCII,Unicode,UTF7,UTF8
msg32 = UTF8
msgA000=1.5.1
msgA001=Spis treści
msgA002=Testy ogółem
msgA003=Testy zdane
msgA004=Testy niezdane
msgA005=Testy pominięte
msgA006=Testy trwające
msgA007=Nierozstrzygnięte
msgA008=Podsumowanie wyników testów
msgA009=Przetwarzanie rezultatów testów dla
msgA010=Describe
msgA011=Context
msgA012=Nazwa
msgA013=Język
msgA014=nie jest wspierany. Będzie użyty język domyślny tj. en-US.
msgA015=Wersja pliku języka jest inna niż wersja funkcji Format-Pester.ps1. Niektóre teksty mogą być wyświetlane niepoprawnie.
msgA016=Wykonywanie operacji dla
msgA017=liczba rezultatów
#Type of encoding used for write text files
#Suppurted vales: ASCII,Unicode,UTF7,UTF8
msgA018=UTF8
msgA019 = Wartość parametru PesterResult nie może być pusta.
msgA020 = Nazwa wyniku testu: '{0}' jest powielona w wartości parametru ResultOrder. Duplikat zostanie pominięty by uniknąć powielenia sekcji dokumentu.
msgA021 = Nazwa wyniku testu: '{0}' jest nierozpoznana i nie zostanie uwzględniona w dokumencie. Muszą zostać użyte angielskie nazwy wyników testów.
msgA022 = Dokumenty zostaną wyeksportowane przy użyciu ustawień:
msgX001 = Użycie parametru '{0}' jest niepożądane gdyż zostanie on usunięty w przyszłej wersji Format-Pester. Proszę użyć parametru Include.
msgX002 = Użycie parametru Order jest niepożądane gdyż zostanie on usunięty w przyszłej wersji Format-Pester. Proszę użyć parametru ResultOrder.
msgX003 = Został użyty parametr PassedFirst ale rezultaty zdanych testów nie są ujęte w raporcie.
msgX004 = Został użyty parametr FailedFirst ale rezultaty niezdanych testów nie są ujęte w raporcie.
msgB000=Zdane
msgB001=Szczegóły zdanych testów
msgB002=Szczegóły zdanych testów dla bloku Describe:
msgB003=Szczegóły zdanych testów dla bloku Context:
msgB004=Znaleziono zdane testy dla bloku Describe
msgB005=Znaleziono zdane testy dla bloku Context
msgB006=NOT_EXISTS
msgB007=Zdane testy
msgC000=Niezdane
msgC001=Szczegóły niezdanych testów
msgC002=Szczegóły niezdanych testów dla bloku Describe:
msgC003=Szczegóły niezdanych testów dla bloku Context:
msgC004=Znaleziono zdane testy dla bloku Describe
msgC005=Znaleziono zdane testy dla bloku Context
msgC006=Komunikat niezdanego testu
msgC007=Niezdane testy
msgD000=Pominięte
msgD001=Szczegóły pominiętych testów
msgD002=Szczegóły pominiętych testów dla bloku Describe:
msgD003=Szczegóły pominiętych testów dla bloku Context:
msgD004=Znaleziono pominięte testy dla bloku Describe
msgD005=Znaleziono pominięte testy dla bloku Context
msgD006=Komunikat pominiętego testu
msgD007=Pominięte testy
msgE000=Trwające
msgE001=Szczegóły trwających testów
msgE002=Szczegóły trwających testów dla bloku Describe:
msgE003=Szczegóły trwających testów dla bloku Context:
msgE004=Znaleziono trwające testy dla bloku Describe
msgE005=Znaleziono trwające testy dla bloku Context
msgE006=Komunikat trwającego testu
msgE007=Trwające testy
msgF000=Nierozstrzygnięte
msgF001=Szczegóły nierozstrzygniętych testów
msgF002=Szczegóły nierozstrzygniętych testów dla bloku Describe:
msgF003=Szczegóły nierozstrzygniętych testów dla bloku Context:
msgF004=Znaleziono nierozstrzygnięte testy dla bloku Describe
msgF005=Znaleziono nierozstrzygnięte testy dla bloku Context
msgF006=Komunikat nierozstrzygniętego testu
msgF007=Nierozstrzygnięte testy
'@
27 changes: 16 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,31 @@
[![Build status](https://ci.appveyor.com/api/projects/status/36q06wp2c4vwfu7w/branch/master?svg=true)](https://ci.appveyor.com/project/equelin/format-pester/branch/master)

# Format-Pester

Powershell module for documenting Pester's results.

All the formating work is done by the module [PScribo](https://github.com/iainbrighton/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.
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](https://github.com/reportunit/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

![](./img/format-pester.png)
![](./img/Format-Pester-1.5.0-part.png)

Screenshot from HTML report generated by Format-Pester v. 1.3.0, PScribo v. 0.7.11
Partial screenshot for a HTML report generated by Format-Pester v. 1.5.0, PScribo v. 0.7.15.63, [the full screenshot](./img/Format-Pester-1.5.0-full.png).

More examples you can find [here](/examples/).

## 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.

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

Expand All @@ -32,36 +35,39 @@ If would you like add support for your language please read the section [Informa

- Powershell v.4.x
- [Pester](https://github.com/pester/Pester)
- [PScribo](https://github.com/iainbrighton/PScribo) - preferred the version >= 0.7.12.47 due to [bug](https://github.com/iainbrighton/PScribo/issues/20)
- [PScribo](https://github.com/iainbrighton/PScribo)

# Usage

Format-Pester is the PowerShell module so before usage it you need import it - more instruction you can find in [wiki](https://github.com/equelin/Format-Pester/wiki/Importing-Format-Pester).

## Example 1

```PowerShell
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
## Example

```PowerShell
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](/doc/Format-Pester.md) - online help generated by [platyPS module](https://github.com/powershell/platyps).

# Initial author

- Erwan Quélin - [GitHub](https://github.com/equelin) - [Twitter](https://twitter.com/erwanquelin)
- Erwan Quélin - [GitHub](https://github.com/equelin) - [Twitter](https://twitter.com/erwanquelin)

# Contributors

Expand All @@ -76,4 +82,3 @@ You can read [online version of help](/doc/Format-Pester.md) - online help gener
# License
Copyright 2016 Erwan Quelin and the community.
Licensed under [the MIT License](LICENSE)

3 changes: 1 addition & 2 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# TODO AND DEVELOPMENT PLANS

- add support for NUnit style xml file -> restore PS objects from NUnit https://github.com/pester/Pester/blob/master/Functions/TestResults.ps1#L41
- add support for create separate file by blocks Describe and Context of used/documented tests
- updated examples - align them to v. 1.4.0 and PScribo 0.7.12.47
- update VERSIONS.md
- automate preparing example files
Loading

0 comments on commit 5498c16

Please sign in to comment.