mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-10 05:13:49 +00:00
Merge pull request #574 from ili101/TestsFix
Fix Test accidentally closing focused window
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -61,5 +61,6 @@ testCCFMT.ps1
|
|||||||
testHide.ps1
|
testHide.ps1
|
||||||
ImportExcel.zip
|
ImportExcel.zip
|
||||||
.vscode/launch.json
|
.vscode/launch.json
|
||||||
|
.vscode/settings.json
|
||||||
|
|
||||||
~$*
|
~$*
|
||||||
|
|||||||
@@ -51,8 +51,15 @@ Describe "Compare Worksheet" {
|
|||||||
Context "Setting the background to highlight different rows, use of grid view." {
|
Context "Setting the background to highlight different rows, use of grid view." {
|
||||||
BeforeAll {
|
BeforeAll {
|
||||||
$useGrid = ($PSVersionTable.PSVersion.Major -LE 5)
|
$useGrid = ($PSVersionTable.PSVersion.Major -LE 5)
|
||||||
$null = Compare-WorkSheet "$env:temp\Server1.xlsx" "$env:temp\Server2.xlsx" -BackgroundColor ([System.Drawing.Color]::LightGreen) -GridView:$useGrid
|
if ($useGrid) {
|
||||||
if ($useGrid) {Start-Sleep -sec 5; [System.Windows.Forms.SendKeys]::Sendwait("%{F4}") }
|
$ModulePath = (Get-Command -Name 'Compare-WorkSheet').Module.Path
|
||||||
|
$PowerShellExec = if ($PSEdition -eq 'Core') {'pwsh.exe'} else {'powershell.exe'}
|
||||||
|
$PowerShellPath = Join-Path -Path $PSHOME -ChildPath $PowerShellExec
|
||||||
|
. $PowerShellPath -Command ("Import-Module $ModulePath; " + '$null = Compare-WorkSheet "$env:temp\Server1.xlsx" "$env:temp\Server2.xlsx" -BackgroundColor ([System.Drawing.Color]::LightGreen) -GridView; Start-Sleep -sec 5')
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$null = Compare-WorkSheet "$env:temp\Server1.xlsx" "$env:temp\Server2.xlsx" -BackgroundColor ([System.Drawing.Color]::LightGreen) -GridView:$useGrid
|
||||||
|
}
|
||||||
$xl1 = Open-ExcelPackage -Path "$env:temp\Server1.xlsx"
|
$xl1 = Open-ExcelPackage -Path "$env:temp\Server1.xlsx"
|
||||||
$xl2 = Open-ExcelPackage -Path "$env:temp\Server2.xlsx"
|
$xl2 = Open-ExcelPackage -Path "$env:temp\Server2.xlsx"
|
||||||
$s1Sheet = $xl1.Workbook.Worksheets[1]
|
$s1Sheet = $xl1.Workbook.Worksheets[1]
|
||||||
|
|||||||
Reference in New Issue
Block a user