mirror of
https://github.com/actions/runner-images.git
synced 2025-12-20 06:35:47 +00:00
23 lines
978 B
PowerShell
23 lines
978 B
PowerShell
################################################################################
|
|
## File: Install-Selenium.ps1
|
|
## Desc: Install Selenium Server standalone
|
|
################################################################################
|
|
|
|
# Create Selenium directory
|
|
$seleniumDirectory = "C:\selenium\"
|
|
$seleniumFileName = "selenium-server-standalone.jar"
|
|
|
|
New-Item -ItemType directory -Path $seleniumDirectory
|
|
|
|
# Download Selenium
|
|
$url = "https://api.github.com/repos/SeleniumHQ/selenium/releases/latest"
|
|
[System.String] $seleniumReleaseUrl = (Invoke-RestMethod -Uri $url).assets.browser_download_url -match "selenium-server-standalone-.+.jar"
|
|
|
|
Start-DownloadWithRetry -Url $seleniumReleaseUrl -Name $seleniumFileName -DownloadPath $seleniumDirectory
|
|
|
|
# Add SELENIUM_JAR_PATH environment variable
|
|
$seleniumBinPath = Join-Path $seleniumDirectory $seleniumFileName
|
|
setx "SELENIUM_JAR_PATH" "$($seleniumBinPath)" /M
|
|
|
|
Invoke-PesterTests -TestFile "Browsers" -TestName "Selenium"
|