mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-06 00:23:20 +00:00
updated
This commit is contained in:
@@ -1,40 +1,32 @@
|
||||
function Show-PesterResults {
|
||||
$xlfilename=".\test.xlsx"
|
||||
rm $xlfilename -ErrorAction Ignore
|
||||
$xlfilename = ".\test.xlsx"
|
||||
Remove-Item $xlfilename -ErrorAction Ignore
|
||||
|
||||
$ConditionalText = @()
|
||||
$ConditionalText += New-ConditionalText -Range "Result" -Text failed -BackgroundColor red -ConditionalTextColor black
|
||||
$ConditionalText += New-ConditionalText -Range "Result" -Text passed -BackgroundColor green -ConditionalTextColor black
|
||||
$ConditionalText += New-ConditionalText -Range "Result" -Text pending -BackgroundColor gray -ConditionalTextColor black
|
||||
|
||||
|
||||
$xlParams = @{
|
||||
Path=$xlfilename
|
||||
WorkSheetname = 'PesterTests'
|
||||
ConditionalText=$ConditionalText
|
||||
PivotRows = 'Description'
|
||||
PivotColumns = 'Result'
|
||||
PivotData = @{'Result'='Count'}
|
||||
IncludePivotTable = $true
|
||||
#IncludePivotChart = $true
|
||||
#NoLegend = $true
|
||||
#ShowPercent = $true
|
||||
#ShowCategory = $true
|
||||
AutoSize = $true
|
||||
AutoNameRange = $true
|
||||
AutoFilter = $true
|
||||
Show = $true
|
||||
Path = $xlfilename
|
||||
WorkSheetname = 'PesterTests'
|
||||
ConditionalText = $ConditionalText
|
||||
PivotRows = 'Result', 'Name'
|
||||
PivotData = @{'Result' = 'Count'}
|
||||
IncludePivotTable = $true
|
||||
AutoSize = $true
|
||||
AutoNameRange = $true
|
||||
AutoFilter = $true
|
||||
Show = $true
|
||||
}
|
||||
|
||||
$(foreach($result in (Invoke-Pester -PassThru -Show None).TestResult) {
|
||||
|
||||
[PSCustomObject]@{
|
||||
Description = $result.Describe
|
||||
Name = $result.Name
|
||||
#Time = $result.Time
|
||||
Result = $result.Result
|
||||
Messge = $result.FailureMessage
|
||||
StackTrace = $result.StackTrace
|
||||
}
|
||||
|
||||
}) | Sort Description | Export-Excel @xlParams
|
||||
$(foreach ($result in (Invoke-Pester -PassThru -Show None).TestResult) {
|
||||
[PSCustomObject]@{
|
||||
Description = $result.Describe
|
||||
Name = $result.Name
|
||||
Result = $result.Result
|
||||
Messge = $result.FailureMessage
|
||||
StackTrace = $result.StackTrace
|
||||
}
|
||||
}) | Sort-Object Description | Export-Excel @xlParams
|
||||
}
|
||||
@@ -1,5 +1,3 @@
|
||||
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
|
||||
|
||||
function Test-APIReadXls {
|
||||
param(
|
||||
[parameter(Mandatory)]
|
||||
@@ -7,7 +5,7 @@ function Test-APIReadXls {
|
||||
$WorksheetName = 'Sheet1'
|
||||
)
|
||||
|
||||
$testFileName = "{0}.tests.ps1" -f (get-date).ToString("yyyyMMddHHmmss.fff")
|
||||
$testFileName = "{0}.tests.ps1" -f (get-date).ToString("yyyyMMddHHmmss")
|
||||
|
||||
$records = Import-Excel $XlFilename
|
||||
|
||||
@@ -37,7 +35,6 @@ function Test-APIReadXls {
|
||||
"@
|
||||
})
|
||||
|
||||
|
||||
@"
|
||||
Describe "Tests from $($XlFilename) in $($WorksheetName)" {
|
||||
$($blocks)
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user