2019-12-19 16:19:58 +03:00
|
|
|
################################################################################
|
|
|
|
|
## File: Install-Selenium.ps1
|
|
|
|
|
## Desc: Install Selenium Server standalone
|
|
|
|
|
################################################################################
|
|
|
|
|
|
2021-08-20 16:55:04 +03:00
|
|
|
# Create Selenium directory
|
2020-05-06 07:20:39 +03:00
|
|
|
$seleniumDirectory = "C:\selenium\"
|
|
|
|
|
$seleniumFileName = "selenium-server-standalone.jar"
|
|
|
|
|
|
|
|
|
|
New-Item -ItemType directory -Path $seleniumDirectory
|
|
|
|
|
|
2021-08-20 16:55:04 +03:00
|
|
|
# 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"
|
|
|
|
|
|
2020-05-06 07:20:39 +03:00
|
|
|
Start-DownloadWithRetry -Url $seleniumReleaseUrl -Name $seleniumFileName -DownloadPath $seleniumDirectory
|
2019-12-19 16:19:58 +03:00
|
|
|
|
2021-08-20 16:55:04 +03:00
|
|
|
# Add SELENIUM_JAR_PATH environment variable
|
2020-05-06 07:20:39 +03:00
|
|
|
$seleniumBinPath = Join-Path $seleniumDirectory $seleniumFileName
|
2020-01-10 11:26:40 +03:00
|
|
|
setx "SELENIUM_JAR_PATH" "$($seleniumBinPath)" /M
|
2020-07-20 18:57:00 +03:00
|
|
|
|
2021-08-20 16:55:04 +03:00
|
|
|
Invoke-PesterTests -TestFile "Browsers" -TestName "Selenium"
|