mirror of
https://github.com/actions/runner-images.git
synced 2025-12-15 22:26:56 +00:00
33 lines
1.3 KiB
PowerShell
33 lines
1.3 KiB
PowerShell
################################################################################
|
|
## File: Install-Selenium.ps1
|
|
## Desc: Install Selenium Server standalone
|
|
################################################################################
|
|
|
|
# Create Selenium directory
|
|
$seleniumDirectory = "C:\selenium\"
|
|
New-Item -ItemType directory -Path $seleniumDirectory
|
|
|
|
# Download Selenium
|
|
$seleniumMajorVersion = (Get-ToolsetContent).selenium.version
|
|
$seleniumBinaryName = (Get-ToolsetContent).selenium.binary_name
|
|
$seleniumFileName = "$seleniumBinaryName.jar"
|
|
|
|
$seleniumDownloadUrl = Get-GitHubPackageDownloadUrl `
|
|
-RepoOwner "SeleniumHQ" `
|
|
-RepoName "selenium" `
|
|
-BinaryName "$seleniumBinaryName" `
|
|
-Version $seleniumMajorVersion `
|
|
-UrlFilter "*{BinaryName}-{Version}.jar"
|
|
|
|
Start-DownloadWithRetry -Url $seleniumDownloadUrl -Name $seleniumFileName -DownloadPath $seleniumDirectory
|
|
|
|
# Create an empty file to retrive Selenium version
|
|
$seleniumFullVersion = $seleniumDownloadUrl.Split("-")[1].Split("/")[0]
|
|
New-Item -Path $seleniumDirectory -Name "$seleniumBinaryName-$seleniumFullVersion"
|
|
|
|
# Add SELENIUM_JAR_PATH environment variable
|
|
$seleniumBinPath = Join-Path $seleniumDirectory $seleniumFileName
|
|
setx "SELENIUM_JAR_PATH" "$($seleniumBinPath)" /M
|
|
|
|
Invoke-PesterTests -TestFile "Browsers" -TestName "Selenium"
|