Files
runner-images/images/windows/scripts/build/Install-IEWebDriver.ps1
Vasilii Polikarpov 5ed2615017 [Windows] Cleanup various scripts (#8942)
* Use Resolve-GithubReleaseAssetUrl more widely

* Add the Get-ChecksumFromUrl function

* Sort exported functions and add docs

* Remove alias and fix typo

* Fix kind checksum url and syntax

* Fix checksums url for gh cli and msys2

* [Windows] Cleanup various scripts

* Add spaces after type specifications

* Rename the Take-Part function
2023-12-04 10:50:53 +01:00

31 lines
1.2 KiB
PowerShell

################################################################################
## File: Install-IEWebDriver.ps1
## Desc: Install IE Web Driver
################################################################################
$seleniumMajorVersion = (Get-ToolsetContent).selenium.version
$ieDriverUrl = Resolve-GithubReleaseAssetUrl `
-Repo "SeleniumHQ/selenium" `
-Version "$seleniumMajorVersion.*" `
-Asset "IEDriverServer_x64_*.zip"
# Download IE selenium driver
Write-Host "Selenium IEDriverServer download and install..."
$driverZipFile = Invoke-DownloadWithRetry $ieDriverUrl
$ieDriverPath = "C:\SeleniumWebDrivers\IEDriver"
if (-not (Test-Path -Path $ieDriverPath)) {
New-Item -Path $ieDriverPath -ItemType Directory -Force | Out-Null
}
Expand-7ZipArchive -Path $driverZipFile -DestinationPath $ieDriverPath
Remove-Item $driverZipFile
Write-Host "Get the IEDriver version..."
(Get-Item "$ieDriverPath\IEDriverServer.exe").VersionInfo.FileVersion | Out-File -FilePath "$ieDriverPath\versioninfo.txt"
Write-Host "Setting the IEWebDriver environment variables"
[Environment]::SetEnvironmentVariable("IEWebDriver", $ieDriverPath, "Machine")
Invoke-PesterTests -TestFile "Browsers" -TestName "Internet Explorer"