From 81865d867e046f1a402f18b08c28f8e120d343a0 Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov Date: Mon, 13 Jul 2020 10:10:46 +0300 Subject: [PATCH] add webdriver tests --- images/win/scripts/Tests/Browsers.Tests.ps1 | 26 ++++++++++----------- images/win/scripts/Tests/Haskell.Tests.ps1 | 4 ++-- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/images/win/scripts/Tests/Browsers.Tests.ps1 b/images/win/scripts/Tests/Browsers.Tests.ps1 index 80e26f45..55bae00f 100644 --- a/images/win/scripts/Tests/Browsers.Tests.ps1 +++ b/images/win/scripts/Tests/Browsers.Tests.ps1 @@ -6,8 +6,8 @@ Describe "Chrome" { $env:ChromeWebDriver | Should -Exist } - It "chromedriver.exe exists" { - "$env:ChromeWebDriver\chromedriver.exe" | Should -Exist + It "chromedriver.exe is installed" { + "$env:ChromeWebDriver\chromedriver.exe --version" | Should -ReturnZeroExitCode } It "versioninfo.txt exists" { @@ -15,7 +15,7 @@ Describe "Chrome" { } } - Context "Chrome" { + Context "Browser" { $chromeRegPath = "HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe" It "$edgeRegPath registry path exists" -TestCases @{chromeRegPath = $chromeRegPath} { @@ -55,8 +55,8 @@ Describe "Edge" { $env:EdgeWebDriver | Should -Exist } - It "msedgedriver.exe exists" { - "$env:EdgeWebDriver\msedgedriver.exe" | Should -Exist + It "msedgedriver.exe is installed" { + "$env:EdgeWebDriver\msedgedriver.exe --version" | Should -ReturnZeroExitCode } It "versioninfo.txt exists" { @@ -64,7 +64,7 @@ Describe "Edge" { } } - Context "Firefox" { + Context "Browser" { $edgeRegPath = "HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\msedge.exe" It "$edgeRegPath registry path exists" -TestCases @{edgeRegPath = $edgeRegPath} { @@ -83,15 +83,15 @@ Describe "Edge" { } Describe "Firefox" { - Context "GeckoWebDriver" { + Context "WebDriver" { It "GeckoWebDriver environment variable and path exists" { $env:GeckoWebDriver | Should -Not -BeNullOrEmpty $env:GeckoWebDriver | Should -BeExactly "C:\SeleniumWebDrivers\GeckoDriver" $env:GeckoWebDriver | Should -Exist } - It "geckodriver.exe exists" { - "$env:GeckoWebDriver\geckodriver.exe" | Should -Exist + It "geckodriver.exe is installed" { + "$env:GeckoWebDriver\geckodriver.exe --version" | Should -ReturnZeroExitCode } It "versioninfo.txt exists" { @@ -99,7 +99,7 @@ Describe "Firefox" { } } - Context "Firefox" { + Context "Browser" { $firefoxRegPath = "HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\firefox.exe" It "$firefoxRegPath registry path exists" -TestCases @{firefoxRegPath = $firefoxRegPath} { @@ -118,15 +118,15 @@ Describe "Firefox" { } Describe "Internet Explorer" { - Context "IEWebDriver" { + Context "WebDriver" { It "IEWebDriver environment variable and path exists" { $env:IEWebDriver | Should -Not -BeNullOrEmpty $env:IEWebDriver | Should -BeExactly "C:\SeleniumWebDrivers\IEDriver" $env:IEWebDriver | Should -Exist } - It "geckodriver.exe exists" { - "$env:IEWebDriver\IEDriverServer.exe" | Should -Exist + It "iedriverserver.exe is intalled" { + "$env:IEWebDriver\IEDriverServer.exe --version" | Should -ReturnZeroExitCode } It "versioninfo.txt exists" { diff --git a/images/win/scripts/Tests/Haskell.Tests.ps1 b/images/win/scripts/Tests/Haskell.Tests.ps1 index 68de94a2..b421b022 100644 --- a/images/win/scripts/Tests/Haskell.Tests.ps1 +++ b/images/win/scripts/Tests/Haskell.Tests.ps1 @@ -21,12 +21,12 @@ Describe "Haskell" { } } - It "Validation each of GHC version" -TestCases $ghcTestCases { + It " is installed" -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" { + It "Default version of GHC should be the latest installed" -TestCases @{ghcVersionList = $ghcVersionList} { $defaultGhcVersion = $ghcVersionList | Sort-Object {[Version]$_} |Select-Object -Last 1 ghc --version | Should -Match $defaultGhcVersion }