mirror of
https://github.com/actions/runner-images.git
synced 2025-12-28 20:58:32 +08:00
[Windows] Use function to get selenium asset url (#8448)
This commit is contained in:
committed by
GitHub
parent
23ff0d7468
commit
ddebd05257
@@ -1,18 +1,22 @@
|
||||
################################################################################
|
||||
## File: Install-SeleniumWebDrivers.ps1
|
||||
## Desc: Install Selenium Web Drivers
|
||||
## File: Install-IEWebDriver.ps1
|
||||
## Desc: Install IE Web Driver
|
||||
################################################################################
|
||||
|
||||
|
||||
$json = Invoke-RestMethod -Uri "https://api.github.com/repos/SeleniumHQ/selenium/releases?per_page=100"
|
||||
$ieDriverUrl = $json.Where{-not $_.prerelease}.assets.browser_download_url | Where-Object { $_ -like "*IEDriverServer_x64_*.zip" } | Select-Object -First 1
|
||||
$seleniumMajorVersion = (Get-ToolsetContent).selenium.version
|
||||
$ieDriverUrl = Get-GitHubPackageDownloadUrl `
|
||||
-RepoOwner "SeleniumHQ" `
|
||||
-RepoName "selenium" `
|
||||
-BinaryName "IEDriverServer_x64" `
|
||||
-Version $seleniumMajorVersion `
|
||||
-UrlFilter "*{BinaryName}_{Version}.zip" `
|
||||
-LatestReleaseOnly $false
|
||||
|
||||
# Download IE selenium driver
|
||||
try {
|
||||
Write-Host "Selenium IEDriverServer download and install..."
|
||||
$driverZipFile = Start-DownloadWithRetry -Url $ieDriverUrl -Name "SeleniumWebDrivers.zip"
|
||||
}
|
||||
catch {
|
||||
} catch {
|
||||
Write-Error "[!] Failed to download $ieDriverUrl"
|
||||
exit 1
|
||||
}
|
||||
@@ -31,4 +35,4 @@ Write-Host "Get the IEDriver version..."
|
||||
Write-Host "Setting the IEWebDriver environment variables"
|
||||
setx IEWebDriver $ieDriverPath /M
|
||||
|
||||
Invoke-PesterTests -TestFile "Browsers" -TestName "Internet Explorer"
|
||||
Invoke-PesterTests -TestFile "Browsers" -TestName "Internet Explorer"
|
||||
|
||||
Reference in New Issue
Block a user