From 3efd9e45525f690102cca0bd95bfd6e631ac0a89 Mon Sep 17 00:00:00 2001 From: Wojciech Sciesinski Date: Mon, 5 Sep 2016 22:26:56 +0200 Subject: [PATCH] The issue fixed #12, possibility to dump the PScribo object added - resolved #15, the test for translations corrected, documentation updated --- Format-Pester/Format-Pester.psd1 | 2 +- Format-Pester/Public/Format-Pester.ps1 | 915 +++++++++--------- Format-Pester/Public/en-US/Format-Pester.psd1 | 87 +- Format-Pester/Public/pl-PL/Format-Pester.psd1 | 89 +- README.md | 217 ++--- VERSIONS.md | 38 +- doc/Format-Pester.md | 651 +++++++------ examples/1.4.0/README.md | 31 + examples/1.4.0/en-US/20160904a.docx | Bin 0 -> 43841 bytes examples/1.4.0/en-US/20160904a.html | 91 ++ examples/1.4.0/en-US/20160904a.txt | 113 +++ examples/1.4.0/en-US/20160904b.docx | Bin 0 -> 38924 bytes examples/1.4.0/en-US/20160904b.html | 80 ++ examples/1.4.0/en-US/20160904b.txt | 114 +++ examples/1.4.0/pl-PL/20160904a.docx | Bin 0 -> 43948 bytes examples/1.4.0/pl-PL/20160904a.html | 91 ++ examples/1.4.0/pl-PL/20160904a.txt | 113 +++ examples/1.4.0/pl-PL/20160904b.docx | Bin 0 -> 39053 bytes examples/1.4.0/pl-PL/20160904b.html | 80 ++ examples/1.4.0/pl-PL/20160904b.txt | 114 +++ tests/Format-Pester-translations.tests.ps1 | 575 +++++------ 21 files changed, 2154 insertions(+), 1247 deletions(-) create mode 100644 examples/1.4.0/README.md create mode 100644 examples/1.4.0/en-US/20160904a.docx create mode 100644 examples/1.4.0/en-US/20160904a.html create mode 100644 examples/1.4.0/en-US/20160904a.txt create mode 100644 examples/1.4.0/en-US/20160904b.docx create mode 100644 examples/1.4.0/en-US/20160904b.html create mode 100644 examples/1.4.0/en-US/20160904b.txt create mode 100644 examples/1.4.0/pl-PL/20160904a.docx create mode 100644 examples/1.4.0/pl-PL/20160904a.html create mode 100644 examples/1.4.0/pl-PL/20160904a.txt create mode 100644 examples/1.4.0/pl-PL/20160904b.docx create mode 100644 examples/1.4.0/pl-PL/20160904b.html create mode 100644 examples/1.4.0/pl-PL/20160904b.txt diff --git a/Format-Pester/Format-Pester.psd1 b/Format-Pester/Format-Pester.psd1 index 3f8989c..90adcd5 100644 --- a/Format-Pester/Format-Pester.psd1 +++ b/Format-Pester/Format-Pester.psd1 @@ -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.3.3' +ModuleVersion = '1.4.0' # ID used to uniquely identify this module GUID = 'daa609a5-1293-4f62-9467-1a120c529e87' diff --git a/Format-Pester/Public/Format-Pester.ps1 b/Format-Pester/Public/Format-Pester.ps1 index 8a711d6..a7ccd91 100644 --- a/Format-Pester/Public/Format-Pester.ps1 +++ b/Format-Pester/Public/Format-Pester.ps1 @@ -1,438 +1,477 @@ -Function Format-Pester { -<# - .SYNOPSIS - Document Pester's tests results into the selected format (HTML, Word, Text). - - .DESCRIPTION - Create documents in formats: HTML, Word, Text using PScribo PowerShell module. Documents are preformated to be human friendly. - Local Word installation is not needed to be installed on the computers were documents. - - Additional languages (other than en-US) can be used - please read info for translator on the project web page. - - .PARAMETER PesterResult - Specifies the Pester results Object - - .PARAMETER Format - Specifies the document format. Might be: - - Text - - HTML - - Word - - .PARAMETER Path - Specifies where the documents will be stored. Default is the path where is executed this function. - - .PARAMETER BaseFileName - Specifies the document name. Default is 'Pester_Results'. - - .PARAMETER Order - Specify what results need to be evaluated first - passed or failed - means that will be included on the top of report. - By default failed tests are evaluated first. - - .PARAMETER GroupResultsBy - Select how results should be groupped. Available options: Result, Result-Describe, Result-Describe-Context. - - .PARAMETER PassedOnly - Select to return information about passed tests only. - - .PARAMETER FailedOnly - Select to return information about failed tests only. - - .PARAMETER SummaryOnly - Select to return only summaries for tests only (sums of numbers passed/failed/etc. tests). - - .PARAMETER SkipTableOfContent - Select to skip adding table of content at the begining of document(s). - - .PARAMETER SkipSummary - Select to skip adding table with test summaries (sums of numbers passed/failed/etc. tests). - - .PARAMETER Language - Select language what need to be used for generated reports. - By default language is detected by Get-Culture with fallback to en-US if translation is not available. - - .PARAMETER Version - Use that parameter to display version of Format-Pester only. - This parameter can be used to verify translations. - - .EXAMPLE - Invoke-Pester -PassThru | Format-Pester -Path . -Format HTML,Word,Text -BaseFileName 'PesterResults' - - This command will document the results of the Pester's tests. - Documents will be stored in the current path and they will be available in 3 formats (.html,.docx and .txt). - - .LINK - https://github.com/equelin/Format-Pester - - .NOTES - Initial author: Erwan Quelin - - Credits/coauthors: - - Travis Plunk, github[at]ez13[dot]net - - Wojciech Sciesinski, wojciech[at]sciesinski[dot]net - - LICENSE - Licensed under the MIT License - https://github.com/equelin/Format-Pester/blob/master/LICENSE - - TODO - - Pester test need to be updated - yes, post factum TDD ;-) - - INPUTS, OUTPUTS need to be described - - #> - - [CmdletBinding(DefaultParameterSetName = 'AllParamSet')] - [OutputType([IO.FileInfo])] - Param ( - [Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $True, ValueFromPipelinebyPropertyName = $True, HelpMessage = 'Pester results Object', ParameterSetName = 'AllParamSet')] - [Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $True, ValueFromPipelinebyPropertyName = $True, HelpMessage = 'Pester results Object', ParameterSetName = 'PassedOnlyParamSet')] - [Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $True, ValueFromPipelinebyPropertyName = $True, HelpMessage = 'Pester results Object', ParameterSetName = 'FailedOnlyParamSet')] - [Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $True, ValueFromPipelinebyPropertyName = $True, HelpMessage = 'Pester results Object', ParameterSetName = 'SummaryOnlyParamSet')] - [Parameter(Mandatory = $false, Position = 0, ValueFromPipeline = $True, ValueFromPipelinebyPropertyName = $True, HelpMessage = 'Pester results Object', ParameterSetName = 'VersionOnlyParamSet')] - [Array]$PesterResult, - [Parameter(Mandatory = $true, HelpMessage = 'PScribo export format', ParameterSetName = 'AllParamSet')] - [Parameter(Mandatory = $true, ParameterSetName = 'PassedOnlyParamSet')] - [Parameter(Mandatory = $true, ParameterSetName = 'FailedOnlyParamSet')] - [Parameter(Mandatory = $true, ParameterSetName = 'SummaryOnlyParamSet')] - [Parameter(Mandatory = $false, ParameterSetName = 'VersionOnlyParamSet')] - [ValidateSet('Text', 'Word', 'HTML')] - [String[]]$Format, - [Parameter(Mandatory = $false, HelpMessage = 'PScribo export path', ParameterSetName = 'AllParamSet')] - [Parameter(Mandatory = $false, ParameterSetName = 'PassedOnlyParamSet')] - [Parameter(Mandatory = $false, ParameterSetName = 'FailedOnlyParamSet')] - [Parameter(Mandatory = $false, ParameterSetName = 'SummaryOnlyParamSet')] - [ValidateNotNullorEmpty()] - [String]$Path = (Get-Location -PSProvider FileSystem), - [ValidateNotNullorEmpty()] - [string]$BaseFileName = 'Pester_Results', - [Parameter(Mandatory = $false, ParameterSetName = 'AllParamSet')] - [ValidateSet('FailedFirst', 'PassedFirst')] - [String]$Order = 'FailedFirst', - [Parameter(Mandatory = $false, ParameterSetName = 'AllParamSet')] - [Parameter(Mandatory = $false, ParameterSetName = 'PassedOnlyParamSet')] - [Parameter(Mandatory = $false, ParameterSetName = 'FailedOnlyParamSet')] - [ValidateSet('Result', 'Result-Describe', 'Result-Describe-Context')] - [String]$GroupResultsBy = 'Result', - [Parameter(Mandatory = $false, ParameterSetName = 'PassedOnlyParamSet')] - [Switch]$PassedOnly, - [Parameter(Mandatory = $false, ParameterSetName = 'FailedOnlyParamSet')] - [Switch]$FailedOnly, - [Parameter(Mandatory = $false, ParameterSetName = 'SummaryOnlyParamSet')] - [switch]$SummaryOnly, - [Parameter(Mandatory = $false, ParameterSetName = 'AllParamSet')] - [Parameter(Mandatory = $false, ParameterSetName = 'PassedOnlyParamSet')] - [Parameter(Mandatory = $false, ParameterSetName = 'FailedOnlyParamSet')] - [Parameter(Mandatory = $false, ParameterSetName = 'SummaryOnlyParamSet')] - [Switch]$SkipTableOfContent, - [Parameter(Mandatory = $false, ParameterSetName = 'AllParamSet')] - [Parameter(Mandatory = $false, ParameterSetName = 'PassedOnlyParamSet')] - [Parameter(Mandatory = $false, ParameterSetName = 'FailedOnlyParamSet')] - [Switch]$SkipSummary, - [Parameter(Mandatory = $false, ParameterSetName = 'AllParamSet')] - [Parameter(Mandatory = $false, ParameterSetName = 'PassedOnlyParamSet')] - [Parameter(Mandatory = $false, ParameterSetName = 'FailedOnlyParamSet')] - [Parameter(Mandatory = $false, ParameterSetName = 'SummaryOnlyParamSet')] - [String]$Language = $($(Get-Culture).Name), - [Parameter(Mandatory = $false, ParameterSetName = 'VersionOnlyParamSet')] - [Switch]$Version - ) - - [Version]$ScriptVersion = "1.3.3" - - If ($Version.IsPresent) { - - Return $ScriptVersion.ToString() - - Break - - } - Else { - - if ($null -eq $PesterResult) { - - $MessageText = "Value of the parameter PesterResult can't be null or empty." - - Throw $MessageText - - } - - } - - Import-LocalizedData -FileName Format-Pester.psd1 -BindingVariable LocalizedStrings -UICulture $Language -ErrorAction SilentlyContinue - - If ([String]::IsNullOrEmpty($LocalizedStrings)) { - - Import-LocalizedData -FileName Format-Pester.psd1 -BindingVariable LocalizedStrings -UICulture 'en-US' -ErrorAction Stop - - [String]$MessageText = "{0} {1} {2}" -f $LocalizedStrings.msg27, $Language, $LocalizedStrings.msg28 - - Write-Verbose -Message $MessageText - - } - - If ($LocalizedStrings.msg00 -lt $ScriptVersion) { - - [String]$MessageText = "{0}" -f $LocalizedStrings.msg29 - - Write-Warning -Message $MessageText - - } - - - - #LocalizedStrings are not sorted alphabeticaly -even if you are using Sort-Object ! - #$LocalizedStrings - - $exportParams = @{ } - if ($Format.Count -eq 1 -and $Format -eq 'HTML') { - $exportParams += @{ - Options = @{ NoPageLayoutStyle = $true } - } - } - - Document $BaseFileName { - - # Global options - GlobalOption -PageSize A4 - - - #Variables used to create numbers for TOC and subsections - $Head1Counter = 1 - - If (-not $SkipTableOfContent.ispresent) { - - # Table of content - [String]$TOCName = $LocalizedStrings.msg01 - - TOC -Name $TOCName - - } - - If (-not $SkipSummary.IsPresent) { - - # Columns used for the summary table - - #This variable can't be translated - $SummaryColumnsData = @('TotalCount', 'PassedCount', 'FailedCount', 'SkippedCount', 'PendingCount') - - $SummaryColumnsHeaders = @($LocalizedStrings.msg02, $LocalizedStrings.msg03, $LocalizedStrings.msg04, $LocalizedStrings.msg05, $LocalizedStrings.msg06) - - # Style definitions used for the summary table - Style -Name Total -Color White -BackgroundColor Blue - Style -Name Passed -Color White -BackgroundColor Green - Style -Name Failed -Color White -BackgroundColor Red - Style -Name Other -Color White -BackgroundColor Gray - - # Results Summary - - $ResultsSummaryTitle = "{0}.`t{1}" -f $Head1Counter, $LocalizedStrings.msg07 - - $Head1Counter++ - - $ValidResults = $PesterResult | Where-Object { $null -ne $_.TotalCount } | Sort-Object -Property FailedCount -Descending - Section -Name $ResultsSummaryTitle -Style Heading2 -ScriptBlock { - - $ValidResults | Set-Style -Style 'Total' -Property 'TotalCount' - $ValidResults | Set-Style -Style 'Passed' -Property 'PassedCount' - $ValidResults | Set-Style -Style 'Failed' -Property 'FailedCount' - $ValidResults | Set-Style -Style 'Other' -Property 'SkippedCount' - $ValidResults | Set-Style -Style 'Other' -Property 'PendingCount' - $ValidResults | Table -Columns $SummaryColumnsData -Headers $SummaryColumnsHeaders -Width 90 - - } - - } - - If (-not $SummaryOnly.IsPresent) { - - #Expanding Pester summary to receive all tests results - $PesterTestsResults = $PesterResult | Select-Object -ExpandProperty TestResult - - [Array]$EvaluateResults = $null - - If ((-not $PassedOnly.IsPresent) -and $PesterResult.FailedCount -gt 0) { - - $EvaluateResults += 'Failed' - - } - - If ((-not $FailedOnly.IsPresent) -and $PesterResult.PassedCount -gt 0) { - - $EvaluateResults += 'Passed' - - If ($Order -eq 'PassedFirst') { - - $EvaluateResults = $($EvaluateResults | Sort-Object -Descending) - - } - - } - - foreach ($CurrentResultType in $EvaluateResults) { - - switch ($CurrentResultType) { - - 'Passed' { - - $CurrentResultTypeLocalized = $LocalizedStrings.msg09 - - $Head1SectionTitle = $LocalizedStrings.msg25 - - $Header1TitlePart = $LocalizedStrings.msg10 - - $Header2TitlePart = $LocalizedStrings.msg11 - - $Header3TitlePart = $LocalizedStrings.msg12 - - $VerboseMsgHeader2Part = $LocalizedStrings.msg13 - - $VerboseMsgHeader3Part = $LocalizedStrings.msg14 - - #This variable can't be translated - $TestsResultsColumnsData = @('Describe', 'Context', 'Name') - - $TestsResultsColumnsHeaders = @($LocalizedStrings.msg15, $LocalizedStrings.msg16, $LocalizedStrings.msg17) - - } - - - 'Failed' { - - $CurrentResultTypeLocalized = $LocalizedStrings.msg18 - - $Head1SectionTitle = $LocalizedStrings.msg26 - - $Header1TitlePart = $LocalizedStrings.msg19 - - $Header2TitlePart = $LocalizedStrings.msg20 - - $Header3TitlePart = $LocalizedStrings.msg21 - - $VerboseMsgHeader2Part = $LocalizedStrings.msg22 - - $VerboseMsgHeader3Part = $LocalizedStrings.msg23 - - #This variable can't be translated - $TestsResultsColumnsData = @('Context', 'Name', 'FailureMessage') - - $TestsResultsColumnsHeaders = @($LocalizedStrings.msg16, $LocalizedStrings.msg17, $LocalizedStrings.msg24) - - } - - } - - $VerboseMsgMainLoop = $LocalizedStrings.msg08 - - [String]$MessageText = "{0} {1} " -f $VerboseMsgMainLoop, $CurrentResultTypeLocalized - - Write-Verbose -Message $MessageText - - $Head2counter = 1 - - $Head3counter = 1 - - If (-not $PassedOnly.IsPresent) { - - $CurrentPesterTestResults = $PesterTestsResults | Where-object -FilterScript { $_.Result -eq $CurrentResultType } - - If ($GroupResultsBy -eq 'Result') { - - [String]$Header1Title = "{0}.`t {1}" -f $Head1counter, $Header1TitlePart - - Section -Name $Header1Title -Style Heading1 { - - $CurrentPesterTestResults | - Table -Columns $TestsResultsColumnsData -Headers $TestsResultsColumnsHeaders -Width 90 - - } - - $Head1counter++ - - } - - Else { - - Section -Name "$Head1Counter.`t $Head1SectionTitle " -Style Heading1 -ScriptBlock { - - #Get unique 'Describe' from Pester results - [Array]$Headers2 = $CurrentPesterTestResults | Select-Object -Property Describe -Unique - - # Tests results details - Grouped by Describe - foreach ($Header2 in $Headers2) { - - [String]$MessageText = "{0}: {1} " -f $VerboseMsgHeader2Part, $($Header2.Describe) - - Write-Verbose -Message $MessageText - - $SubHeader2Number = "{0}.{1}" -f $Head1Counter, $Head2counter - - [String]$Header2Title = "{0}.`t {1} {2}" -f $SubHeader2Number, $Header2TitlePart, $($Header2.Describe) - - Section -Name $Header2Title -Style Heading2 -ScriptBlock { - - $CurrentPesterTestResults2 = $CurrentPesterTestResults | Where-Object -FilterScript { $_.Describe -eq $Header2.Describe } - - $CurrentPesterTestResultsCount2 = ($CurrentPesterTestResults2 | Measure-Object).Count - - If ($GroupResultsBy -eq 'Result-Describe-Context') { - - [Array]$Headers3 = $CurrentPesterTestResults2 | Select-Object -Property Context -Unique - - foreach ($Header3 in $Headers3) { - - [String]$MessageText = "{0}: {1} " -f $VerboseMsgHeader3Part, $($Header3.Context) - - Write-Verbose -Message $MessageText - - $CurrentPesterTestResults3 = $CurrentPesterTestResults2 | Where-Object -FilterScript { $_.Context -eq $Header3.Context } - - $CurrentPesterTestResultsCount3 = ($CurrentPesterTestResults3 | Measure-Object).Count - - $SubHeader3Number = "{0}.{1}.{2}" -f $Head1Counter, $Head2counter, $Head3counter - - [String]$Header3Title = "{0}.`t {1} {2}" -f $SubHeader3Number, $Header3TitlePart, $($Header3.Context) - - Section -Name $Header3Title -Style Heading3 -ScriptBlock { - - $MessageText = "{0} {1} {2}, {3} {4}" -f $LocalizedStrings.msg30, $Header3TitlePart, $($Header3.Context), $LocalizedStrings.msg31, $CurrentPesterTestResultsCount3 - - Write-Verbose -Message $MessageText - - $CurrentPesterTestResults3 | - Table -Columns $TestsResultsColumnsData -Headers $TestsResultsColumnsHeaders -Width 90 - } - - $Head3Counter++ - - } - - } #$GroupResultsBy -eq 'Result-Describe-Context' - Else { - - $MessageText = "{0} {1} {2}, {3}: {4}" -f $LocalizedStrings.msg30, $Header3TitlePart, $($Header3.Context), $LocalizedStrings.msg31, $CurrentPesterTestResultsCount3 - - Write-Verbose -Message $MessageText - - $CurrentPesterTestResults2 | - Table -Columns $TestsResultsColumnsData -Headers $TestsResultsColumnsHeaders -Width 90 - - } - - } - - $Head2counter++ - - } #end foreach ($Header2 in $FailedHeaders2) - - } - - $Head1Counter++ - - } #end $GroupResultsBy -ne 'Result' - - } - - } - - } - - } | Export-Document -Path $Path -Format $Format @exportParams -} +Function Format-Pester { +<# + .SYNOPSIS + Document Pester's tests results into the selected format (HTML, Word, Text). + + .DESCRIPTION + Create documents in formats: HTML, Word, Text using PScribo PowerShell module. Documents are preformated to be human friendly. + Local Word installation is not needed to be installed on the computers were documents. + + Additional languages (other than en-US) can be used - please read info for translator on the project web page. + + .PARAMETER PesterResult + Specifies the Pester results Object + + .PARAMETER Format + Specifies the document format. Might be: + - Text + - HTML + - Word + + .PARAMETER Path + Specifies where the documents will be stored. Default is the path where is executed this function. + + .PARAMETER BaseFileName + Specifies the document name. Default is 'Pester_Results'. + + .PARAMETER Order + Specify what results need to be evaluated first - passed or failed - means that will be included on the top of report. + By default failed tests are evaluated first. + + .PARAMETER GroupResultsBy + Select how results should be groupped. Available options: Result, Result-Describe, Result-Describe-Context. + + .PARAMETER PassedOnly + Select to return information about passed tests only. + + .PARAMETER FailedOnly + Select to return information about failed tests only. + + .PARAMETER SummaryOnly + Select to return only summaries for tests only (sums of numbers passed/failed/etc. tests). + + .PARAMETER SkipTableOfContent + Select to skip adding table of content at the begining of document(s). + + .PARAMETER SkipSummary + Select to skip adding table with test summaries (sums of numbers passed/failed/etc. tests). + + .PARAMETER Language + Select language what need to be used for generated reports. + By default language is detected by Get-Culture with fallback to en-US if translation is not available. + + .PARAMETER Version + Use that parameter to display version of Format-Pester only. + This parameter can be used to verify translations. + + .PARAMETER DumpPScriboObject + When DumpPscriboObject is used the result of the function is custom object containing PScribo Document. + Use this parameter for prepare tests or debug of document generation. + + .INPUTS + An expected input is the result of the command Invoke-Pester with the parameter -PassThru. + With that command Invoke-Pester returns a custom object (PSCustomObject) that contains the test results. + + .OUTPUTS + Files what contain results of test. Files format and structure is based on values of parameters used. + + .EXAMPLE + Invoke-Pester -PassThru | Format-Pester -Path . -Format HTML,Word,Text -BaseFileName 'PesterResults' + + This command will document the results of the Pester's tests. + Documents will be stored in the current path and they will be available in 3 formats (.html,.docx and .txt). + + .LINK + https://github.com/equelin/Format-Pester + + .NOTES + Initial author: Erwan Quelin + + Credits/coauthors: + - Travis Plunk, github[at]ez13[dot]net + - Wojciech Sciesinski, wojciech[at]sciesinski[dot]net + + LICENSE + Licensed under the MIT License - https://github.com/equelin/Format-Pester/blob/master/LICENSE + + TODO + - Pester test need to be updated - yes, post factum TDD ;-) + + #> + + [CmdletBinding(DefaultParameterSetName = 'AllParamSet')] + [OutputType([IO.FileInfo])] + Param ( + [Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $True, ValueFromPipelinebyPropertyName = $True, HelpMessage = 'Pester results Object', ParameterSetName = 'AllParamSet')] + [Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $True, ValueFromPipelinebyPropertyName = $True, HelpMessage = 'Pester results Object', ParameterSetName = 'PassedOnlyParamSet')] + [Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $True, ValueFromPipelinebyPropertyName = $True, HelpMessage = 'Pester results Object', ParameterSetName = 'FailedOnlyParamSet')] + [Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $True, ValueFromPipelinebyPropertyName = $True, HelpMessage = 'Pester results Object', ParameterSetName = 'SummaryOnlyParamSet')] + [Parameter(Mandatory = $false, Position = 0, ValueFromPipeline = $True, ValueFromPipelinebyPropertyName = $True, HelpMessage = 'Pester results Object', ParameterSetName = 'VersionOnlyParamSet')] + [Array]$PesterResult, + [Parameter(Mandatory = $true, HelpMessage = 'PScribo export format', ParameterSetName = 'AllParamSet')] + [Parameter(Mandatory = $true, ParameterSetName = 'PassedOnlyParamSet')] + [Parameter(Mandatory = $true, ParameterSetName = 'FailedOnlyParamSet')] + [Parameter(Mandatory = $true, ParameterSetName = 'SummaryOnlyParamSet')] + [Parameter(Mandatory = $false, ParameterSetName = 'VersionOnlyParamSet')] + [ValidateSet('Text', 'Word', 'HTML')] + [String[]]$Format, + [Parameter(Mandatory = $false, HelpMessage = 'PScribo export path', ParameterSetName = 'AllParamSet')] + [Parameter(Mandatory = $false, ParameterSetName = 'PassedOnlyParamSet')] + [Parameter(Mandatory = $false, ParameterSetName = 'FailedOnlyParamSet')] + [Parameter(Mandatory = $false, ParameterSetName = 'SummaryOnlyParamSet')] + [ValidateNotNullorEmpty()] + [String]$Path = (Get-Location -PSProvider FileSystem), + [ValidateNotNullorEmpty()] + [string]$BaseFileName = 'Pester_Results', + [Parameter(Mandatory = $false, ParameterSetName = 'AllParamSet')] + [ValidateSet('FailedFirst', 'PassedFirst')] + [String]$Order = 'FailedFirst', + [Parameter(Mandatory = $false, ParameterSetName = 'AllParamSet')] + [Parameter(Mandatory = $false, ParameterSetName = 'PassedOnlyParamSet')] + [Parameter(Mandatory = $false, ParameterSetName = 'FailedOnlyParamSet')] + [ValidateSet('Result', 'Result-Describe', 'Result-Describe-Context')] + [String]$GroupResultsBy = 'Result', + [Parameter(Mandatory = $false, ParameterSetName = 'PassedOnlyParamSet')] + [Switch]$PassedOnly, + [Parameter(Mandatory = $false, ParameterSetName = 'FailedOnlyParamSet')] + [Switch]$FailedOnly, + [Parameter(Mandatory = $false, ParameterSetName = 'SummaryOnlyParamSet')] + [switch]$SummaryOnly, + [Parameter(Mandatory = $false, ParameterSetName = 'AllParamSet')] + [Parameter(Mandatory = $false, ParameterSetName = 'PassedOnlyParamSet')] + [Parameter(Mandatory = $false, ParameterSetName = 'FailedOnlyParamSet')] + [Parameter(Mandatory = $false, ParameterSetName = 'SummaryOnlyParamSet')] + [Switch]$SkipTableOfContent, + [Parameter(Mandatory = $false, ParameterSetName = 'AllParamSet')] + [Parameter(Mandatory = $false, ParameterSetName = 'PassedOnlyParamSet')] + [Parameter(Mandatory = $false, ParameterSetName = 'FailedOnlyParamSet')] + [Switch]$SkipSummary, + [Parameter(Mandatory = $false, ParameterSetName = 'AllParamSet')] + [Parameter(Mandatory = $false, ParameterSetName = 'PassedOnlyParamSet')] + [Parameter(Mandatory = $false, ParameterSetName = 'FailedOnlyParamSet')] + [Parameter(Mandatory = $false, ParameterSetName = 'SummaryOnlyParamSet')] + [String]$Language = $($(Get-Culture).Name), + [Parameter(Mandatory = $false, ParameterSetName = 'VersionOnlyParamSet')] + [Switch]$Version, + [Parameter(Mandatory = $false, ParameterSetName = 'AllParamSet')] + [Parameter(Mandatory = $false, ParameterSetName = 'PassedOnlyParamSet')] + [Parameter(Mandatory = $false, ParameterSetName = 'FailedOnlyParamSet')] + [Parameter(Mandatory = $false, ParameterSetName = 'SummaryOnlyParamSet')] + [Switch]$DumpPScriboObject + ) + + [Version]$ScriptVersion = "1.4.0" + + If ($Version.IsPresent) { + + Return $ScriptVersion.ToString() + + Break + + } + Else { + + if ($null -eq $PesterResult) { + + $MessageText = "Value of the parameter PesterResult can't be null or empty." + + Throw $MessageText + + } + + } + + Import-LocalizedData -FileName Format-Pester.psd1 -BindingVariable LocalizedStrings -UICulture $Language -ErrorAction SilentlyContinue + + If ([String]::IsNullOrEmpty($LocalizedStrings)) { + + Import-LocalizedData -FileName Format-Pester.psd1 -BindingVariable LocalizedStrings -UICulture 'en-US' -ErrorAction Stop + + [String]$MessageText = "{0} {1} {2}" -f $LocalizedStrings.msg27, $Language, $LocalizedStrings.msg28 + + Write-Verbose -Message $MessageText + + } + + If ($LocalizedStrings.msg00 -lt $ScriptVersion) { + + [String]$MessageText = "{0}" -f $LocalizedStrings.msg29 + + Write-Warning -Message $MessageText + + } + + $TextFileEncoding = $LocalizedStrings.msg32 + + #LocalizedStrings are not sorted alphabeticaly -even if you are using Sort-Object ! + #$LocalizedStrings + + $exportParams = @{ } + if ($Format.Count -eq 1 -and $Format -eq 'HTML') { + + $exportParams += @{ + + Options = @{ NoPageLayoutStyle = $true } + } + + + } + elseif ($Format -contains 'text' -and $TextFileEncoding -ne 'ASCII') { + + $exportParams += @{ + + Options = @{ Encoding = $TextFileEncoding } + + } + + + } + + + $PScriboObject = Document $BaseFileName { + + # Global options + GlobalOption -PageSize A4 + + + #Variables used to create numbers for TOC and subsections + $Head1Counter = 1 + + If (-not $SkipTableOfContent.ispresent) { + + # Table of content header text + [String]$TOCName = $LocalizedStrings.msg01 + + TOC -Name $TOCName + + } + + If (-not $SkipSummary.IsPresent) { + + # Columns used for the summary table + + #This variable can't be translated + $SummaryColumnsData = @('TotalCount', 'PassedCount', 'FailedCount', 'SkippedCount', 'PendingCount') + + $SummaryColumnsHeaders = @($LocalizedStrings.msg02, $LocalizedStrings.msg03, $LocalizedStrings.msg04, $LocalizedStrings.msg05, $LocalizedStrings.msg06) + + # Style definitions used for the summary table + Style -Name Total -Color White -BackgroundColor Blue + Style -Name Passed -Color White -BackgroundColor Green + Style -Name Failed -Color White -BackgroundColor Red + Style -Name Other -Color White -BackgroundColor Gray + + # Results Summary + + $ResultsSummaryTitle = "{0}.`t{1}" -f $Head1Counter, $LocalizedStrings.msg07 + + $Head1Counter++ + + $ValidResults = $PesterResult | Where-Object { $null -ne $_.TotalCount } | Sort-Object -Property FailedCount -Descending + Section -Name $ResultsSummaryTitle -Style Heading2 -ScriptBlock { + + $ValidResults | Set-Style -Style 'Total' -Property 'TotalCount' + $ValidResults | Set-Style -Style 'Passed' -Property 'PassedCount' + $ValidResults | Set-Style -Style 'Failed' -Property 'FailedCount' + $ValidResults | Set-Style -Style 'Other' -Property 'SkippedCount' + $ValidResults | Set-Style -Style 'Other' -Property 'PendingCount' + $ValidResults | Table -Columns $SummaryColumnsData -Headers $SummaryColumnsHeaders -Width 90 + + } + + } + + If (-not $SummaryOnly.IsPresent) { + + #Expanding Pester summary to receive all tests results + $PesterTestsResults = $PesterResult | Select-Object -ExpandProperty TestResult + + [Array]$EvaluateResults = $null + + If ((-not $PassedOnly.IsPresent) -and $PesterResult.FailedCount -gt 0) { + + $EvaluateResults += 'Failed' + + } + + If ((-not $FailedOnly.IsPresent) -and $PesterResult.PassedCount -gt 0) { + + $EvaluateResults += 'Passed' + + If ($Order -eq 'PassedFirst') { + + $EvaluateResults = $($EvaluateResults | Sort-Object -Descending) + + } + + } + + foreach ($CurrentResultType in $EvaluateResults) { + + switch ($CurrentResultType) { + + 'Passed' { + + $CurrentResultTypeLocalized = $LocalizedStrings.msg09 + + $Head1SectionTitle = $LocalizedStrings.msg25 + + $Header1TitlePart = $LocalizedStrings.msg10 + + $Header2TitlePart = $LocalizedStrings.msg11 + + $Header3TitlePart = $LocalizedStrings.msg12 + + $VerboseMsgHeader2Part = $LocalizedStrings.msg13 + + $VerboseMsgHeader3Part = $LocalizedStrings.msg14 + + #This variable can't be translated + $TestsResultsColumnsData = @('Describe', 'Context', 'Name') + + $TestsResultsColumnsHeaders = @($LocalizedStrings.msg15, $LocalizedStrings.msg16, $LocalizedStrings.msg17) + + } + + + 'Failed' { + + $CurrentResultTypeLocalized = $LocalizedStrings.msg18 + + $Head1SectionTitle = $LocalizedStrings.msg26 + + $Header1TitlePart = $LocalizedStrings.msg19 + + $Header2TitlePart = $LocalizedStrings.msg20 + + $Header3TitlePart = $LocalizedStrings.msg21 + + $VerboseMsgHeader2Part = $LocalizedStrings.msg22 + + $VerboseMsgHeader3Part = $LocalizedStrings.msg23 + + #This variable can't be translated + $TestsResultsColumnsData = @('Context', 'Name', 'FailureMessage') + + $TestsResultsColumnsHeaders = @($LocalizedStrings.msg16, $LocalizedStrings.msg17, $LocalizedStrings.msg24) + + } + + } + + $VerboseMsgMainLoop = $LocalizedStrings.msg08 + + [String]$MessageText = "{0} {1} " -f $VerboseMsgMainLoop, $CurrentResultTypeLocalized + + Write-Verbose -Message $MessageText + + $Head2counter = 1 + + $Head3counter = 1 + + If (-not $PassedOnly.IsPresent) { + + $CurrentPesterTestResults = $PesterTestsResults | Where-object -FilterScript { $_.Result -eq $CurrentResultType } + + If ($GroupResultsBy -eq 'Result') { + + [String]$Header1Title = "{0}.`t {1}" -f $Head1counter, $Header1TitlePart + + Section -Name $Header1Title -Style Heading1 { + + $CurrentPesterTestResults | + Table -Columns $TestsResultsColumnsData -Headers $TestsResultsColumnsHeaders -Width 90 + + } + + $Head1counter++ + + } + + Else { + + Section -Name "$Head1Counter.`t $Head1SectionTitle " -Style Heading1 -ScriptBlock { + + #Get unique 'Describe' from Pester results + [Array]$Headers2 = $CurrentPesterTestResults | Select-Object -Property Describe -Unique + + # Tests results details - Grouped by Describe + foreach ($Header2 in $Headers2) { + + [String]$MessageText = "{0}: {1} " -f $VerboseMsgHeader2Part, $($Header2.Describe) + + Write-Verbose -Message $MessageText + + $SubHeader2Number = "{0}.{1}" -f $Head1Counter, $Head2counter + + [String]$Header2Title = "{0}.`t {1} {2}" -f $SubHeader2Number, $Header2TitlePart, $($Header2.Describe) + + Section -Name $Header2Title -Style Heading2 -ScriptBlock { + + $CurrentPesterTestResults2 = $CurrentPesterTestResults | Where-Object -FilterScript { $_.Describe -eq $Header2.Describe } + + $CurrentPesterTestResultsCount2 = ($CurrentPesterTestResults2 | Measure-Object).Count + + If ($GroupResultsBy -eq 'Result-Describe-Context') { + + [Array]$Headers3 = $CurrentPesterTestResults2 | Select-Object -Property Context -Unique + + foreach ($Header3 in $Headers3) { + + [String]$MessageText = "{0}: {1} " -f $VerboseMsgHeader3Part, $($Header3.Context) + + Write-Verbose -Message $MessageText + + $CurrentPesterTestResults3 = $CurrentPesterTestResults2 | Where-Object -FilterScript { $_.Context -eq $Header3.Context } + + $CurrentPesterTestResultsCount3 = ($CurrentPesterTestResults3 | Measure-Object).Count + + $SubHeader3Number = "{0}.{1}.{2}" -f $Head1Counter, $Head2counter, $Head3counter + + [String]$Header3Title = "{0}.`t {1} {2}" -f $SubHeader3Number, $Header3TitlePart, $($Header3.Context) + + Section -Name $Header3Title -Style Heading3 -ScriptBlock { + + $MessageText = "{0} {1} {2}, {3} {4}" -f $LocalizedStrings.msg30, $Header3TitlePart, $($Header3.Context), $LocalizedStrings.msg31, $CurrentPesterTestResultsCount3 + + Write-Verbose -Message $MessageText + + $CurrentPesterTestResults3 | + Table -Columns $TestsResultsColumnsData -Headers $TestsResultsColumnsHeaders -Width 90 + } + + $Head3Counter++ + + } + + } #$GroupResultsBy -eq 'Result-Describe-Context' + Else { + + $MessageText = "{0} {1} {2}, {3}: {4}" -f $LocalizedStrings.msg30, $Header3TitlePart, $($Header3.Context), $LocalizedStrings.msg31, $CurrentPesterTestResultsCount3 + + Write-Verbose -Message $MessageText + + $CurrentPesterTestResults2 | + Table -Columns $TestsResultsColumnsData -Headers $TestsResultsColumnsHeaders -Width 90 + + } + + } + + $Head2counter++ + + } #end foreach ($Header2 in $Headers2) + + } + + $Head1Counter++ + + } #end $GroupResultsBy -ne 'Result' + + } + + } + + } + + } + + If ($DumpPScriboObject.IsPresent) { + + Return $PScriboObject + + } + + $PScriboObject | Export-Document -Path $Path -Format $Format @exportParams + +} diff --git a/Format-Pester/Public/en-US/Format-Pester.psd1 b/Format-Pester/Public/en-US/Format-Pester.psd1 index ba6e985..25702bd 100644 --- a/Format-Pester/Public/en-US/Format-Pester.psd1 +++ b/Format-Pester/Public/en-US/Format-Pester.psd1 @@ -1,43 +1,46 @@ -#Please read the section 'Information for translators' on the GitHub project page -#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 - -#Translate values, don't touch 'msgxx' fields ! - -# culture="en-US" -ConvertFrom-StringData @' - msg00 = 1.3.3 - 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 Decribe 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 Decribe 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 +#Please read the section 'Information for translators' on the GitHub project page +#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 + +#Translate values, don't touch 'msgxx' fields ! + +# culture="en-US" +ConvertFrom-StringData @' + msg00 = 1.4.0 + 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 Decribe 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 Decribe 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 '@ \ No newline at end of file diff --git a/Format-Pester/Public/pl-PL/Format-Pester.psd1 b/Format-Pester/Public/pl-PL/Format-Pester.psd1 index 1da2528..1799ca6 100644 --- a/Format-Pester/Public/pl-PL/Format-Pester.psd1 +++ b/Format-Pester/Public/pl-PL/Format-Pester.psd1 @@ -1,43 +1,46 @@ -#Please read the section 'Information for translators' on the GitHub project page -#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 - -#Translate values, don't touch 'msgxx' fields ! - -# culture="pl-PL" -ConvertFrom-StringData @' - msg00 = 1.3.3 - 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 Decribe - 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 zdane testy dla bloku Decribe - msg23 = Znaleziono zdane 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 -'@ \ No newline at end of file +#Please read the section 'Information for translators' on the GitHub project page +#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 + +#Translate values, don't touch 'msgxx' fields ! + +# culture="pl-PL" +ConvertFrom-StringData @' + msg00 = 1.4.0 + 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 Decribe + 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 zdane testy dla bloku Decribe + msg23 = Znaleziono zdane 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 vales: ASCII,Unicode,UTF7,UTF8 + msg32 = UTF8 +'@ diff --git a/README.md b/README.md index caa625c..26424e9 100644 --- a/README.md +++ b/README.md @@ -1,108 +1,109 @@ -[![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). - -## Example - -![](./img/format-pester.png) - -Screenshot from HTML report generated by Format-Pester v. 1.3.0, PScribo v. 0.7.11 - -More examples you can find [here](/examples/). - -## Supported languages -Since version 1.3.0 internationalization of generated reports is supported. - -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' - -# Requirements - -- 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) - -# Instructions -## Install the module -```powershell -# One time setup with Powershell 5 - Install-Module Format-Pester - -# Or Manually - # Download the repository - # Unblock the zip - # Extract the Format-Pester folder to a module path (e.g. $env:USERPROFILE\Documents\WindowsPowerShell\Modules\) - -# Import the module - Import-Module Format-Pester #Alternatively, Import-Module \\Path\To\Format-Pester - -# Get commands in the module - Get-Command -Module Format-Pester - -# Help for commands - Get-Help Format-Pester -Full -``` -## Online help -You can read [online version of help](/doc/Format-Pester.md) - online help generated by [platyPS module](https://github.com/powershell/platyps) - -# Usage - -```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). - -# Available functions - -- [Format-Pester](/doc/Format-Pester.md) - -# Contributors - -- Travis Plunk - [GitHub](https://github.com/TravisEz13) - [Twitter](https://twitter.com/TravisPlunk) -- Wojciech Sciesinski - [GitHub](https://github.com/it-praktyk) - [Twitter](https://twitter.com/ITpraktyk) - -# Author - -**Erwan Quélin** -- -- - -# Information for translators -Format-Pester can be used to prepare reports in languages different than English but a language file for your PSCulture/language need to be available. - -To translate required strings to your language please -- read general information about PowerShell support for internationalization - ``` - Get-Help about_Script_Internationalization - ``` - online version about_Script_Internationalization available [here](https://technet.microsoft.com/en-us/library/hh847854.aspx). -- create subfolder with your language/culture code under Public - e.g. xx-XX -- copy the file [Format-Pester.psd1](/Public/en-US/Format-Pester.psd1) from Public\en-US\ to your xx-XX - please don't translate module manifest - files have the same name! -- translate required strings -- test - please use Pester, to skip non-translation related tests please use the command -``` -Invoke-Pester -Path .\tests\ -Tag Translations -``` -you can also uncomment line in the Format-Pester.ps1 file (remember about re-import module with Force) -``` -#$LocalizedStrings -``` -- use the Language parameter if your PSCulture is different than required language for output -- submit your translation to public repo, pull request are welcomed - -# [Version history](VERSIONS.md) - -# License -Copyright 2016 Erwan Quelin and the community. -Licensed under the MIT License - -# TODO -- updated examples - align them to v. 1.3.0 and PScribo 0.7.12.47 -- update VERSIONS.md +[![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). + +## Example + +![](./img/format-pester.png) + +Screenshot from HTML report generated by Format-Pester v. 1.3.0, PScribo v. 0.7.11 + +More examples you can find [here](/examples/). + +## Supported languages +Since version 1.3.0 internationalization of generated reports is supported. + +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' + +# Requirements + +- 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) + +# Instructions +## Install the module +```powershell +# One time setup with Powershell 5 + Install-Module Format-Pester + +# Or Manually + # Download the repository + # Unblock the zip + # Extract the Format-Pester folder to a module path (e.g. $env:USERPROFILE\Documents\WindowsPowerShell\Modules\) + +# Import the module + Import-Module Format-Pester #Alternatively, Import-Module \\Path\To\Format-Pester + +# Get commands in the module + Get-Command -Module Format-Pester + +# Help for commands + Get-Help Format-Pester -Full +``` +## Online help +You can read [online version of help](/doc/Format-Pester.md) - online help generated by [platyPS module](https://github.com/powershell/platyps) + +# Usage + +```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). + +# Available functions + +- [Format-Pester](/doc/Format-Pester.md) + +# Contributors + +- Travis Plunk - [GitHub](https://github.com/TravisEz13) - [Twitter](https://twitter.com/TravisPlunk) +- Wojciech Sciesinski - [GitHub](https://github.com/it-praktyk) - [Twitter](https://twitter.com/ITpraktyk) + +# Author + +**Erwan Quélin** +- +- + +# Information for translators +Format-Pester can be used to prepare reports in languages different than English but a language file for your PSCulture/language need to be available. + +To translate required strings to your language please +- read general information about PowerShell support for internationalization + ``` + Get-Help about_Script_Internationalization + ``` + online version about_Script_Internationalization available [here](https://technet.microsoft.com/en-us/library/hh847854.aspx). +- create subfolder with your language/culture code under Public - e.g. xx-XX +- copy the file [Format-Pester.psd1](/Public/en-US/Format-Pester.psd1) from Public\en-US\ to your xx-XX - please don't translate module manifest - files have the same name! +- translate required strings +- test - please use Pester, to skip non-translation related tests please use the command +``` +Invoke-Pester -Path .\tests\ -Tag Translations +``` +you can also uncomment line in the Format-Pester.ps1 file (remember about re-import module with Force) +``` +#$LocalizedStrings +``` +- use the Language parameter if your PSCulture is different than required language for output +- submit your translation to public repo, pull requests are welcomed + +# [Version history](VERSIONS.md) + +# License +Copyright 2016 Erwan Quelin and the community. +Licensed under the MIT License + +# TODO +- updated examples - align them to v. 1.4.0 and PScribo 0.7.12.47 +- update VERSIONS.md +- automate preparing example files \ No newline at end of file diff --git a/VERSIONS.md b/VERSIONS.md index 735065d..afcfb8a 100644 --- a/VERSIONS.md +++ b/VERSIONS.md @@ -1,13 +1,25 @@ -#Format-Pester - history of versions - -- 1.3.0 - 2016-08-14 - - - -- 1.3.1 - 2016-08-14 - - added explicit Throw for null or empty PesterResult parameter - - verbose messages updated - - validateSet for the Format paarmeter added/uncommented - - names in code cleaned - -- 1.3.3 - 2016-08-20 - - Fix issue #14 \ No newline at end of file +#Format-Pester - history of versions + +## 1.0.0 - 2016-06-16 + +## 1.1.0 - 2016-07-04 + +## 1.2.0 - 2016-07-20 + +## 1.3.0 - 2016-08-14 + - + +## 1.3.1 - 2016-08-14 + - Fix: added explicit Throw for null or empty PesterResult parameter + - verbose messages updated + - validateSet for the Format parameter added/uncommented + - names in code cleaned + +## 1.3.3 - 2016-08-20 + - Fix issue #14 + +## 1.4.0 - 2016-09-04 + - Fix issue #12 + - Update + - help: descriptions of INPUTS, OUTPUTS added + - possibility to dump the PScribo Document object added \ No newline at end of file diff --git a/doc/Format-Pester.md b/doc/Format-Pester.md index 1252740..1dd5f41 100644 --- a/doc/Format-Pester.md +++ b/doc/Format-Pester.md @@ -1,315 +1,336 @@ ---- -external help file: Format-Pester-help.xml -online version: https://github.com/equelin/Format-Pester -schema: 2.0.0 ---- - -# Format-Pester -## SYNOPSIS -Document Pester's tests results into the selected format (HTML, Word, Text). - -## SYNTAX - -### AllParamSet (Default) -``` -Format-Pester [-PesterResult] -Format [-Path ] [-BaseFileName ] - [-Order ] [-GroupResultsBy ] [-SkipTableOfContent] [-SkipSummary] [-Language ] -``` - -### VersionOnlyParamSet -``` -Format-Pester [[-PesterResult] ] [-Format ] [-BaseFileName ] [-Version] -``` - -### SummaryOnlyParamSet -``` -Format-Pester [-PesterResult] -Format [-Path ] [-BaseFileName ] - [-SummaryOnly] [-SkipTableOfContent] [-Language ] -``` - -### FailedOnlyParamSet -``` -Format-Pester [-PesterResult] -Format [-Path ] [-BaseFileName ] - [-GroupResultsBy ] [-FailedOnly] [-SkipTableOfContent] [-SkipSummary] [-Language ] -``` - -### PassedOnlyParamSet -``` -Format-Pester [-PesterResult] -Format [-Path ] [-BaseFileName ] - [-GroupResultsBy ] [-PassedOnly] [-SkipTableOfContent] [-SkipSummary] [-Language ] -``` - -## DESCRIPTION -Create documents in formats: HTML, Word, Text using PScribo PowerShell module. -Documents are preformated to be human friendly. -Local Word installation is not needed to be installed on the computers were documents. - -Additional languages (other than en-US) can be used - please read info for translator on the project web page. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- -``` -Invoke-Pester -PassThru | Format-Pester -Path . -Format HTML,Word,Text -BaseFileName 'PesterResults' -``` - -This command will document the results of the Pester's tests. -Documents will be stored in the current path and they will be available in 3 formats (.html,.docx and .txt). - -## PARAMETERS - -### -PesterResult -Specifies the Pester results Object - -```yaml -Type: Array -Parameter Sets: AllParamSet, SummaryOnlyParamSet, FailedOnlyParamSet, PassedOnlyParamSet -Aliases: - -Required: True -Position: 1 -Default value: -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -```yaml -Type: Array -Parameter Sets: VersionOnlyParamSet -Aliases: - -Required: False -Position: 1 -Default value: -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -Format -Specifies the document format. -Might be: -- Text -- HTML -- Word - -```yaml -Type: String[] -Parameter Sets: AllParamSet, SummaryOnlyParamSet, FailedOnlyParamSet, PassedOnlyParamSet -Aliases: - -Required: True -Position: Named -Default value: -Accept pipeline input: False -Accept wildcard characters: False -``` - -```yaml -Type: String[] -Parameter Sets: VersionOnlyParamSet -Aliases: - -Required: False -Position: Named -Default value: -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Path -Specifies where the documents will be stored. -Default is the path where is executed this function. - -```yaml -Type: String -Parameter Sets: AllParamSet, SummaryOnlyParamSet, FailedOnlyParamSet, PassedOnlyParamSet -Aliases: - -Required: False -Position: Named -Default value: (Get-Location -PSProvider FileSystem) -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -BaseFileName -Specifies the document name. -Default is 'Pester_Results'. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: Pester_Results -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Order -Specify what results need to be evaluated first - passed or failed - means that will be included on the top of report. -By default failed tests are evaluated first. - -```yaml -Type: String -Parameter Sets: AllParamSet -Aliases: - -Required: False -Position: Named -Default value: FailedFirst -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -GroupResultsBy -Select how results should be groupped. -Available options: Result, Result-Describe, Result-Describe-Context. - -```yaml -Type: String -Parameter Sets: AllParamSet, FailedOnlyParamSet, PassedOnlyParamSet -Aliases: - -Required: False -Position: Named -Default value: Result -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -PassedOnly -Select to return information about passed tests only. - -```yaml -Type: SwitchParameter -Parameter Sets: PassedOnlyParamSet -Aliases: - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -FailedOnly -Select to return information about failed tests only. - -```yaml -Type: SwitchParameter -Parameter Sets: FailedOnlyParamSet -Aliases: - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -SummaryOnly -Select to return only summaries for tests only (sums of numbers passed/failed/etc. -tests). - -```yaml -Type: SwitchParameter -Parameter Sets: SummaryOnlyParamSet -Aliases: - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -SkipTableOfContent -Select to skip adding table of content at the begining of document(s). - -```yaml -Type: SwitchParameter -Parameter Sets: AllParamSet, SummaryOnlyParamSet, FailedOnlyParamSet, PassedOnlyParamSet -Aliases: - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -SkipSummary -Select to skip adding table with test summaries (sums of numbers passed/failed/etc. -tests). - -```yaml -Type: SwitchParameter -Parameter Sets: AllParamSet, FailedOnlyParamSet, PassedOnlyParamSet -Aliases: - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Language -Select language what need to be used for generated reports. -By default language is detected by Get-Culture with fallback to en-US if translation is not available. - -```yaml -Type: String -Parameter Sets: AllParamSet, SummaryOnlyParamSet, FailedOnlyParamSet, PassedOnlyParamSet -Aliases: - -Required: False -Position: Named -Default value: $($(Get-Culture).Name) -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Version -Use that parameter to display version of Format-Pester only. -This parameter can be used to verify translations. - -```yaml -Type: SwitchParameter -Parameter Sets: VersionOnlyParamSet -Aliases: - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -## INPUTS - -## OUTPUTS - -### System.IO.FileInfo - -## NOTES -Initial author: Erwan Quelin - -Credits/coauthors: -- Travis Plunk, github\[at\]ez13\[dot\]net -- Wojciech Sciesinski, wojciech\[at\]sciesinski\[dot\]net - -LICENSE -Licensed under the MIT License - https://github.com/equelin/Format-Pester/blob/master/LICENSE - -TODO -- Pester test need to be updated - yes, post factum TDD ;-) -- INPUTS, OUTPUTS need to be described - -## RELATED LINKS - -[https://github.com/equelin/Format-Pester](https://github.com/equelin/Format-Pester) - +--- +external help file: Format-Pester-help.xml +online version: https://github.com/equelin/Format-Pester +schema: 2.0.0 +--- + +# Format-Pester +## SYNOPSIS +Document Pester's tests results into the selected format (HTML, Word, Text). + +## SYNTAX + +### AllParamSet (Default) +``` +Format-Pester [-PesterResult] -Format [-Path ] [-BaseFileName ] + [-Order ] [-GroupResultsBy ] [-SkipTableOfContent] [-SkipSummary] [-Language ] + [-DumpPScriboObject] +``` + +### VersionOnlyParamSet +``` +Format-Pester [[-PesterResult] ] [-Format ] [-BaseFileName ] [-Version] +``` + +### SummaryOnlyParamSet +``` +Format-Pester [-PesterResult] -Format [-Path ] [-BaseFileName ] + [-SummaryOnly] [-SkipTableOfContent] [-Language ] [-DumpPScriboObject] +``` + +### FailedOnlyParamSet +``` +Format-Pester [-PesterResult] -Format [-Path ] [-BaseFileName ] + [-GroupResultsBy ] [-FailedOnly] [-SkipTableOfContent] [-SkipSummary] [-Language ] + [-DumpPScriboObject] +``` + +### PassedOnlyParamSet +``` +Format-Pester [-PesterResult] -Format [-Path ] [-BaseFileName ] + [-GroupResultsBy ] [-PassedOnly] [-SkipTableOfContent] [-SkipSummary] [-Language ] + [-DumpPScriboObject] +``` + +## DESCRIPTION +Create documents in formats: HTML, Word, Text using PScribo PowerShell module. +Documents are preformated to be human friendly. +Local Word installation is not needed to be installed on the computers were documents. + +Additional languages (other than en-US) can be used - please read info for translator on the project web page. + +## EXAMPLES + +### -------------------------- EXAMPLE 1 -------------------------- +``` +Invoke-Pester -PassThru | Format-Pester -Path . -Format HTML,Word,Text -BaseFileName 'PesterResults' +``` + +This command will document the results of the Pester's tests. +Documents will be stored in the current path and they will be available in 3 formats (.html,.docx and .txt). + +## PARAMETERS + +### -PesterResult +Specifies the Pester results Object + +```yaml +Type: Array +Parameter Sets: AllParamSet, SummaryOnlyParamSet, FailedOnlyParamSet, PassedOnlyParamSet +Aliases: + +Required: True +Position: 1 +Default value: +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +```yaml +Type: Array +Parameter Sets: VersionOnlyParamSet +Aliases: + +Required: False +Position: 1 +Default value: +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### -Format +Specifies the document format. +Might be: +- Text +- HTML +- Word + +```yaml +Type: String[] +Parameter Sets: AllParamSet, SummaryOnlyParamSet, FailedOnlyParamSet, PassedOnlyParamSet +Aliases: + +Required: True +Position: Named +Default value: +Accept pipeline input: False +Accept wildcard characters: False +``` + +```yaml +Type: String[] +Parameter Sets: VersionOnlyParamSet +Aliases: + +Required: False +Position: Named +Default value: +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Path +Specifies where the documents will be stored. +Default is the path where is executed this function. + +```yaml +Type: String +Parameter Sets: AllParamSet, SummaryOnlyParamSet, FailedOnlyParamSet, PassedOnlyParamSet +Aliases: + +Required: False +Position: Named +Default value: (Get-Location -PSProvider FileSystem) +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -BaseFileName +Specifies the document name. +Default is 'Pester_Results'. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: Pester_Results +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Order +Specify what results need to be evaluated first - passed or failed - means that will be included on the top of report. +By default failed tests are evaluated first. + +```yaml +Type: String +Parameter Sets: AllParamSet +Aliases: + +Required: False +Position: Named +Default value: FailedFirst +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -GroupResultsBy +Select how results should be groupped. +Available options: Result, Result-Describe, Result-Describe-Context. + +```yaml +Type: String +Parameter Sets: AllParamSet, FailedOnlyParamSet, PassedOnlyParamSet +Aliases: + +Required: False +Position: Named +Default value: Result +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassedOnly +Select to return information about passed tests only. + +```yaml +Type: SwitchParameter +Parameter Sets: PassedOnlyParamSet +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FailedOnly +Select to return information about failed tests only. + +```yaml +Type: SwitchParameter +Parameter Sets: FailedOnlyParamSet +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SummaryOnly +Select to return only summaries for tests only (sums of numbers passed/failed/etc. +tests). + +```yaml +Type: SwitchParameter +Parameter Sets: SummaryOnlyParamSet +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SkipTableOfContent +Select to skip adding table of content at the begining of document(s). + +```yaml +Type: SwitchParameter +Parameter Sets: AllParamSet, SummaryOnlyParamSet, FailedOnlyParamSet, PassedOnlyParamSet +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SkipSummary +Select to skip adding table with test summaries (sums of numbers passed/failed/etc. +tests). + +```yaml +Type: SwitchParameter +Parameter Sets: AllParamSet, FailedOnlyParamSet, PassedOnlyParamSet +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Language +Select language what need to be used for generated reports. +By default language is detected by Get-Culture with fallback to en-US if translation is not available. + +```yaml +Type: String +Parameter Sets: AllParamSet, SummaryOnlyParamSet, FailedOnlyParamSet, PassedOnlyParamSet +Aliases: + +Required: False +Position: Named +Default value: $($(Get-Culture).Name) +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Version +Use that parameter to display version of Format-Pester only. +This parameter can be used to verify translations. + +```yaml +Type: SwitchParameter +Parameter Sets: VersionOnlyParamSet +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DumpPScriboObject +When DumpPscriboObject is used the result of the function is custom object containing PScribo Document. +Use this parameter for prepare tests or debug of document generation. + +```yaml +Type: SwitchParameter +Parameter Sets: AllParamSet, SummaryOnlyParamSet, FailedOnlyParamSet, PassedOnlyParamSet +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +## INPUTS + +### An expected input is the result of the command Invoke-Pester with the parameter -PassThru. +With that command Invoke-Pester returns a custom object (PSCustomObject) that contains the test results. + +## OUTPUTS + +### Files what contain results of test. Files format and structure is based on values of parameters used. + +## NOTES +Initial author: Erwan Quelin + +Credits/coauthors: +- Travis Plunk, github\[at\]ez13\[dot\]net +- Wojciech Sciesinski, wojciech\[at\]sciesinski\[dot\]net + +LICENSE +Licensed under the MIT License - https://github.com/equelin/Format-Pester/blob/master/LICENSE + +TODO +- Pester test need to be updated - yes, post factum TDD ;-) + +## RELATED LINKS + +[https://github.com/equelin/Format-Pester](https://github.com/equelin/Format-Pester) + diff --git a/examples/1.4.0/README.md b/examples/1.4.0/README.md new file mode 100644 index 0000000..c16aecd --- /dev/null +++ b/examples/1.4.0/README.md @@ -0,0 +1,31 @@ +## Example files generated by +- Format-Pester v. 1.4.0 +- Pester v. 3.4.0 +- PScribo v. 0.7.12.47 + +## Known issues +- nothing :-) + +## en-US + +### 20160822a +```powershell +Invoke-Pester -Path .\demo\ -Quiet -PassThru | Format-Pester -Format word,html,text -Path .\examples\1.4.0\en-US\ -BaseFileName 20160904a -GroupResultsBy Result-Describe -Language en-us +``` + +### 20160823b +```powershell +Invoke-Pester -Path .\demo\ -Quiet -PassThru -Tag Static | format-pester -Format word,html,text -Path .\examples\1.4.0\en-US\ -BaseFileName 20160904b -GroupResultsBy Result-Describe-Context -Language en-us +``` + +## pl-PL + +### 20160822a +```powershell +Invoke-Pester -Path .\demo\ -Quiet -PassThru | Format-Pester -Format word,html,text -Path .\examples\1.4.0\pl-PL\ -BaseFileName 20160904a -GroupResultsBy Result-Describe -Language pl-PL +``` + +### 20160823b +```powershell +Invoke-Pester -Path .\demo\ -Quiet -PassThru -Tag Static | format-pester -Format word,html,text -Path .\examples\1.4.0\pl-PL\ -BaseFileName 20160904b -GroupResultsBy Result-Describe-Context -Language pl-PL +``` \ No newline at end of file diff --git a/examples/1.4.0/en-US/20160904a.docx b/examples/1.4.0/en-US/20160904a.docx new file mode 100644 index 0000000000000000000000000000000000000000..c9f56125b6de362d842551dbf3d53c30c4711a3a GIT binary patch literal 43841 zcmeHQTaVku6;{$VKpeD1&^-7dEeIkH0h-lyZ&ocE_Szd8iS31V(-x@PfFegLW+{>( zN7k;5pnd62=u=Q2NKq6)lm3AgXrJ@cKaiqt1(JvMC-j_|Aw^P@#EY~`X}N|Zlbo3| zbI$qBIdkJ2yz{MZU#Z~VRr`(mUw-lNS6`o0D)@P|@_J=tIa*D#)Zu`bw0b%)q))F_ z-u&b>mLd9e{U#=ON*q_W%#Pfs)@6y9s-@}XaYr7~-o~yhxl}PV#js4$kwZ5-ITEoT}wN|Uze!#z`_67$A{0P zQ5y5NgxPlG5LaXPYQ0ox(3<#yz2 z^#;g=H;U(tRHA2SdwnJw@xP-p8#J*?jzJAXMpj$)rJF8wj>suRJ!>|0!3}E-Dty+c!?P=cHso%aUir`R9pAU?iL(^vi z38v2k8m4RHUe=61O`8#PD8kvUu}2I8EZvyTXe&3Xo5)u#N$phe#3y(INp`p6llW|h zG)&i`WpGAKErD0juN1%Z)$46X*RZC?@VjRjTv^gz@KU|PC~v&uQ$ZLJW-u|KcVA^J zQh6%3kK$%(sDcr50$QjHsfCw4-2fB5xw+Ha17>oyRuLaz&hX?Mg;bP29pTLU-XT2& zz$wtq%7%)DA$(*}#gLAOOWhdkV!K3pR;pD8it7?>?V7c(=*Aj0>+nRk?KN!I0oX9~ zt8>uBj0b}kH!#@@NFDz6_dSp&un-7*FL~G|G&h%E3hMP;sG&!2e*HLvz4YMjB=aRmnC6&Df&qk^v~?d*r7hs+-Ms*rx*x`;Fev*39VU$cw4$dD0l%^fF#K_*~CNR|xZ^{@wO+TWH z(Lsg7K|BZPLSl4Y)LKX4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z17S3_6+VeaV5b~iBXE?MLmx7G%uyXwwKU}BwUn2efPP5D7Fq*QvR{W9(-yG*FTA)> zxx%daRr`(mUw-lNS6`o0D)@PI!q%e*L#8j9J-lx_n19QtR9N;gkE5Bx-anZ6txvto z0R~00hn-h2`{#eC1YKD)W7sAKGk))ng6W LT*Bv{;nn{E?uk~q literal 0 HcmV?d00001 diff --git a/examples/1.4.0/en-US/20160904a.html b/examples/1.4.0/en-US/20160904a.html new file mode 100644 index 0000000..5b3c859 --- /dev/null +++ b/examples/1.4.0/en-US/20160904a.html @@ -0,0 +1,91 @@ + + +20160904a + +
+

Table of Contents

+ + + + + + + + + + + +
1. Results summary
2. Failed tests
   2.1. Details for failed tests by Describe block: DemoFunction1 - Random
   2.2. Details for failed tests by Describe block: DemoFunction1 - Static
   2.3. Details for failed tests by Describe block: DemoFunction2 - Random
   2.4. Details for failed tests by Describe block: DemoFunction2 - Static
3. Passed tests
   3.1. Details for passed tests by Describe block: DemoFunction1 - Random
   3.2. Details for passed tests by Describe block: DemoFunction1 - Static
   3.3. Details for passed tests by Describe block: DemoFunction2 - Random
   3.4. Details for passed tests by Describe block: DemoFunction2 - Static
+

1. Results summary

+ +
Total TestsPassed TestsFailed TestsSkipped TestsPending Tests
24131100
+

2. Failed tests

2.1. Details for failed tests by Describe block: DemoFunction1 - Random

+ + + + + +
ContextNameFailure Message
Useless test R-1-1does something useful R-1-1-1Expected: {True} +But was: {0}
Useless test R-1-1does something useful R-1-1-2Expected {9} to be less than {7}
Useless test R-1-1does something useful R-1-1-3Expected {57} to be less than {24}
Useless test R-1-2does something useless R-1-2-1Expected: {30} +But was: {29}
Useless test R-1-2does something useless R-1-2-2Expected {2} to be greater than {30}
+

2.2. Details for failed tests by Describe block: DemoFunction1 - Static

+ + + +
ContextNameFailure Message
Useless test S-1-1does something useful S-1-1-1Expected {5} to be less than {3}
Useless test S-1-2does something useless S-1-2-1Expected: {5} +But was: {6}
Useless test S-1-2does something useful S-1-2-3Expected: value was {2}, but should not have been the same
+

2.3. Details for failed tests by Describe block: DemoFunction2 - Random

+ +
ContextNameFailure Message
Useless test R-2-2does something useless R-2-2-1Expected: {30} +But was: {28}
+

2.4. Details for failed tests by Describe block: DemoFunction2 - Static

+ + +
ContextNameFailure Message
Useless test S-2-1does something useful S-2-1-3Expected: value was {56}, but should not have been the same
Useless test S-2-2does something useless S-2-2-2Expected {2} to be greater than {3}
+

3. Passed tests

3.1. Details for passed tests by Describe block: DemoFunction1 - Random

+ +
DescribeContextName
DemoFunction1 - RandomUseless test R-1-2does something useful R-1-2-3
+

3.2. Details for passed tests by Describe block: DemoFunction1 - Static

+ + + +
DescribeContextName
DemoFunction1 - StaticUseless test S-1-1does something useful S-1-1-2
DemoFunction1 - StaticUseless test S-1-1does something useful S-1-1-3
DemoFunction1 - StaticUseless test S-1-2does something useless S-1-2-2
+

3.3. Details for passed tests by Describe block: DemoFunction2 - Random

+ + + + + +
DescribeContextName
DemoFunction2 - RandomUseless test R-2-1does something useful R-2-1-1
DemoFunction2 - RandomUseless test R-2-1does something useful R-2-2-2
DemoFunction2 - RandomUseless test R-2-1does something useful R-2-1-3
DemoFunction2 - RandomUseless test R-2-2does something useless R-2-2-2
DemoFunction2 - RandomUseless test R-2-2does something useful R-2-2-3
+

3.4. Details for passed tests by Describe block: DemoFunction2 - Static

+ + + + +
DescribeContextName
DemoFunction2 - StaticUseless test S-2-1does something useful S-2-1-1
DemoFunction2 - StaticUseless test S-2-1does something useful S-2-2-2
DemoFunction2 - StaticUseless test S-2-2does something useless S-2-2-1
DemoFunction2 - StaticUseless test S-2-2does something useful S-2-2-3
diff --git a/examples/1.4.0/en-US/20160904a.txt b/examples/1.4.0/en-US/20160904a.txt new file mode 100644 index 0000000..be8c51f --- /dev/null +++ b/examples/1.4.0/en-US/20160904a.txt @@ -0,0 +1,113 @@ +Table of Contents +------------------------------------------------------------------------------------------------------------------------ +1. Results summary +2. Failed tests + 2.1. Details for failed tests by Describe block: DemoFunction1 - Random + 2.2. Details for failed tests by Describe block: DemoFunction1 - Static + 2.3. Details for failed tests by Describe block: DemoFunction2 - Random + 2.4. Details for failed tests by Describe block: DemoFunction2 - Static +3. Passed tests + 3.1. Details for passed tests by Describe block: DemoFunction1 - Random + 3.2. Details for passed tests by Describe block: DemoFunction1 - Static + 3.3. Details for passed tests by Describe block: DemoFunction2 - Random + 3.4. Details for passed tests by Describe block: DemoFunction2 - Static + + +1. Results summary +------------------------------------------------------------------------------------------------------------------------ + +Total Tests Passed Tests Failed Tests Skipped Tests Pending Tests +----------- ------------ ------------ ------------- ------------- + 24 13 11 0 0 + + +2. Failed tests +------------------------------------------------------------------------------------------------------------------------ + +2.1. Details for failed tests by Describe block: DemoFunction1 - Random +------------------------------------------------------------------------------------------------------------------------ + +Context Name Failure Message +------- ---- --------------- +Useless test R-1-1 does something useful R-1-1-1 Expected: {True} + But was: {0} +Useless test R-1-1 does something useful R-1-1-2 Expected {9} to be less than {7} +Useless test R-1-1 does something useful R-1-1-3 Expected {57} to be less than {24} +Useless test R-1-2 does something useless R-1-2-1 Expected: {30} + But was: {29} +Useless test R-1-2 does something useless R-1-2-2 Expected {2} to be greater than {30} + + +2.2. Details for failed tests by Describe block: DemoFunction1 - Static +------------------------------------------------------------------------------------------------------------------------ + +Context Name Failure Message +------- ---- --------------- +Useless test S-1-1 does something useful S-1-1-1 Expected {5} to be less than {3} +Useless test S-1-2 does something useless S-1-2-1 Expected: {5} + But was: {6} +Useless test S-1-2 does something useful S-1-2-3 Expected: value was {2}, but should not have been the same + + +2.3. Details for failed tests by Describe block: DemoFunction2 - Random +------------------------------------------------------------------------------------------------------------------------ + +Context Name Failure Message +------- ---- --------------- +Useless test R-2-2 does something useless R-2-2-1 Expected: {30} + But was: {28} + + +2.4. Details for failed tests by Describe block: DemoFunction2 - Static +------------------------------------------------------------------------------------------------------------------------ + +Context Name Failure Message +------- ---- --------------- +Useless test S-2-1 does something useful S-2-1-3 Expected: value was {56}, but should not have been the same +Useless test S-2-2 does something useless S-2-2-2 Expected {2} to be greater than {3} + + +3. Passed tests +------------------------------------------------------------------------------------------------------------------------ + +3.1. Details for passed tests by Describe block: DemoFunction1 - Random +------------------------------------------------------------------------------------------------------------------------ + +Describe Context Name +-------- ------- ---- +DemoFunction1 - Random Useless test R-1-2 does something useful R-1-2-3 + + +3.2. Details for passed tests by Describe block: DemoFunction1 - Static +------------------------------------------------------------------------------------------------------------------------ + +Describe Context Name +-------- ------- ---- +DemoFunction1 - Static Useless test S-1-1 does something useful S-1-1-2 +DemoFunction1 - Static Useless test S-1-1 does something useful S-1-1-3 +DemoFunction1 - Static Useless test S-1-2 does something useless S-1-2-2 + + +3.3. Details for passed tests by Describe block: DemoFunction2 - Random +------------------------------------------------------------------------------------------------------------------------ + +Describe Context Name +-------- ------- ---- +DemoFunction2 - Random Useless test R-2-1 does something useful R-2-1-1 +DemoFunction2 - Random Useless test R-2-1 does something useful R-2-2-2 +DemoFunction2 - Random Useless test R-2-1 does something useful R-2-1-3 +DemoFunction2 - Random Useless test R-2-2 does something useless R-2-2-2 +DemoFunction2 - Random Useless test R-2-2 does something useful R-2-2-3 + + +3.4. Details for passed tests by Describe block: DemoFunction2 - Static +------------------------------------------------------------------------------------------------------------------------ + +Describe Context Name +-------- ------- ---- +DemoFunction2 - Static Useless test S-2-1 does something useful S-2-1-1 +DemoFunction2 - Static Useless test S-2-1 does something useful S-2-2-2 +DemoFunction2 - Static Useless test S-2-2 does something useless S-2-2-1 +DemoFunction2 - Static Useless test S-2-2 does something useful S-2-2-3 + + diff --git a/examples/1.4.0/en-US/20160904b.docx b/examples/1.4.0/en-US/20160904b.docx new file mode 100644 index 0000000000000000000000000000000000000000..4a4aa61d6e12528e8ed3d878474854b2a86275ed GIT binary patch literal 38924 zcmeHQO^n;d6;{$VKpYfB&>R9JEeIip0PX5;f4o*L8}`~88;R{jcGIS)+khfRE5;Pb za7LEbM$le*$)RXbw6_95ZbgCKa%zD#*P@4BdntPBp@;U?Yu}q0QY1B!NJ?5$GS`q~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EJ!ZC2ba~Jdm3aZcvk9_OLoVu+ z$t1$_bfTh2HoG-h!P+7nK5T697+x3>n!@?)63>I_$;ON0N@f6fVMVS6 zxJb`55$lj&X9KP%w6=p7<#b@M3abFW?ncd}`qF2UbtuPJEjUcD&5mq7EI%@$-HQ zkGe6llc3|j9SZp2hufhnM5XzAceHSS+ zdX`Ul0&6Y~6hBUU5*=kg031%KgSj9nut{^hD-!k147LSGHPeFmqSe*Ro-w?H$+T)@$g)$)rAGUb|kWMxP9HS{qn~?^3tNYEY!^_Ij2<>LV~eXzuvI zq~>nmwTv4bdM2c*?IGAi%XQ#XTMg7LaSYc4$#tqj*4x^zUcGYpU1IAD z?x20kqk`QNJ$60fKxI9C%8k}s|FrJu#shdZcD>bT?A3vqaUGzdqIGH~JfBj6hl&~n zBX7vlhl+|NtAjhL+KKL;64t45=GTLBi+CEbs^QT+|F$U{gnE>qP7T+ou9p&>91s`Bzf{utD3PmmtCq+p~iu}KS*8cXR=PMO_ zeH}#p1D>MEVISaFr9Yf^o;5wVczroRWx#<+;;=1rt|)*?o|MyWK7y|Wruj&hvIX=%1>VrD>@! z5JqEN5jJrT^ptOz1RkK_v%6d$3sgskT9)SK^;FcGqW#zqTPg*z=8%RuA1$E&pL>3* za)E1g&3of^>ys~D`~3Y%1z#^u=z0`kO!Xy;$IorY%74F7;l;;1P8N<^|7hX={VXUP zVNkMo+;~NckA7Z>nzCfUxK551{QECtyHhlDvZgrHqc#2YmlYN8kKX>u3wYZL@bAZ9 K5=OtqtN#P6-uuS@ literal 0 HcmV?d00001 diff --git a/examples/1.4.0/en-US/20160904b.html b/examples/1.4.0/en-US/20160904b.html new file mode 100644 index 0000000..0143fbf --- /dev/null +++ b/examples/1.4.0/en-US/20160904b.html @@ -0,0 +1,80 @@ + + +20160904b + +
+

Table of Contents

+ + + + + + + + + + + + + + + +
1. Results summary
2. Failed tests
   2.1. Details for failed tests by Describe block: DemoFunction1 - Static
      2.1.1. Details for failed tests by Context block: Useless test S-1-1
      2.1.2. Details for failed tests by Context block: Useless test S-1-2
   2.2. Details for failed tests by Describe block: DemoFunction2 - Static
      2.2.1. Details for failed tests by Context block: Useless test S-2-1
      2.2.2. Details for failed tests by Context block: Useless test S-2-2
3. Passed tests
   3.1. Details for passed tests by Describe block: DemoFunction1 - Static
      3.1.1. Details for passed tests by Context block: Useless test S-1-1
      3.1.2. Details for passed tests by Context block: Useless test S-1-2
   3.2. Details for passed tests by Describe block: DemoFunction2 - Static
      3.2.1. Details for passed tests by Context block: Useless test S-2-1
      3.2.2. Details for passed tests by Context block: Useless test S-2-2
+

1. Results summary

+ +
Total TestsPassed TestsFailed TestsSkipped TestsPending Tests
127500
+

2. Failed tests

2.1. Details for failed tests by Describe block: DemoFunction1 - Static

2.1.1. Details for failed tests by Context block: Useless test S-1-1

+ +
ContextNameFailure Message
Useless test S-1-1does something useful S-1-1-1Expected {5} to be less than {3}
+

2.1.2. Details for failed tests by Context block: Useless test S-1-2

+ + +
ContextNameFailure Message
Useless test S-1-2does something useless S-1-2-1Expected: {5} +But was: {6}
Useless test S-1-2does something useful S-1-2-3Expected: value was {2}, but should not have been the same
+

2.2. Details for failed tests by Describe block: DemoFunction2 - Static

2.2.1. Details for failed tests by Context block: Useless test S-2-1

+ +
ContextNameFailure Message
Useless test S-2-1does something useful S-2-1-3Expected: value was {56}, but should not have been the same
+

2.2.2. Details for failed tests by Context block: Useless test S-2-2

+ +
ContextNameFailure Message
Useless test S-2-2does something useless S-2-2-2Expected {2} to be greater than {3}
+

3. Passed tests

3.1. Details for passed tests by Describe block: DemoFunction1 - Static

3.1.1. Details for passed tests by Context block: Useless test S-1-1

+ + +
DescribeContextName
DemoFunction1 - StaticUseless test S-1-1does something useful S-1-1-2
DemoFunction1 - StaticUseless test S-1-1does something useful S-1-1-3
+

3.1.2. Details for passed tests by Context block: Useless test S-1-2

+ +
DescribeContextName
DemoFunction1 - StaticUseless test S-1-2does something useless S-1-2-2
+

3.2. Details for passed tests by Describe block: DemoFunction2 - Static

3.2.1. Details for passed tests by Context block: Useless test S-2-1

+ + +
DescribeContextName
DemoFunction2 - StaticUseless test S-2-1does something useful S-2-1-1
DemoFunction2 - StaticUseless test S-2-1does something useful S-2-2-2
+

3.2.2. Details for passed tests by Context block: Useless test S-2-2

+ + +
DescribeContextName
DemoFunction2 - StaticUseless test S-2-2does something useless S-2-2-1
DemoFunction2 - StaticUseless test S-2-2does something useful S-2-2-3
diff --git a/examples/1.4.0/en-US/20160904b.txt b/examples/1.4.0/en-US/20160904b.txt new file mode 100644 index 0000000..2fe308a --- /dev/null +++ b/examples/1.4.0/en-US/20160904b.txt @@ -0,0 +1,114 @@ +Table of Contents +------------------------------------------------------------------------------------------------------------------------ +1. Results summary +2. Failed tests + 2.1. Details for failed tests by Describe block: DemoFunction1 - Static + 2.1.1. Details for failed tests by Context block: Useless test S-1-1 + 2.1.2. Details for failed tests by Context block: Useless test S-1-2 + 2.2. Details for failed tests by Describe block: DemoFunction2 - Static + 2.2.1. Details for failed tests by Context block: Useless test S-2-1 + 2.2.2. Details for failed tests by Context block: Useless test S-2-2 +3. Passed tests + 3.1. Details for passed tests by Describe block: DemoFunction1 - Static + 3.1.1. Details for passed tests by Context block: Useless test S-1-1 + 3.1.2. Details for passed tests by Context block: Useless test S-1-2 + 3.2. Details for passed tests by Describe block: DemoFunction2 - Static + 3.2.1. Details for passed tests by Context block: Useless test S-2-1 + 3.2.2. Details for passed tests by Context block: Useless test S-2-2 + + +1. Results summary +------------------------------------------------------------------------------------------------------------------------ + +Total Tests Passed Tests Failed Tests Skipped Tests Pending Tests +----------- ------------ ------------ ------------- ------------- + 12 7 5 0 0 + + +2. Failed tests +------------------------------------------------------------------------------------------------------------------------ + +2.1. Details for failed tests by Describe block: DemoFunction1 - Static +------------------------------------------------------------------------------------------------------------------------ + +2.1.1. Details for failed tests by Context block: Useless test S-1-1 +------------------------------------------------------------------------------------------------------------------------ + +Context Name Failure Message +------- ---- --------------- +Useless test S-1-1 does something useful S-1-1-1 Expected {5} to be less than {3} + + +2.1.2. Details for failed tests by Context block: Useless test S-1-2 +------------------------------------------------------------------------------------------------------------------------ + +Context Name Failure Message +------- ---- --------------- +Useless test S-1-2 does something useless S-1-2-1 Expected: {5} + But was: {6} +Useless test S-1-2 does something useful S-1-2-3 Expected: value was {2}, but should not have been the same + + +2.2. Details for failed tests by Describe block: DemoFunction2 - Static +------------------------------------------------------------------------------------------------------------------------ + +2.2.1. Details for failed tests by Context block: Useless test S-2-1 +------------------------------------------------------------------------------------------------------------------------ + +Context Name Failure Message +------- ---- --------------- +Useless test S-2-1 does something useful S-2-1-3 Expected: value was {56}, but should not have been the same + + +2.2.2. Details for failed tests by Context block: Useless test S-2-2 +------------------------------------------------------------------------------------------------------------------------ + +Context Name Failure Message +------- ---- --------------- +Useless test S-2-2 does something useless S-2-2-2 Expected {2} to be greater than {3} + + +3. Passed tests +------------------------------------------------------------------------------------------------------------------------ + +3.1. Details for passed tests by Describe block: DemoFunction1 - Static +------------------------------------------------------------------------------------------------------------------------ + +3.1.1. Details for passed tests by Context block: Useless test S-1-1 +------------------------------------------------------------------------------------------------------------------------ + +Describe Context Name +-------- ------- ---- +DemoFunction1 - Static Useless test S-1-1 does something useful S-1-1-2 +DemoFunction1 - Static Useless test S-1-1 does something useful S-1-1-3 + + +3.1.2. Details for passed tests by Context block: Useless test S-1-2 +------------------------------------------------------------------------------------------------------------------------ + +Describe Context Name +-------- ------- ---- +DemoFunction1 - Static Useless test S-1-2 does something useless S-1-2-2 + + +3.2. Details for passed tests by Describe block: DemoFunction2 - Static +------------------------------------------------------------------------------------------------------------------------ + +3.2.1. Details for passed tests by Context block: Useless test S-2-1 +------------------------------------------------------------------------------------------------------------------------ + +Describe Context Name +-------- ------- ---- +DemoFunction2 - Static Useless test S-2-1 does something useful S-2-1-1 +DemoFunction2 - Static Useless test S-2-1 does something useful S-2-2-2 + + +3.2.2. Details for passed tests by Context block: Useless test S-2-2 +------------------------------------------------------------------------------------------------------------------------ + +Describe Context Name +-------- ------- ---- +DemoFunction2 - Static Useless test S-2-2 does something useless S-2-2-1 +DemoFunction2 - Static Useless test S-2-2 does something useful S-2-2-3 + + diff --git a/examples/1.4.0/pl-PL/20160904a.docx b/examples/1.4.0/pl-PL/20160904a.docx new file mode 100644 index 0000000000000000000000000000000000000000..85d4cb2106c50bc29ae6133afc852779afa74d92 GIT binary patch literal 43948 zcmeHQ&5zs06<5+WKpYfB&;ZFHEeIh90<^2o{jzG=u-8^>B(XQ%bz8J<1Bx6;j46^K zN0xUDqeX$-axIFYC=diKinc&6xupeKAjzet{sl#EJ@nB22kCn=LoP{?5=lwBl$JKM zyQDbtX5M?hdA}LX$Nn2%`tpSm{(IGW<<=)3eDU@@y;Q=_^QD(dW7Afvs;P{I#GsW& zLtXmlrP6C3zQ7WMe_XnP4?HBcqnSp#T(8v15-}80)r@|-Jfgjg-Lm9R*-&NOG)TLA zM4a-K%a_J2SAql?7)}d*w#x%btyZ-<9*-;IX2rDo)$hOcX0?9t;%?QDhs3dDg_K2t zvG=&649HM+DyBsY$fjr7Lz%)QB*(f~wy6-ufdUQnYNJ-$t`23*C}SDArh0_G9iq^E z8~?KU2glO51)10D7i+r}DE+uKfUE7@X0x)5SEj9jV%lZPw5cs?v@BJ5%C}@2zNV%H zk8f^*B2WOO=J4cNCp}2%ers#}fp-a+RQ)A!RLY8`ijsl8_GO#i>As7%#ntPwt`qwR zBt4Wte}{5cCz9Ed_Dq99AstaR@$@}Idv8RrxFE@&9}0HmI8?o1sQWgr6CC@=OCwRfOTkxm;lp)XPo19d8@L+K+E8PZGa9+AGZ`! zH=$OIt2?!8H$)a3tLf80>t@sR$-s{36M>&;D!G|8;dj#}1WyWSwyWKiI+W1hcI zRsc|&9BPL4*)Qq(*^Js_`Q6XnSEkgAwIU2;yrs$3lGNZ|r{khM zK~rH;S$7`~HV%!=B|xWE+l3Ok0%w&+z;u+u>mCNE$|*7Vo{)|XJg zUC`ieiUQuD0|JqU$Bv)^Yb#qk0T%ql>1BK{6alc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W$lwWn%E#hj#vV=?b>{}`)2vvW9!XEzj|2+54UxRk> z^RnyVT+RM0&!@^+>)?b{&F@Ai+OOvY8s5dmL^*uzkY{qSILTj>u*v`TH|ZZge!5h` z&)31^KV(O<81xu*0UxD7t1drs1#T*NesGyJv#j=OiDMGRh?N3=sBU&^V z2&0p>!V_@^+9_L8iL?)F`ZjBiIja4xmPXvHn(}-T$Pc*KLQ5cW_R3IY-U99aQ%`S{ zF0fYpRqK^opM3De+xPTR2|v$IwDoAhK+_ja9$dHWPyZog$daGvIGi{b{r!o5@sXR@ zr=W21VDR!MfAKdZe<%wl47SPsgh#&>a${QPa85y}`*YHNSBe7u{u^I;1|NF{{{I9* K!i#^vtN#NcAeb8f literal 0 HcmV?d00001 diff --git a/examples/1.4.0/pl-PL/20160904a.html b/examples/1.4.0/pl-PL/20160904a.html new file mode 100644 index 0000000..e7b0023 --- /dev/null +++ b/examples/1.4.0/pl-PL/20160904a.html @@ -0,0 +1,91 @@ + + +20160904a + +
+

Spis treści

+ + + + + + + + + + + +
1. Podsumowanie testów
2. Niezdane testy
   2.1. Szczegóły niezdanych testów dla bloku Describe: DemoFunction1 - Random
   2.2. Szczegóły niezdanych testów dla bloku Describe: DemoFunction1 - Static
   2.3. Szczegóły niezdanych testów dla bloku Describe: DemoFunction2 - Random
   2.4. Szczegóły niezdanych testów dla bloku Describe: DemoFunction2 - Static
3. Zdane testy
   3.1. Szczegóły zdanych testów dla bloku Describe: DemoFunction1 - Random
   3.2. Szczegóły zdanych testów dla bloku Describe: DemoFunction1 - Static
   3.3. Szczegóły zdanych testów dla bloku Describe: DemoFunction2 - Random
   3.4. Szczegóły zdanych testów dla bloku Describe: DemoFunction2 - Static
+

1. Podsumowanie testów

+ +
Testy ogółemTesty zdaneTesty niezdaneTesty pominięteTesty trwające
24131100
+

2. Niezdane testy

2.1. Szczegóły niezdanych testów dla bloku Describe: DemoFunction1 - Random

+ + + +
ContextNazwaKomunikat niezdanego testu
Useless test R-1-1does something useful R-1-1-1Expected: {True} +But was: {0}
Useless test R-1-2does something useless R-1-2-1Expected: {30} +But was: {27}
Useless test R-1-2does something useful R-1-2-3Expected {22} to be less than {19}
+

2.2. Szczegóły niezdanych testów dla bloku Describe: DemoFunction1 - Static

+ + + +
ContextNazwaKomunikat niezdanego testu
Useless test S-1-1does something useful S-1-1-1Expected {5} to be less than {3}
Useless test S-1-2does something useless S-1-2-1Expected: {5} +But was: {6}
Useless test S-1-2does something useful S-1-2-3Expected: value was {2}, but should not have been the same
+

2.3. Szczegóły niezdanych testów dla bloku Describe: DemoFunction2 - Random

+ + + +
ContextNazwaKomunikat niezdanego testu
Useless test R-2-1does something useful R-2-2-2Expected {7} to be less than {7}
Useless test R-2-2does something useless R-2-2-1Expected: {30} +But was: {27}
Useless test R-2-2does something useless R-2-2-2Expected {2} to be greater than {30}
+

2.4. Szczegóły niezdanych testów dla bloku Describe: DemoFunction2 - Static

+ + +
ContextNazwaKomunikat niezdanego testu
Useless test S-2-1does something useful S-2-1-3Expected: value was {56}, but should not have been the same
Useless test S-2-2does something useless S-2-2-2Expected {2} to be greater than {3}
+

3. Zdane testy

3.1. Szczegóły zdanych testów dla bloku Describe: DemoFunction1 - Random

+ + + +
DescribeContextNazwa
DemoFunction1 - RandomUseless test R-1-1does something useful R-1-1-2
DemoFunction1 - RandomUseless test R-1-1does something useful R-1-1-3
DemoFunction1 - RandomUseless test R-1-2does something useless R-1-2-2
+

3.2. Szczegóły zdanych testów dla bloku Describe: DemoFunction1 - Static

+ + + +
DescribeContextNazwa
DemoFunction1 - StaticUseless test S-1-1does something useful S-1-1-2
DemoFunction1 - StaticUseless test S-1-1does something useful S-1-1-3
DemoFunction1 - StaticUseless test S-1-2does something useless S-1-2-2
+

3.3. Szczegóły zdanych testów dla bloku Describe: DemoFunction2 - Random

+ + + +
DescribeContextNazwa
DemoFunction2 - RandomUseless test R-2-1does something useful R-2-1-1
DemoFunction2 - RandomUseless test R-2-1does something useful R-2-1-3
DemoFunction2 - RandomUseless test R-2-2does something useful R-2-2-3
+

3.4. Szczegóły zdanych testów dla bloku Describe: DemoFunction2 - Static

+ + + + +
DescribeContextNazwa
DemoFunction2 - StaticUseless test S-2-1does something useful S-2-1-1
DemoFunction2 - StaticUseless test S-2-1does something useful S-2-2-2
DemoFunction2 - StaticUseless test S-2-2does something useless S-2-2-1
DemoFunction2 - StaticUseless test S-2-2does something useful S-2-2-3
diff --git a/examples/1.4.0/pl-PL/20160904a.txt b/examples/1.4.0/pl-PL/20160904a.txt new file mode 100644 index 0000000..90b9cd4 --- /dev/null +++ b/examples/1.4.0/pl-PL/20160904a.txt @@ -0,0 +1,113 @@ +Spis treści +------------------------------------------------------------------------------------------------------------------------ +1. Podsumowanie testów +2. Niezdane testy + 2.1. Szczegóły niezdanych testów dla bloku Describe: DemoFunction1 - Random + 2.2. Szczegóły niezdanych testów dla bloku Describe: DemoFunction1 - Static + 2.3. Szczegóły niezdanych testów dla bloku Describe: DemoFunction2 - Random + 2.4. Szczegóły niezdanych testów dla bloku Describe: DemoFunction2 - Static +3. Zdane testy + 3.1. Szczegóły zdanych testów dla bloku Describe: DemoFunction1 - Random + 3.2. Szczegóły zdanych testów dla bloku Describe: DemoFunction1 - Static + 3.3. Szczegóły zdanych testów dla bloku Describe: DemoFunction2 - Random + 3.4. Szczegóły zdanych testów dla bloku Describe: DemoFunction2 - Static + + +1. Podsumowanie testów +------------------------------------------------------------------------------------------------------------------------ + +Testy ogółem Testy zdane Testy niezdane Testy pominięte Testy trwające +------------ ----------- -------------- --------------- -------------- + 24 13 11 0 0 + + +2. Niezdane testy +------------------------------------------------------------------------------------------------------------------------ + +2.1. Szczegóły niezdanych testów dla bloku Describe: DemoFunction1 - Random +------------------------------------------------------------------------------------------------------------------------ + +Context Nazwa Komunikat niezdanego testu +------- ----- -------------------------- +Useless test R-1-1 does something useful R-1-1-1 Expected: {True} + But was: {0} +Useless test R-1-2 does something useless R-1-2-1 Expected: {30} + But was: {27} +Useless test R-1-2 does something useful R-1-2-3 Expected {22} to be less than {19} + + +2.2. Szczegóły niezdanych testów dla bloku Describe: DemoFunction1 - Static +------------------------------------------------------------------------------------------------------------------------ + +Context Nazwa Komunikat niezdanego testu +------- ----- -------------------------- +Useless test S-1-1 does something useful S-1-1-1 Expected {5} to be less than {3} +Useless test S-1-2 does something useless S-1-2-1 Expected: {5} + But was: {6} +Useless test S-1-2 does something useful S-1-2-3 Expected: value was {2}, but should not have been the same + + +2.3. Szczegóły niezdanych testów dla bloku Describe: DemoFunction2 - Random +------------------------------------------------------------------------------------------------------------------------ + +Context Nazwa Komunikat niezdanego testu +------- ----- -------------------------- +Useless test R-2-1 does something useful R-2-2-2 Expected {7} to be less than {7} +Useless test R-2-2 does something useless R-2-2-1 Expected: {30} + But was: {27} +Useless test R-2-2 does something useless R-2-2-2 Expected {2} to be greater than {30} + + +2.4. Szczegóły niezdanych testów dla bloku Describe: DemoFunction2 - Static +------------------------------------------------------------------------------------------------------------------------ + +Context Nazwa Komunikat niezdanego testu +------- ----- -------------------------- +Useless test S-2-1 does something useful S-2-1-3 Expected: value was {56}, but should not have been the same +Useless test S-2-2 does something useless S-2-2-2 Expected {2} to be greater than {3} + + +3. Zdane testy +------------------------------------------------------------------------------------------------------------------------ + +3.1. Szczegóły zdanych testów dla bloku Describe: DemoFunction1 - Random +------------------------------------------------------------------------------------------------------------------------ + +Describe Context Nazwa +-------- ------- ----- +DemoFunction1 - Random Useless test R-1-1 does something useful R-1-1-2 +DemoFunction1 - Random Useless test R-1-1 does something useful R-1-1-3 +DemoFunction1 - Random Useless test R-1-2 does something useless R-1-2-2 + + +3.2. Szczegóły zdanych testów dla bloku Describe: DemoFunction1 - Static +------------------------------------------------------------------------------------------------------------------------ + +Describe Context Nazwa +-------- ------- ----- +DemoFunction1 - Static Useless test S-1-1 does something useful S-1-1-2 +DemoFunction1 - Static Useless test S-1-1 does something useful S-1-1-3 +DemoFunction1 - Static Useless test S-1-2 does something useless S-1-2-2 + + +3.3. Szczegóły zdanych testów dla bloku Describe: DemoFunction2 - Random +------------------------------------------------------------------------------------------------------------------------ + +Describe Context Nazwa +-------- ------- ----- +DemoFunction2 - Random Useless test R-2-1 does something useful R-2-1-1 +DemoFunction2 - Random Useless test R-2-1 does something useful R-2-1-3 +DemoFunction2 - Random Useless test R-2-2 does something useful R-2-2-3 + + +3.4. Szczegóły zdanych testów dla bloku Describe: DemoFunction2 - Static +------------------------------------------------------------------------------------------------------------------------ + +Describe Context Nazwa +-------- ------- ----- +DemoFunction2 - Static Useless test S-2-1 does something useful S-2-1-1 +DemoFunction2 - Static Useless test S-2-1 does something useful S-2-2-2 +DemoFunction2 - Static Useless test S-2-2 does something useless S-2-2-1 +DemoFunction2 - Static Useless test S-2-2 does something useful S-2-2-3 + + diff --git a/examples/1.4.0/pl-PL/20160904b.docx b/examples/1.4.0/pl-PL/20160904b.docx new file mode 100644 index 0000000000000000000000000000000000000000..0b0e3cc80ee40f94183e18b9c6110a18936299c7 GIT binary patch literal 39053 zcmeHQ&5zs06<5+WKpYfB&>V6|3qlBj0O{&$KfG2g8}`~88;R{jcHK6q+khfRE5;Pb zkRxk%ji4Vu&Mk^IK+zNkaw`h-l4A?BK$1&O{R@iTdg!4&=8!|*n;B9hHPn)nw5DX* zkhGLIU+=x&dvD&%Jnp^rm9L(w;J;U#7jJ&~;Y%NEy;-T?>)FZ+m67f0b=}s617gwI z(ZEzbe!lYZN6)bW@wbbY@rDP)^$gqURGYO%RUwvU>xOmMsSasxZM&*?RJC-~v@O!9 z9uu#6`O?Kv+iyXE3M{V;@11I&Qm0+7k4B@~XuW2;hxH%adcEGfaACV{sRQCUsz$1! zz$m!g)B0qfdNtc27F5%--GNHs5{lzk9M{%}=Rt=CX1&#DY}E&Hq2)hyCCZDyfHi;^~xiO&2`_dhMw$z0-XMzZO@os-{WY zV`%At3iLZryCzZWp0ZWs=5snhqAWUsa|L_fhBxAylkxfo~iHj8C%3(2geQwVV4|&1c-vHqwLMF zJn9~hBZ?x{X3_?1c8N#a2c&vQ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-t=vzk2$KtqL!t((?-hcP0@Zt#OB%qQFG9TI+GUA|4%%*RyoJC`YX(><-@b_N(+EaMjQ}F*MU=qIg0I&WJ D$!<{_ literal 0 HcmV?d00001 diff --git a/examples/1.4.0/pl-PL/20160904b.html b/examples/1.4.0/pl-PL/20160904b.html new file mode 100644 index 0000000..dbea587 --- /dev/null +++ b/examples/1.4.0/pl-PL/20160904b.html @@ -0,0 +1,80 @@ + + +20160904b + +
+

Spis treści

+ + + + + + + + + + + + + + + +
1. Podsumowanie testów
2. Niezdane testy
   2.1. Szczegóły niezdanych testów dla bloku Describe: DemoFunction1 - Static
      2.1.1. Szczegóły niezdanych testów dla bloku Context: Useless test S-1-1
      2.1.2. Szczegóły niezdanych testów dla bloku Context: Useless test S-1-2
   2.2. Szczegóły niezdanych testów dla bloku Describe: DemoFunction2 - Static
      2.2.1. Szczegóły niezdanych testów dla bloku Context: Useless test S-2-1
      2.2.2. Szczegóły niezdanych testów dla bloku Context: Useless test S-2-2
3. Zdane testy
   3.1. Szczegóły zdanych testów dla bloku Describe: DemoFunction1 - Static
      3.1.1. Szczegóły zdanych testów dla bloku Context: Useless test S-1-1
      3.1.2. Szczegóły zdanych testów dla bloku Context: Useless test S-1-2
   3.2. Szczegóły zdanych testów dla bloku Describe: DemoFunction2 - Static
      3.2.1. Szczegóły zdanych testów dla bloku Context: Useless test S-2-1
      3.2.2. Szczegóły zdanych testów dla bloku Context: Useless test S-2-2
+

1. Podsumowanie testów

+ +
Testy ogółemTesty zdaneTesty niezdaneTesty pominięteTesty trwające
127500
+

2. Niezdane testy

2.1. Szczegóły niezdanych testów dla bloku Describe: DemoFunction1 - Static

2.1.1. Szczegóły niezdanych testów dla bloku Context: Useless test S-1-1

+ +
ContextNazwaKomunikat niezdanego testu
Useless test S-1-1does something useful S-1-1-1Expected {5} to be less than {3}
+

2.1.2. Szczegóły niezdanych testów dla bloku Context: Useless test S-1-2

+ + +
ContextNazwaKomunikat niezdanego testu
Useless test S-1-2does something useless S-1-2-1Expected: {5} +But was: {6}
Useless test S-1-2does something useful S-1-2-3Expected: value was {2}, but should not have been the same
+

2.2. Szczegóły niezdanych testów dla bloku Describe: DemoFunction2 - Static

2.2.1. Szczegóły niezdanych testów dla bloku Context: Useless test S-2-1

+ +
ContextNazwaKomunikat niezdanego testu
Useless test S-2-1does something useful S-2-1-3Expected: value was {56}, but should not have been the same
+

2.2.2. Szczegóły niezdanych testów dla bloku Context: Useless test S-2-2

+ +
ContextNazwaKomunikat niezdanego testu
Useless test S-2-2does something useless S-2-2-2Expected {2} to be greater than {3}
+

3. Zdane testy

3.1. Szczegóły zdanych testów dla bloku Describe: DemoFunction1 - Static

3.1.1. Szczegóły zdanych testów dla bloku Context: Useless test S-1-1

+ + +
DescribeContextNazwa
DemoFunction1 - StaticUseless test S-1-1does something useful S-1-1-2
DemoFunction1 - StaticUseless test S-1-1does something useful S-1-1-3
+

3.1.2. Szczegóły zdanych testów dla bloku Context: Useless test S-1-2

+ +
DescribeContextNazwa
DemoFunction1 - StaticUseless test S-1-2does something useless S-1-2-2
+

3.2. Szczegóły zdanych testów dla bloku Describe: DemoFunction2 - Static

3.2.1. Szczegóły zdanych testów dla bloku Context: Useless test S-2-1

+ + +
DescribeContextNazwa
DemoFunction2 - StaticUseless test S-2-1does something useful S-2-1-1
DemoFunction2 - StaticUseless test S-2-1does something useful S-2-2-2
+

3.2.2. Szczegóły zdanych testów dla bloku Context: Useless test S-2-2

+ + +
DescribeContextNazwa
DemoFunction2 - StaticUseless test S-2-2does something useless S-2-2-1
DemoFunction2 - StaticUseless test S-2-2does something useful S-2-2-3
diff --git a/examples/1.4.0/pl-PL/20160904b.txt b/examples/1.4.0/pl-PL/20160904b.txt new file mode 100644 index 0000000..6315363 --- /dev/null +++ b/examples/1.4.0/pl-PL/20160904b.txt @@ -0,0 +1,114 @@ +Spis treści +------------------------------------------------------------------------------------------------------------------------ +1. Podsumowanie testów +2. Niezdane testy + 2.1. Szczegóły niezdanych testów dla bloku Describe: DemoFunction1 - Static + 2.1.1. Szczegóły niezdanych testów dla bloku Context: Useless test S-1-1 + 2.1.2. Szczegóły niezdanych testów dla bloku Context: Useless test S-1-2 + 2.2. Szczegóły niezdanych testów dla bloku Describe: DemoFunction2 - Static + 2.2.1. Szczegóły niezdanych testów dla bloku Context: Useless test S-2-1 + 2.2.2. Szczegóły niezdanych testów dla bloku Context: Useless test S-2-2 +3. Zdane testy + 3.1. Szczegóły zdanych testów dla bloku Describe: DemoFunction1 - Static + 3.1.1. Szczegóły zdanych testów dla bloku Context: Useless test S-1-1 + 3.1.2. Szczegóły zdanych testów dla bloku Context: Useless test S-1-2 + 3.2. Szczegóły zdanych testów dla bloku Describe: DemoFunction2 - Static + 3.2.1. Szczegóły zdanych testów dla bloku Context: Useless test S-2-1 + 3.2.2. Szczegóły zdanych testów dla bloku Context: Useless test S-2-2 + + +1. Podsumowanie testów +------------------------------------------------------------------------------------------------------------------------ + +Testy ogółem Testy zdane Testy niezdane Testy pominięte Testy trwające +------------ ----------- -------------- --------------- -------------- + 12 7 5 0 0 + + +2. Niezdane testy +------------------------------------------------------------------------------------------------------------------------ + +2.1. Szczegóły niezdanych testów dla bloku Describe: DemoFunction1 - Static +------------------------------------------------------------------------------------------------------------------------ + +2.1.1. Szczegóły niezdanych testów dla bloku Context: Useless test S-1-1 +------------------------------------------------------------------------------------------------------------------------ + +Context Nazwa Komunikat niezdanego testu +------- ----- -------------------------- +Useless test S-1-1 does something useful S-1-1-1 Expected {5} to be less than {3} + + +2.1.2. Szczegóły niezdanych testów dla bloku Context: Useless test S-1-2 +------------------------------------------------------------------------------------------------------------------------ + +Context Nazwa Komunikat niezdanego testu +------- ----- -------------------------- +Useless test S-1-2 does something useless S-1-2-1 Expected: {5} + But was: {6} +Useless test S-1-2 does something useful S-1-2-3 Expected: value was {2}, but should not have been the same + + +2.2. Szczegóły niezdanych testów dla bloku Describe: DemoFunction2 - Static +------------------------------------------------------------------------------------------------------------------------ + +2.2.1. Szczegóły niezdanych testów dla bloku Context: Useless test S-2-1 +------------------------------------------------------------------------------------------------------------------------ + +Context Nazwa Komunikat niezdanego testu +------- ----- -------------------------- +Useless test S-2-1 does something useful S-2-1-3 Expected: value was {56}, but should not have been the same + + +2.2.2. Szczegóły niezdanych testów dla bloku Context: Useless test S-2-2 +------------------------------------------------------------------------------------------------------------------------ + +Context Nazwa Komunikat niezdanego testu +------- ----- -------------------------- +Useless test S-2-2 does something useless S-2-2-2 Expected {2} to be greater than {3} + + +3. Zdane testy +------------------------------------------------------------------------------------------------------------------------ + +3.1. Szczegóły zdanych testów dla bloku Describe: DemoFunction1 - Static +------------------------------------------------------------------------------------------------------------------------ + +3.1.1. Szczegóły zdanych testów dla bloku Context: Useless test S-1-1 +------------------------------------------------------------------------------------------------------------------------ + +Describe Context Nazwa +-------- ------- ----- +DemoFunction1 - Static Useless test S-1-1 does something useful S-1-1-2 +DemoFunction1 - Static Useless test S-1-1 does something useful S-1-1-3 + + +3.1.2. Szczegóły zdanych testów dla bloku Context: Useless test S-1-2 +------------------------------------------------------------------------------------------------------------------------ + +Describe Context Nazwa +-------- ------- ----- +DemoFunction1 - Static Useless test S-1-2 does something useless S-1-2-2 + + +3.2. Szczegóły zdanych testów dla bloku Describe: DemoFunction2 - Static +------------------------------------------------------------------------------------------------------------------------ + +3.2.1. Szczegóły zdanych testów dla bloku Context: Useless test S-2-1 +------------------------------------------------------------------------------------------------------------------------ + +Describe Context Nazwa +-------- ------- ----- +DemoFunction2 - Static Useless test S-2-1 does something useful S-2-1-1 +DemoFunction2 - Static Useless test S-2-1 does something useful S-2-2-2 + + +3.2.2. Szczegóły zdanych testów dla bloku Context: Useless test S-2-2 +------------------------------------------------------------------------------------------------------------------------ + +Describe Context Nazwa +-------- ------- ----- +DemoFunction2 - Static Useless test S-2-2 does something useless S-2-2-1 +DemoFunction2 - Static Useless test S-2-2 does something useful S-2-2-3 + + diff --git a/tests/Format-Pester-translations.tests.ps1 b/tests/Format-Pester-translations.tests.ps1 index 67a4e11..0a240cc 100644 --- a/tests/Format-Pester-translations.tests.ps1 +++ b/tests/Format-Pester-translations.tests.ps1 @@ -1,288 +1,289 @@ -<# - .SYNOPSIS - Pester tests to validate translations of PowerShell psd1 files. - - .DESCRIPTION - Pester test to validate completeness, versions and equality of used fields between main language (en-US) and other languages stored in language related subfolders. - - General information about PowerShell support for internationalization, please read Get-Help about_Script_Internationalization. - - The tests created initially for the Format-Pester project - https://github.com/equelin/format-pester - internationalization supported since v. 1.3.0. - - .LINK - https://github.com/equelin/Format-Pester - - .NOTES - AUTHOR: Wojciech Sciesinski, wojciech[at]sciesinski[dot]net - KEYWORDS: PowerShell, Translation, Pester, psd1 - - VERSIONS HISTORY - 0.1.0 - 2016-07-30 - The first version - 0.2.0 - 2016-08-02 - Checking if null/empty strings are used, messages for failed tests improved - 0.3.0 - 2016-08-09 - Names of variables used in code generalized, base names located at the begining of code - - TODO - - improve performance for testing in context "Check translation for $SubfolderInPublicName - detailed fields name comparison" - based on the previously calculated difference - - add support for multi functions modules - - LICENSE - Copyright (c) 2016 Wojciech Sciesinski - This function is licensed under The MIT License (MIT) - Full license text: https://opensource.org/licenses/MIT - -#> - - -$ModuleName = 'Format-Pester' - -$BaseTranslationFileName = 'Format-Pester.psd1' - -New-Variable -Scope Global -Name GlobalModuleName -Value $ModuleName -Force - -New-Variable -Scope Global -Name GlobalBaseTranslationFileName -Value $BaseTranslationFileName -Force - -[scriptblock]$ModuleVersionReturned = { Format-Pester -Version } - -Describe -Name "Unit tests for $GlobalModuleName translations" -Tag 'Translations' { - - BeforeAll { - - Remove-Module -Name $GlobalModuleName -ErrorAction SilentlyContinue - - Import-Module "$PSScriptRoot\..\$GlobalModuleName" -Force -Scope Global -ErrorAction Stop - - } - - AfterAll { - - #Remove previously defined variables scoped as global - - $VariablesToRemove = @('GlobalModuleName', 'GlobalBaseTranslationFileName', 'enUSLocalizedStrings1', 'enUSLocalizedStrings2', 'GlobalenUSLocalizedStrings', 'GlobalenUSLocalizedStringCount', 'GlobalenUSLocalizedStringKeys', ` - 'SkipDueEnUSNotImported', 'GlobalCurrentLanguageLocalizedStringCount', 'GlobalCurrentLanguageLocalizedStringKeys', 'DifferencesInKeys', 'KeysNotEqual') - - ForEach ($VariableToRemove in $VariablesToRemove) { - - Remove-Variable -Scope Global -Name $VariableToRemove -Force -ErrorAction SilentlyContinue - - } - - } - - $Module = $(Get-Module -Name $GlobalModuleName) - - $ModuleVersion = $([Version]$Module.Version).ToString() - - $ModulePath = $([System.IO.FileInfo]$Module.Path).DirectoryName - - Context "Compare versions numbers included in module of $GlobalModuleName module and function" { - - It 'Compare versions numbers between module and function' { - - $ModuleVersion | Should be $(& $ModuleVersionReturned) - - } - - } - - Context 'Check the subfolder en-US - main language' { - - - - $enUSfolderInPublic = Get-Item -Path "$ModulePath\Public\en-US" -ErrorAction SilentlyContinue - - It 'Check if the en-US folder exist' { - { Test-Path -Path $enUSfolderInPublic -PathType Container } | Should be $true - - } - - It "Check if the subfolder en-US contains $GlobalBaseTranslationFileName file " { - { Test-Path -Path "$enUSfolderInPublic\$GlobalBaseTranslationFileName" -PathType Leaf } | Should be $true - - } - - It "Check if $BaseTranslationFileName from en-US folder can be imported" { - { Import-LocalizedData -BaseDirectory $("$ModulePath\Public") -FileName $GlobalBaseTranslationFileName -BindingVariable enUSLocalizedStrings1 -UICulture 'en-US' -ErrorAction SilentlyContinue } | Should Not Throw - - Import-LocalizedData -BaseDirectory $("$ModulePath\Public") -FileName $GlobalBaseTranslationFileName -BindingVariable enUSLocalizedStrings2 -UICulture 'en-US' - - New-Variable -Scope Global -Name GlobalenUSLocalizedStrings -Value $enUSLocalizedStrings2 - - New-Variable -Scope Global -Name GlobalenUSLocalizedStringCount -Value $enUSLocalizedStrings2.Count -Force - - New-Variable -Scope Global -Name GlobalenUSLocalizedStringKeys -Value $enUSLocalizedStrings2.Keys -Force - - $GlobalenUSLocalizedStrings = $GlobalenUSLocalizedStrings.GetEnumerator() | Sort-Object -Property Name - - $GlobalenUSLocalizedStringKeys = $GlobalenUSLocalizedStringKeys | Sort-Object - - } - - It "Check if data from the file $BaseTranslationFileName for en-US was correctly assigned to variable." { - - $GlobalenUSLocalizedStringCount | Should BeGreaterThan 0 - - } - - It "Compare version of en-US translation with version of module" { - - $GlobalenUSLocalizedStrings.msg00 | Should be $ModuleVersion - - } - - #Enumerate hashtable and check if keys has assigned values (translations strings are fullfilled) - $GlobalenUSLocalizedStrings.GetEnumerator() | ForEach-Object -Process { - - $CurrentenUSLocalizedStringValue = $_ - - If ([String]::IsNullOrEmpty($CurrentenUSLocalizedStringValue.Value)) { - - It "Check if value for $($_.Key) for en-US is not null or empty." { - - $CurrentenUSLocalizedStringValue.Value | Should Not BeNullOrEmpty - - } - - } - - } - - } - - $SubfoldersInPublic = Get-ChildItem -Path "$ModulePath\Public\" -Directory - - ForEach ($SubfolerInPublic in $SubfoldersInPublic) { - - $SubfolderInPublicName = $SubfolerInPublic.Name - - If ($SubfolderInPublicName -ne 'en-US') { - - Context "Check translations for subfolder $SubfolderInPublicName" { - - $SubfolderInPublicNamePath = $SubfolderInPublic.FullName - - It "Check subfolder name format for the folder $SubfolderInPublicName" { - - $SubfolderInPublicName.Substring(2, 1) | Should be '-' - - } - - It "Check if the subfolder $SubfolderInPublicName contains $BaseTranslationFileName file " { - { Test-Path -Path "$SubfolderInPublicNamePath\Format-Pester.ps1" -PathType Leaf } | Should be $true - - } - - It "Check if $GlobalBaseTranslationFileName from $SubfolderInPublicName folder can be imported and contains data" { - { Import-LocalizedData -BaseDirectory $("$ModulePath\Public") -FileName $GlobalBaseTranslationFileName -BindingVariable CurrentLanguageLocalizedStrings1 -UICulture $SubfolderInPublicName -ErrorAction SilentlyContinue } | Should Not Throw - - Import-LocalizedData -BaseDirectory $("$ModulePath\Public") -FileName $GlobalBaseTranslationFileName -BindingVariable CurrentLanguageLocalizedStrings2 -UICulture $SubfolderInPublicName -ErrorAction SilentlyContinue - - New-Variable -Scope Global -Name GlobalCurrentLanguageLocalizedStrings -Value $CurrentLanguageLocalizedStrings2 -Force - - New-Variable -Scope Global -Name GlobalCurrentLanguageLocalizedStringCount -Value $CurrentLanguageLocalizedStrings2.Count -Force - - New-Variable -Scope Global -Name GlobalCurrentLanguageLocalizedStringKeys -Value $CurrentLanguageLocalizedStrings2.Keys -Force - - $GlobalCurrentLanguageLocalizedStrings = $GlobalCurrentLanguageLocalizedStrings.GetEnumerator() | Sort-Object -Property Name - - $GlobalCurrentLanguageLocalizedStringKeys = $GlobalCurrentLanguageLocalizedStringKeys | Sort-Object - - } - - It "Check if data from the file $BaseTranslationFileName for $SubfolderInPublicName was correctly assigned to variable." { - - $GlobalCurrentLanguageLocalizedStringCount | Should BeGreaterThan 0 - - } - - It "Compare version of $SubfolderInPublicName translation with version of module" { - - $GlobalCurrentLanguageLocalizedStrings.msg00 | Should be $ModuleVersion - - } - - It "Compare amount of strings for en-US and $SubfolderInPublicName" { - - $GlobalenUSLocalizedStringCount | Should be $GlobalCurrentLanguageLocalizedStringCount - - } - - #Enumerate hashtable and check if keys has assigned values (translations strings are fullfilled) - $GlobalCurrentLanguageLocalizedStrings.GetEnumerator() | ForEach-Object -Process { - - $CurrentCurrentLanguageLocalizedStringValue = $_ - - If ([String]::IsNullOrEmpty($CurrentCurrentLanguageLocalizedStringValue.Value)) { - - It "Check if value for $($_.Key) for en-US is not null or empty." { - - $CurrentCurrentLanguageLocalizedStringValue.Value | Should Not BeNullOrEmpty - - } - - } - - } - - It "Compare if names of localization keys for en-US and $SubfolderInPublicName are equal" { - - $DifferencesInKeys = Compare-Object -ReferenceObject $GlobalenUSLocalizedStringKeys -DifferenceObject $GlobalCurrentLanguageLocalizedStringKeys - - If ($DifferencesInKeys) { - - New-Variable -Name KeysNotEqual -Value $true -Scope Global -Force - - #New-Variable -Name GlobalDifferencesInKeys -Value $DifferencesInKeys -Scope Global -Force - - } - - $KeysNotEqual | Should BeNullOrEmpty - - } - - } - - If ($KeysNotEqual) { - - Context "Check translation for $SubfolderInPublicName - detailed fields name comparison" { - - ForEach ($CurrentenUSLocalizedKey in $GlobalenUSLocalizedStringKeys) { - - if ($GlobalCurrentLanguageLocalizedStringKeys -notcontains $CurrentenUSLocalizedKey) { - - It "The language file $SubfolderInPublicName not contains $CurrentenUSLocalizedKey" { - - $CurrentLanguageContainResult = ($GlobalCurrentLanguageLocalizedStringKeys -contains $CurrentenUSLocalizedKey) - - $CurrentLanguageContainResult | Should be $true - - } - - } - - } - - ForEach ($CurrentenLanguageLocalizedKey in $GlobalCurrentLanguageLocalizedStringKeys) { - - if ($GlobalenUSLocalizedStringKeys -notcontains $CurrentenLanguageLocalizedKey) { - - It "The language file en-US does not contain $CurrentenLanguageLocalizedKey available in $SubfolderInPublicName" { - - $EnUSLanguageContainResult = ($GlobalenUSLocalizedStringKeys -contains $CurrentenLanguageLocalizedKey) - - $EnUSLanguageContainResult | Should be $true - - } - - } - - } - - } - - } - - } - - } - +<# + .SYNOPSIS + Pester tests to validate translations of PowerShell psd1 files. + + .DESCRIPTION + Pester test to validate completeness, versions and equality of used fields between main language (en-US) and other languages stored in language related subfolders. + + General information about PowerShell support for internationalization, please read Get-Help about_Script_Internationalization. + + The tests created initially for the Format-Pester project - https://github.com/equelin/format-pester - internationalization supported since v. 1.3.0. + + .LINK + https://github.com/equelin/Format-Pester + + .NOTES + AUTHOR: Wojciech Sciesinski, wojciech[at]sciesinski[dot]net + KEYWORDS: PowerShell, Translation, Pester, psd1 + + VERSIONS HISTORY + 0.1.0 - 2016-07-30 - The first version + 0.2.0 - 2016-08-02 - Checking if null/empty strings are used, messages for failed tests improved + 0.3.0 - 2016-08-09 - Names of variables used in code generalized, base names located at the begining of code + 0.3.1 - 2016-09-04 - Some tests corrected + + TODO + - improve performance for testing in context "Check translation for $SubfolderInPublicName - detailed fields name comparison" - based on the previously calculated difference + - add support for multi functions modules + + REMARKS + - Tests for check encoding used for translation files based on the 4 bytes of data (BOM) are the waste of time - due that some editors don't set this bytes e.g. Notepad++ + + LICENSE + Copyright (c) 2016 Wojciech Sciesinski + This function is licensed under The MIT License (MIT) + Full license text: https://opensource.org/licenses/MIT + +#> + +$ModuleName = 'Format-Pester' + +$BaseTranslationFileName = 'Format-Pester.psd1' + +New-Variable -Scope Global -Name GlobalModuleName -Value $ModuleName -Force + +New-Variable -Scope Global -Name GlobalBaseTranslationFileName -Value $BaseTranslationFileName -Force + +[scriptblock]$ModuleVersionReturned = { Format-Pester -Version } + +Describe -Name "Unit tests for $GlobalModuleName translations" -Tag 'Translations' { + + BeforeAll { + + Remove-Module -Name $GlobalModuleName -ErrorAction SilentlyContinue + + Import-Module "$PSScriptRoot\..\$GlobalModuleName" -Force -Scope Global -ErrorAction Stop + + } + + AfterAll { + + #Remove previously defined variables scoped as global + + $VariablesToRemove = @('GlobalModuleName', 'GlobalBaseTranslationFileName', 'enUSLocalizedStrings1', 'enUSLocalizedStrings2', 'GlobalenUSLocalizedStrings', 'GlobalenUSLocalizedStringCount', 'GlobalenUSLocalizedStringKeys', ` + 'SkipDueEnUSNotImported', 'GlobalCurrentLanguageLocalizedStringCount', 'GlobalCurrentLanguageLocalizedStringKeys', 'DifferencesInKeys', 'KeysNotEqual') + + ForEach ($VariableToRemove in $VariablesToRemove) { + + Remove-Variable -Scope Global -Name $VariableToRemove -Force -ErrorAction SilentlyContinue + + } + + } + + $Module = $(Get-Module -Name $GlobalModuleName) + + $ModuleVersion = $([Version]$Module.Version).ToString() + + $ModulePath = $([System.IO.FileInfo]$Module.Path).DirectoryName + + Context "Compare versions numbers included in module of $GlobalModuleName module and function" { + + It 'Compare versions numbers between module and function' { + + $ModuleVersion | Should be $(& $ModuleVersionReturned) + + } + + } + + Context 'Check the subfolder en-US - main language' { + + $enUSfolderInPublic = Get-Item -Path "$ModulePath\Public\en-US" -ErrorAction SilentlyContinue + + It 'Check if the en-US folder exist' { + { Test-Path -Path $enUSfolderInPublic -PathType Container } | Should be $true + + } + + It "Check if the subfolder en-US contains $GlobalBaseTranslationFileName file " { + { Test-Path -Path "$enUSfolderInPublic\$GlobalBaseTranslationFileName" -PathType Leaf } | Should be $true + + } + + It "Check if $BaseTranslationFileName from en-US folder can be imported" { + { Import-LocalizedData -BaseDirectory $("$ModulePath\Public") -FileName $GlobalBaseTranslationFileName -BindingVariable enUSLocalizedStrings1 -UICulture 'en-US' -ErrorAction SilentlyContinue } | Should Not Throw + + Import-LocalizedData -BaseDirectory $("$ModulePath\Public") -FileName $GlobalBaseTranslationFileName -BindingVariable enUSLocalizedStrings2 -UICulture 'en-US' + + New-Variable -Scope Global -Name GlobalenUSLocalizedStrings -Value $enUSLocalizedStrings2 + + New-Variable -Scope Global -Name GlobalenUSLocalizedStringCount -Value $enUSLocalizedStrings2.Count -Force + + New-Variable -Scope Global -Name GlobalenUSLocalizedStringKeys -Value $enUSLocalizedStrings2.Keys -Force + + $GlobalenUSLocalizedStrings = $GlobalenUSLocalizedStrings.GetEnumerator() | Sort-Object -Property Name + + $GlobalenUSLocalizedStringKeys = $GlobalenUSLocalizedStringKeys | Sort-Object + + } + + It "Check if data from the file $BaseTranslationFileName for en-US was correctly assigned to variable." { + + $GlobalenUSLocalizedStringCount | Should BeGreaterThan 0 + + } + + It "Compare version of en-US translation with version of module" { + + $GlobalenUSLocalizedStrings.msg00 | Should be $ModuleVersion + + } + + #Enumerate hashtable and check if keys has assigned values (translations strings are fullfilled) + $GlobalenUSLocalizedStrings.GetEnumerator() | ForEach-Object -Process { + + $CurrentenUSLocalizedStringValue = $_ + + If ([String]::IsNullOrEmpty($CurrentenUSLocalizedStringValue.Value)) { + + It "Check if value for $($_.Key) for en-US is not null or empty." { + + $CurrentenUSLocalizedStringValue.Value | Should Not BeNullOrEmpty + + } + + } + + } + + } + + $SubfoldersInPublic = Get-ChildItem -Path "$ModulePath\Public\" -Directory + + ForEach ($SubfolderInPublic in $SubfoldersInPublic) { + + $SubfolderInPublicName = $SubfolderInPublic.Name + + If ($SubfolderInPublicName -ne 'en-US') { + + Context "Check translations for subfolder $SubfolderInPublicName" { + + $SubfolderInPublicNamePath = $SubfolderInPublic.FullName + + It "Check subfolder name format for the folder $SubfolderInPublicName" { + + $SubfolderInPublicName.Substring(2, 1) | Should be '-' + + } + + It "Check if the subfolder $SubfolderInPublicName contains $BaseTranslationFileName file " { + { Test-Path -Path "$SubfolderInPublicNamePath\Format-Pester.psd1" -PathType Leaf } | Should be $true + + } + + It "Check if $GlobalBaseTranslationFileName from $SubfolderInPublicName folder can be imported and contains data" { + { Import-LocalizedData -BaseDirectory $("$ModulePath\Public") -FileName $GlobalBaseTranslationFileName -BindingVariable CurrentLanguageLocalizedStrings1 -UICulture $SubfolderInPublicName -ErrorAction SilentlyContinue } | Should Not Throw + + Import-LocalizedData -BaseDirectory $("$ModulePath\Public") -FileName $GlobalBaseTranslationFileName -BindingVariable CurrentLanguageLocalizedStrings2 -UICulture $SubfolderInPublicName -ErrorAction SilentlyContinue + + New-Variable -Scope Global -Name GlobalCurrentLanguageLocalizedStrings -Value $CurrentLanguageLocalizedStrings2 -Force + + New-Variable -Scope Global -Name GlobalCurrentLanguageLocalizedStringCount -Value $CurrentLanguageLocalizedStrings2.Count -Force + + New-Variable -Scope Global -Name GlobalCurrentLanguageLocalizedStringKeys -Value $CurrentLanguageLocalizedStrings2.Keys -Force + + $GlobalCurrentLanguageLocalizedStrings = $GlobalCurrentLanguageLocalizedStrings.GetEnumerator() | Sort-Object -Property Name + + $GlobalCurrentLanguageLocalizedStringKeys = $GlobalCurrentLanguageLocalizedStringKeys | Sort-Object + + } + + It "Check if data from the file $BaseTranslationFileName for $SubfolderInPublicName was correctly assigned to variable." { + + $GlobalCurrentLanguageLocalizedStringCount | Should BeGreaterThan 0 + + } + + It "Compare version of $SubfolderInPublicName translation with version of module" { + + $GlobalCurrentLanguageLocalizedStrings.msg00 | Should be $ModuleVersion + + } + + It "Compare amount of strings for en-US and $SubfolderInPublicName" { + + $GlobalenUSLocalizedStringCount | Should be $GlobalCurrentLanguageLocalizedStringCount + + } + + #Enumerate hashtable and check if keys has assigned values (translations strings are fullfilled) + $GlobalCurrentLanguageLocalizedStrings.GetEnumerator() | ForEach-Object -Process { + + $CurrentCurrentLanguageLocalizedStringValue = $_ + + If ([String]::IsNullOrEmpty($CurrentCurrentLanguageLocalizedStringValue.Value)) { + + It "Check if value for $($_.Key) for en-US is not null or empty." { + + $CurrentCurrentLanguageLocalizedStringValue.Value | Should Not BeNullOrEmpty + + } + + } + + } + + It "Compare if names of localization keys for en-US and $SubfolderInPublicName are equal" { + + $DifferencesInKeys = Compare-Object -ReferenceObject $GlobalenUSLocalizedStringKeys -DifferenceObject $GlobalCurrentLanguageLocalizedStringKeys + + If ($DifferencesInKeys) { + + New-Variable -Name KeysNotEqual -Value $true -Scope Global -Force + + #New-Variable -Name GlobalDifferencesInKeys -Value $DifferencesInKeys -Scope Global -Force + + } + + $KeysNotEqual | Should BeNullOrEmpty + + } + + } + + If ($KeysNotEqual) { + + Context "Check translation for $SubfolderInPublicName - detailed fields name comparison" { + + ForEach ($CurrentenUSLocalizedKey in $GlobalenUSLocalizedStringKeys) { + + if ($GlobalCurrentLanguageLocalizedStringKeys -notcontains $CurrentenUSLocalizedKey) { + + It "The language file $SubfolderInPublicName not contains $CurrentenUSLocalizedKey" { + + $CurrentLanguageContainResult = ($GlobalCurrentLanguageLocalizedStringKeys -contains $CurrentenUSLocalizedKey) + + $CurrentLanguageContainResult | Should be $true + + } + + } + + } + + ForEach ($CurrentenLanguageLocalizedKey in $GlobalCurrentLanguageLocalizedStringKeys) { + + if ($GlobalenUSLocalizedStringKeys -notcontains $CurrentenLanguageLocalizedKey) { + + It "The language file en-US does not contain $CurrentenLanguageLocalizedKey available in $SubfolderInPublicName" { + + $EnUSLanguageContainResult = ($GlobalenUSLocalizedStringKeys -contains $CurrentenLanguageLocalizedKey) + + $EnUSLanguageContainResult | Should be $true + + } + + } + + } + + } + + } + + } + + } + } \ No newline at end of file