Migration to Pester tests

This commit is contained in:
Aleksandr Chebotov
2020-07-10 14:29:54 +03:00
parent fec0192835
commit f1352d64d5
38 changed files with 351 additions and 543 deletions

View File

@@ -760,18 +760,6 @@
"{{ template_dir }}/scripts/Installers/Validate-Perl.ps1"
]
},
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Validate-Git.ps1"
]
},
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Validate-GitHub-CLI.ps1"
]
},
{
"type": "powershell",
"scripts":[
@@ -784,12 +772,6 @@
"{{ template_dir }}/scripts/Installers/Validate-Rust.ps1"
]
},
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Validate-Julia.ps1"
]
},
{
"type": "powershell",
"scripts":[
@@ -802,30 +784,6 @@
"{{ template_dir }}/scripts/Installers/Validate-Svn.ps1"
]
},
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Validate-Chrome.ps1"
]
},
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Validate-Edge.ps1"
]
},
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Validate-Firefox.ps1"
]
},
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Validate-SeleniumWebDrivers.ps1"
]
},
{
"type": "powershell",
"scripts":[
@@ -868,24 +826,12 @@
"{{ template_dir }}/scripts/Installers/Validate-SQLPowerShellTools.ps1"
]
},
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Validate-Mingw64.ps1"
]
},
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Validate-TypeScript.ps1"
]
},
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Validate-Haskell.ps1"
]
},
{
"type": "powershell",
"scripts":[
@@ -910,48 +856,18 @@
"{{ template_dir }}/scripts/Installers/Validate-Packer.ps1"
]
},
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Validate-Mercurial.ps1"
]
},
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Validate-Jq.ps1"
]
},
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Validate-Zstd.ps1"
]
},
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Validate-InnoSetup.ps1"
]
},
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Validate-GitVersion.ps1"
]
},
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Validate-NSIS.ps1"
]
},
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Validate-CloudFoundryCli.ps1"
]
},
{
"type": "powershell",
"scripts":[
@@ -964,18 +880,6 @@
"{{ template_dir }}/scripts/Installers/Validate-VSWhere.ps1"
]
},
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Validate-KubernetesCli.ps1"
]
},
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Validate-GoogleCloudSDK.ps1"
]
},
{
"type": "powershell",
"scripts":[

View File

@@ -759,18 +759,6 @@
"{{ template_dir }}/scripts/Installers/Validate-Perl.ps1"
]
},
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Validate-Git.ps1"
]
},
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Validate-GitHub-CLI.ps1"
]
},
{
"type": "powershell",
"scripts":[
@@ -783,12 +771,6 @@
"{{ template_dir }}/scripts/Installers/Validate-Rust.ps1"
]
},
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Validate-Julia.ps1"
]
},
{
"type": "powershell",
"scripts":[
@@ -801,30 +783,6 @@
"{{ template_dir }}/scripts/Installers/Validate-Sbt.ps1"
]
},
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Validate-Chrome.ps1"
]
},
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Validate-Edge.ps1"
]
},
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Validate-Firefox.ps1"
]
},
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Validate-SeleniumWebDrivers.ps1"
]
},
{
"type": "powershell",
"scripts":[
@@ -855,24 +813,12 @@
"{{ template_dir }}/scripts/Installers/Validate-SQLPowerShellTools.ps1"
]
},
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Validate-Mingw64.ps1"
]
},
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Validate-TypeScript.ps1"
]
},
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Validate-Haskell.ps1"
]
},
{
"type": "powershell",
"scripts":[
@@ -897,48 +843,18 @@
"{{ template_dir }}/scripts/Installers/Validate-Packer.ps1"
]
},
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Validate-Mercurial.ps1"
]
},
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Validate-Jq.ps1"
]
},
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Validate-Zstd.ps1"
]
},
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Validate-InnoSetup.ps1"
]
},
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Validate-GitVersion.ps1"
]
},
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Validate-NSIS.ps1"
]
},
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Validate-CloudFoundryCli.ps1"
]
},
{
"type": "powershell",
"scripts":[
@@ -957,12 +873,6 @@
"{{ template_dir }}/scripts/Installers/Validate-VSWhere.ps1"
]
},
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Validate-KubernetesCli.ps1"
]
},
{
"type": "powershell",
"scripts":[
@@ -975,12 +885,6 @@
"{{ template_dir }}/scripts/Installers/Validate-AliyunCli.ps1"
]
},
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Validate-GoogleCloudSDK.ps1"
]
},
{
"type": "powershell",
"scripts":[

View File

@@ -74,4 +74,6 @@ setx ChromeWebDriver "$ChromeDriverPath" /M
$regEnvKey = 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\'
$PathValue = Get-ItemPropertyValue -Path $regEnvKey -Name 'Path'
$PathValue += ";$ChromeDriverPath\"
Set-ItemProperty -Path $regEnvKey -Name 'Path' -Value $PathValue
Set-ItemProperty -Path $regEnvKey -Name 'Path' -Value $PathValue
Invoke-PesterTests -TestFile "Browsers" -TestName "Chrome"

View File

@@ -20,4 +20,6 @@ Write-Host "Extracting cf cli..."
Extract-7Zip -Path $CloudFoundryArchPath -DestinationPath $CloudFoundryCliPath
# Add cf to path
Add-MachinePathItem $CloudFoundryCliPath
Add-MachinePathItem $CloudFoundryCliPath
Invoke-PesterTests -TestFile "Tools" -TestName "CloudFoundryCli"

View File

@@ -37,4 +37,6 @@ setx EdgeWebDriver "$EdgeDriverPath" /M
$regEnvKey = 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\'
$PathValue = Get-ItemPropertyValue -Path $regEnvKey -Name 'Path'
$PathValue += ";$EdgeDriverPath\"
Set-ItemProperty -Path $regEnvKey -Name 'Path' -Value $PathValue
Set-ItemProperty -Path $regEnvKey -Name 'Path' -Value $PathValue
Invoke-PesterTests -TestFile "Browsers" -TestName "Edge"

View File

@@ -49,4 +49,6 @@ Extract-7Zip -Path $GeckoDriverArchPath -DestinationPath $GeckoDriverPath
Write-Host "Setting the environment variables..."
Add-MachinePathItem -PathItem $GeckoDriverPath
setx GeckoWebDriver "$GeckoDriverPath" /M
setx GeckoWebDriver "$GeckoDriverPath" /M
Invoke-PesterTests -TestFile "Browsers" -TestName "Firefox"

View File

@@ -40,4 +40,4 @@ Choco-Install -PackageName hub
Add-MachinePathItem "C:\Program Files\Git\bin"
exit 0
Invoke-PesterTests -TestFile "Git" -TestName "Git"

View File

@@ -3,8 +3,8 @@
## Desc: Install GitHub CLI
################################################################################
Import-Module -Name ImageHelpers -Force
Choco-Install -PackageName gh
Add-MachinePathItem "C:\Program Files (x86)\GitHub CLI"
Add-MachinePathItem "C:\Program Files (x86)\GitHub CLI"
Invoke-PesterTests -TestFile "Tools" -TestName "GitHub-CLI"

View File

@@ -4,3 +4,5 @@
################################################################################
Choco-Install -PackageName gitversion.portable
Invoke-PesterTests -TestFile "Git" -TestName "GitVersion"

View File

@@ -7,3 +7,5 @@
$googleCloudSDKInstaller = "https://dl.google.com/dl/cloudsdk/channels/rapid/GoogleCloudSDKInstaller.exe"
$argumentList = @("/S", "/allusers", "/noreporting")
Install-Binary -Url $googleCloudSDKInstaller -Name "GoogleCloudSDKInstaller.exe" -ArgumentList $argumentList
Invoke-PesterTests -TestFile "Tools" -TestName "GoogleCouldSDK"

View File

@@ -22,3 +22,5 @@ Add-MachinePathItem -PathItem $DefaultGhcPath
Write-Host "Installing cabal..."
Choco-Install -PackageName cabal
Invoke-PesterTests -TestFile "Haskell"

View File

@@ -36,3 +36,5 @@ Write-Host "Get the IEDriver version..."
Write-Host "Setting the IEWebDriver environment variables"
setx IEWebDriver $ieDriverPath /M
Invoke-PesterTests -TestFile "Browsers" -TestName "Internet Explorer"

View File

@@ -4,3 +4,5 @@
################################################################################
Choco-Install -PackageName innosetup
Invoke-PesterTests -TestFile "Tools" -TestName "InnoSetup"

View File

@@ -4,3 +4,5 @@
################################################################################
Choco-Install -PackageName jq
Invoke-PesterTests -TestFile "Tools" -TestName "Jq"

View File

@@ -4,3 +4,5 @@
################################################################################
Choco-Install -PackageName julia -ArgumentList "--ia","/DIR=C:\Julia"
Invoke-PesterTests -TestFile "Tools" -TestName "Julia"

View File

@@ -5,3 +5,5 @@
Choco-Install -PackageName kubernetes-cli
Choco-Install -PackageName minikube
Invoke-PesterTests -TestFile "Tools" -TestName "KubernetesCli"

View File

@@ -8,3 +8,5 @@ Choco-Install -PackageName hg -ArgumentList "--version", "5.0.0"
$hgPath = "${env:ProgramFiles}\Mercurial\"
Add-MachinePathItem $hgPath
$env:Path = Get-MachinePath
Invoke-PesterTests -TestFile "Tools" -TestName "Mercurial"

View File

@@ -1,13 +1,13 @@
################################################################################
## File: Install-Mingw64.ps1
## Desc: Install GNU tools for Windows to C:\tools\mingw64
## Desc: Install GNU tools for Windows
################################################################################
Import-Module -Name ImageHelpers -Force
Choco-Install -PackageName mingw
# Make a copy of mingw32-make.exe to make.exe, which is a more discoverable name
# and so the same command line can be used on Windows as on macOS and Linux
$path = where.exe mingw32-make.exe | Get-Item
Copy-Item -Path $path -Destination (Join-Path $path.Directory 'make.exe')
Invoke-PesterTests -TestFile "Tools" -TestName "Mingw64"

View File

@@ -1,14 +0,0 @@
################################################################################
## File: Validate-Chrome.ps1
## Desc: Validate Google Chrome installation.
################################################################################
if (Test-Path 'HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe')
{
(Get-Item (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe').'(Default)').VersionInfo
}
else
{
Write-Host 'Google Chrome is not installed.'
exit 1
}

View File

@@ -1,15 +0,0 @@
################################################################################
## File: Validate-CloudFoundryCli.ps1
## Desc: Validate Cloud Foundry CLI
################################################################################
if (Get-Command -Name 'cf')
{
Write-Host 'cf on path'
}
else
{
Write-Host 'cf is not on path'
exit 1
}

View File

@@ -1,15 +0,0 @@
################################################################################
## File: Validate-Edge.ps1
## Desc: Validate Microsoft Edge installation.
################################################################################
$RegistryKey = "HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\msedge.exe"
if (Test-Path $RegistryKey)
{
(Get-Item (Get-ItemProperty $RegistryKey).'(Default)').VersionInfo
}
else
{
Write-Host "Microsoft Edge is not installed."
exit 1
}

View File

@@ -1,14 +0,0 @@
################################################################################
## File: Validate-Firefox.ps1
## Desc: Validate Mozilla Firefox installation.
################################################################################
if (Test-Path 'HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\firefox.exe')
{
(Get-Item (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\firefox.exe').'(Default)').VersionInfo
}
else
{
Write-Host 'Mozilla Firefox is not installed.'
exit 1
}

View File

@@ -1,20 +0,0 @@
################################################################################
## File: Validate-Git.ps1
## Desc: Validate Git for Windows
################################################################################
function Test-CommandName {
param(
[parameter(Mandatory)][string] $CommandName
)
Write-Host "Checking the [$CommandName]"
if(-not (Get-Command $CommandName -ErrorAction "Continue")) {
Write-Host "[!] $CommandName is not found"
exit 1
}
}
Test-CommandName -CommandName 'bash'
Test-CommandName -CommandName 'awk'
Test-CommandName -CommandName 'git'
Test-CommandName -CommandName 'git-lfs'
Test-CommandName -CommandName 'hub'

View File

@@ -1,14 +0,0 @@
################################################################################
## File: Validate-GitHub-CLI.ps1
## Desc: Validate GitHub CLI
################################################################################
if (Get-Command -Name 'gh')
{
Write-Host 'gh on path'
}
else
{
Write-Host 'gh is not on path'
exit 1
}

View File

@@ -1,14 +0,0 @@
################################################################################
## File: Validate-GitVersion.ps1
## Desc: Validate GitVersion
################################################################################
if (Get-Command -Name 'gitversion')
{
Write-Host 'gitversion on path'
}
else
{
Write-Host 'gitversion is not on path'
exit 1
}

View File

@@ -1,19 +0,0 @@
################################################################################
## File: Validate-GoogleCloudSDK.ps1
## Desc: Validate Install Google Cloud SDK for Windows
################################################################################
# Simple validation gcloud, gsutil, and bq command line tools
$validateTools = @("bq", "gcloud", "gsutil")
foreach($tool in $validateTools)
{
if (Get-Command -Name $tool)
{
Write-Host "$tool on path"
}
else
{
Write-Host "$tool is not on path"
exit 1
}
}

View File

@@ -1,55 +0,0 @@
################################################################################
## File: Validate-Haskell.ps1
## Desc: Validate Haskell for Windows
################################################################################
# GHC validation
if (Get-Command -Name 'ghc')
{
Write-Host "ghc is on the path"
}
else
{
Write-Host "ghc is not on path."
exit 1
}
$ChocoPackagesPath = Join-Path $env:ChocolateyInstall "lib"
[Array] $GhcVersionList = Get-ChildItem -Path $ChocoPackagesPath -Filter "ghc.*" | ForEach-Object { $_.Name.TrimStart("ghc.") }
# Validation that accurate 3 versions of GHC are installed
if ($GhcVersionList.Count -eq 3)
{
Write-Host "Versions of GHC are accurate"
}
else
{
Write-Host "Versions of GHC not accurate"
exit 1
}
# Validation each of GHC version
foreach ($version in $GhcVersionList)
{
$BinGhcPath = Join-Path $env:ChocolateyInstall "lib\ghc.$version\tools\ghc-$version\bin\ghc.exe"
if ((& $BinGhcPath --version) -match $version)
{
Write-Host "ghc $version is valid"
}
else
{
Write-Host "ghc $version is not valid"
exit 1
}
}
# Cabal validation
if (Get-Command -Name 'cabal')
{
Write-Host "cabal is on the path"
}
else
{
Write-Host "cabal is not on path."
exit 1
}

View File

@@ -1,15 +0,0 @@
################################################################################
## File: Validate-InnoSetup.ps1
## Desc: Validate Inno Setup
################################################################################
if (Get-Command -Name 'iscc')
{
Write-Host 'iscc is on PATH'
}
else
{
Write-Host 'iscc is not on PATH'
exit 1
}

View File

@@ -1,15 +0,0 @@
################################################################################
## File: Validate-Jq.ps1
## Desc: Validate jq
################################################################################
if (Get-Command -Name 'jq')
{
Write-Host 'jq on path'
}
else
{
Write-Host 'jq is not on path'
exit 1
}

View File

@@ -1,16 +0,0 @@
################################################################################
## File: Validate-Julia.ps1
## Desc: Validate Julia
################################################################################
# Verify that julia.exe is on the path
if ((Get-Command -Name 'julia') -and (Test-Path -Path 'C:\Julia'))
{
Write-Host "$(julia --version) is on the path."
}
else
{
Write-Host "Julia is not on the path."
exit 1
}

View File

@@ -1,25 +0,0 @@
################################################################################
## File: Validate-KubernetesCli.ps1
## Desc: Validate KubernetesCli.
################################################################################
if (Get-Command -Name 'kubectl')
{
Write-Host "kubectl $(kubectl version --client=true --short=true) in path"
}
else
{
Write-Host "kubectl is not in path"
exit 1
}
if (Get-Command -Name 'minikube')
{
Write-Host "minikube $(minikube version --short) in path"
}
else
{
Write-Host "minikube is not in path"
exit 1
}

View File

@@ -1,14 +0,0 @@
################################################################################
## File: Validate-Mercurial.ps1
## Desc: Validate Mercurial
################################################################################
if (Get-Command -Name 'hg')
{
Write-Host 'Mercurial on path'
}
else
{
Write-Host 'Mercurial is not on path'
exit 1
}

View File

@@ -1,37 +0,0 @@
################################################################################
## File: Validate-Mingw64.ps1
## Desc: Validate Mingw64
################################################################################
if (Get-Command -Name 'gcc')
{
Write-Host "gcc is successfully installed:"
gcc --version | Write-Host
}
else
{
Write-Host "gcc is not on PATH"
exit 1
}
if (Get-Command -Name 'g++')
{
Write-Host "g++ is successfully installed:"
g++ --version | Write-Host
}
else
{
Write-Host "g++ is not on PATH"
exit 1
}
if (Get-Command -Name 'make')
{
Write-Host "make is successfully installed:"
make --version | Write-Host
}
else
{
Write-Host "make is not on PATH"
exit 1
}

View File

@@ -1,38 +0,0 @@
################################################################################
## File: Validate-Chrome.ps1
## Desc: Validate Google Chrome installation.
################################################################################
$IEDriverPath = $env:IEWebDriver
Write-Host "IEDriverPath: $IEDriverPath"
$GeckoDriverPath = $env:GeckoWebDriver
Write-Host "GeckoDriverPath: $GeckoDriverPath"
$ChromeDriverPath = $env:ChromeWebDriver
Write-Host "ChromeDriverPath: $ChromeDriverPath"
$EdgeDriverPath = $env:EdgeWebDriver
Write-Host "EdgeDriverPath: $EdgeDriverPath"
if (
($IEDriverPath -like "C:\SeleniumWebDrivers\IEDriver") -and
($GeckoDriverPath -like "C:\SeleniumWebDrivers\GeckoDriver") -and
($ChromeDriverPath -like "C:\SeleniumWebDrivers\ChromeDriver") -and
($EdgeDriverPath -like "C:\SeleniumWebDrivers\EdgeDriver")
)
{
Write-Host "IEDriver installed at "
(Get-Item "$IEDriverPath\IEDriverServer.exe").VersionInfo
Write-Host "Gecko Driver installed at "
(Get-Item "$GeckoDriverPath\geckodriver.exe").VersionInfo
Write-Host "Chrome Driver installed at "
(Get-Item "$ChromeDriverPath\chromedriver.exe").VersionInfo
Write-Host "Edge Driver installed at "
(Get-Item "$EdgeDriverPath\msedgedriver.exe").VersionInfo
}
else
{
Write-Host "Selenium Web Drivers are not installed."
exit 1
}

View File

@@ -0,0 +1,160 @@
Describe "Chrome" {
Context "WebDriver" {
It "ChromeWebDriver environment variable exists" {
$env:ChromeWebDriver | Should -Not -BeNullOrEmpty
}
It "ChromeWebDriver should be equal C:\SeleniumWebDrivers\ChromeDriver" {
$env:ChromeWebDriver | Should -BeExactly "C:\SeleniumWebDrivers\ChromeDriver"
}
It "ChromeWebDriver path exists" {
$env:ChromeWebDriver | Should -Exist
}
It "chromedriver.exe exists" {
"$env:ChromeWebDriver\chromedriver.exe" | Should -Exist
}
It "versioninfo.txt exists" {
"$env:ChromeWebDriver\versioninfo.txt" | Should -Exist
}
}
Context "Chrome" {
$chromeRegPath = "HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe"
It "$edgeRegPath registry path exists" -TestCases @{chromeRegPath = $chromeRegPath} {
$chromeRegPath | Should -Exist
}
It "Chrome VersionInfo registry value exists" -TestCases @{chromeRegPath = $chromeRegPath} {
$versionInfo = (Get-Item (Get-ItemProperty $chromeRegPath).'(Default)').VersionInfo
$versionInfo | Should -Not -BeNullOrEmpty
}
It "gupdate is stopped" {
$svc = Get-Service -Name gupdate
$svc.Status | Should -BeExactly Stopped
}
It "gupdatem is stopped" {
$svc = Get-Service -Name gupdatem
$svc.Status | Should -BeExactly Stopped
}
It "BlockGoogleUpdate firewall rule exists" {
Get-NetFirewallRule -DisplayName BlockGoogleUpdate | Should -Not -BeNullOrEmpty
}
It "chrome.exe is installed" {
"${env:ProgramFiles(x86)}\Google\Chrome\Application\chrome.exe" | Should -Exist
}
}
}
Describe "Edge" {
Context "WebDriver" {
It "EdgeWebDriver environment variable exists" {
$env:EdgeWebDriver | Should -Not -BeNullOrEmpty
}
It "EdgeWebDriver should be equal C:\SeleniumWebDrivers\EdgeDriver" {
$env:EdgeWebDriver | Should -BeExactly "C:\SeleniumWebDrivers\EdgeDriver"
}
It "EdgeWebDriver path exists" {
$env:EdgeWebDriver | Should -Exist
}
It "msedgedriver.exe exists" {
"$env:EdgeWebDriver\msedgedriver.exe" | Should -Exist
}
It "versioninfo.txt exists" {
"$env:EdgeWebDriver\versioninfo.txt" | Should -Exist
}
}
Context "Firefox" {
$edgeRegPath = "HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\msedge.exe"
It "$edgeRegPath registry path exists" -TestCases @{edgeRegPath = $edgeRegPath} {
$edgeRegPath | Should -Exist
}
It "Edge VersionInfo registry value exists" -TestCases @{edgeRegPath = $edgeRegPath} {
$versionInfo = (Get-Item (Get-ItemProperty $edgeRegPath).'(Default)').VersionInfo
$versionInfo | Should -Not -BeNullOrEmpty
}
It "msedge.exe is installed" {
"${env:ProgramFiles(x86)}\Microsoft\Edge\Application\msedge.exe" | Should -Exist
}
}
}
Describe "Firefox" {
Context "GeckoWebDriver" {
It "GeckoWebDriver environment variable exists" {
$env:GeckoWebDriver | Should -Not -BeNullOrEmpty
}
It "GeckoWebDriver should be equal C:\SeleniumWebDrivers\GeckoDriver" {
$env:GeckoWebDriver | Should -BeExactly "C:\SeleniumWebDrivers\GeckoDriver"
}
It "GeckoWebDriver path exists" {
$env:GeckoWebDriver | Should -Exist
}
It "geckodriver.exe exists" {
"$env:GeckoWebDriver\geckodriver.exe" | Should -Exist
}
It "versioninfo.txt exists" {
"$env:GeckoWebDriver\versioninfo.txt" | Should -Exist
}
}
Context "Firefox" {
$firefoxRegPath = "HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\firefox.exe"
It "$firefoxRegPath registry path exists" -TestCases @{firefoxRegPath = $firefoxRegPath} {
$firefoxRegPath | Should -Exist
}
It "Firefox VersionInfo registry value exists" -TestCases @{firefoxRegPath = $firefoxRegPath} {
$versionInfo = (Get-Item (Get-ItemProperty $firefoxRegPath).'(Default)').VersionInfo
$versionInfo | Should -Not -BeNullOrEmpty
}
It "firefox.exe is installed" {
"$env:ProgramFiles\Mozilla Firefox\firefox.exe" | Should -Exist
}
}
}
Describe "Internet Explorer" {
Context "IEWebDriver" {
It "IEWebDriver environment variable exists" {
$env:IEWebDriver | Should -Not -BeNullOrEmpty
}
It "IEWebDriver should be equal C:\SeleniumWebDrivers\IEDriver" {
$env:IEWebDriver | Should -BeExactly "C:\SeleniumWebDrivers\IEDriver"
}
It "IEWebDriver path exists" {
$env:IEWebDriver | Should -Exist
}
It "geckodriver.exe exists" {
"$env:IEWebDriver\IEDriverServer.exe" | Should -Exist
}
It "versioninfo.txt exists" {
"$env:IEWebDriver\versioninfo.txt" | Should -Exist
}
}
}

View File

@@ -0,0 +1,35 @@
Describe "Git" {
$gitTools = 'bash', 'awk', 'git', 'git-lfs'
$gitTestCases = $gitTools | ForEach-Object {
@{
toolName = $_
source = [regex]::Escape("$env:ProgramFiles\Git")
}
}
It "Toolname '<toolName>' is installed" -TestCases $gitTestCases {
"$toolName --version" | Should -ReturnZeroExitCode
}
It "ToolName '<toolName>' is located in '<source>'" -TestCases $gitTestCases {
(Get-Command -Name $toolName).Source | Should -Match $source
}
It "hub is installed" {
"hub --version" | Should -ReturnZeroExitCode
}
It "Git core.symlinks=true option is enabled" {
git config core.symlinks | Should -BeExactly true
}
It "GCM_INTERACTIVE environment variable should be equal Never" {
$env:GCM_INTERACTIVE | Should -BeExactly Never
}
}
Describe "GitVersion" {
It "gitversion is installed" {
"gitversion /version" | Should -ReturnZeroExitCode
}
}

View File

@@ -0,0 +1,33 @@
Describe "Haskell" {
It "ghc" {
"ghc --version" | Should -ReturnZeroExitCode
}
It "cabal" {
"cabal --version" | Should -ReturnZeroExitCode
}
$chocoPackagesPath = Join-Path $env:ChocolateyInstall "lib"
[array]$ghcVersionList = Get-ChildItem -Path $chocoPackagesPath -Filter "ghc.*" | ForEach-Object { $_.Name.TrimStart("ghc.") }
$ghcCount = $ghcVersionList.Count
It "Accurate 3 versions of GHC are installed" -TestCases @{ghcCount = $ghcCount} {
$ghcCount | Should -BeExactly 3
}
$ghcTestCases = $ghcVersionList | ForEach-Object {
@{
ghcVersion = $_
}
}
It "Validation each of GHC version" -TestCases $ghcTestCases {
$binGhcPath = Join-Path $env:ChocolateyInstall "lib\ghc.$ghcVersion\tools\ghc-$ghcVersion\bin\ghc.exe"
& $binGhcPath --version | Should -Match $ghcVersion
}
It "Default version of GHC should be the latest installed" {
$defaultGhcVersion = $ghcVersionList | Sort-Object {[Version]$_} |Select-Object -Last 1
ghc --version | Should -Match $defaultGhcVersion
}
}

View File

@@ -14,4 +14,90 @@ Describe "Kind" {
It "Kind" {
"kind version" | Should -ReturnZeroExitCode
}
}
Describe "Jq" {
It "Jq" {
"jq -n ." | Should -ReturnZeroExitCode
}
}
Describe "Julia" {
It "Julia path exists" {
"C:\Julia" | Should -Exist
}
It "Julia" {
"julia --version" | Should -ReturnZeroExitCode
}
}
Describe "Mercurial" {
It "Mercurial" {
"hg --version" | Should -ReturnZeroExitCode
}
}
Describe "KubernetesCli" {
It "kubectl" {
"kubectl version --client=true --short=true" | Should -ReturnZeroExitCode
}
It "minikube" {
"minikube version --short" | Should -ReturnZeroExitCode
}
}
Describe "Mingw64" {
It "gcc" {
"gcc --version" | Should -ReturnZeroExitCode
}
It "g++" {
"g++ --version" | Should -ReturnZeroExitCode
}
It "make" {
"make --version" | Should -ReturnZeroExitCode
}
}
Describe "InnoSetup" {
It "InnoSetup" {
(Get-Command -Name iscc).CommandType | Should -BeExactly "Application"
}
}
Describe "GitHub-CLI" {
It "gh is located in ${env:ProgramFiles(x86)}\GitHub CLI" {
"${env:ProgramFiles(x86)}\GitHub CLI\gh.exe" | Should -Exist
}
It "gh" {
"gh --version" | Should -ReturnZeroExitCode
}
}
Describe "CloudFoundryCli" {
It "cf is located in C:\cf-cli" {
"C:\cf-cli\cf.exe" | Should -Exist
}
It "cf" {
"cf --version" | Should -ReturnZeroExitCode
}
}
Describe "GoogleCouldSDK" {
It "bq" {
"bq version" | Should -ReturnZeroExitCode
}
It "gcloud" {
"gcloud version" | Should -ReturnZeroExitCode
}
It "gsutil" {
"gsutil version" | Should -ReturnZeroExitCode
}
}