From e9080f8ef6183647f95ddb12da27f5b5058a8e03 Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov <47745270+al-cheb@users.noreply.github.com> Date: Wed, 26 Aug 2020 19:39:34 +0300 Subject: [PATCH] get chrome path from registy (#1487) --- images/win/scripts/Tests/Browsers.Tests.ps1 | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/images/win/scripts/Tests/Browsers.Tests.ps1 b/images/win/scripts/Tests/Browsers.Tests.ps1 index 7dbce4585..b1b4a7609 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" } } }