diff --git a/images/win/scripts/Tests/Browsers.Tests.ps1 b/images/win/scripts/Tests/Browsers.Tests.ps1 index 7dbce458..b1b4a760 100644 --- a/images/win/scripts/Tests/Browsers.Tests.ps1 +++ b/images/win/scripts/Tests/Browsers.Tests.ps1 @@ -17,13 +17,14 @@ Describe "Chrome" { Context "Browser" { $chromeRegPath = "HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe" + $chromePath = (Get-ItemProperty $chromeRegPath).'(default)' It "Chrome '' 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 + It "Chrome VersionInfo registry value exists" -TestCases @{chromePath = $chromePath} { + $versionInfo = (Get-Item $chromePath).VersionInfo $versionInfo | Should -Not -BeNullOrEmpty } @@ -41,8 +42,10 @@ Describe "Chrome" { Get-NetFirewallRule -DisplayName BlockGoogleUpdate | Should -Not -BeNullOrEmpty } - It "chrome.exe is installed" { - "${env:ProgramFiles(x86)}\Google\Chrome\Application\chrome.exe" | Should -Exist + It " is installed" -TestCases @{chromePath = $chromePath} { + $chromeName = (Get-Item $chromePath).Name + $chromePath | Should -Exist + $chromeName | Should -BeExactly "chrome.exe" } } }