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\"
|
|
|
|
|
New-Item -ItemType directory -Path $seleniumDirectory
|
|
|
|
|
|
2021-10-28 22:17:05 +03:00
|
|
|
# Download Selenium
|
|
|
|
|
$seleniumMajorVersion = (Get-ToolsetContent).selenium.version
|
|
|
|
|
$seleniumBinaryName = (Get-ToolsetContent).selenium.binary_name
|
|
|
|
|
$seleniumFileName = "$seleniumBinaryName.jar"
|
2023-10-09 10:55:12 +02:00
|
|
|
|
|
|
|
|
$seleniumDownloadUrl = Get-GitHubPackageDownloadUrl `
|
|
|
|
|
-RepoOwner "SeleniumHQ" `
|
|
|
|
|
-RepoName "selenium" `
|
|
|
|
|
-BinaryName "$seleniumBinaryName" `
|
|
|
|
|
-Version $seleniumMajorVersion `
|
|
|
|
|
-UrlFilter "*{BinaryName}-{Version}.jar"
|
2021-08-20 16:55:04 +03:00
|
|
|
|
2021-10-15 11:36:47 +03:00
|
|
|
Start-DownloadWithRetry -Url $seleniumDownloadUrl -Name $seleniumFileName -DownloadPath $seleniumDirectory
|
2019-12-19 16:19:58 +03:00
|
|
|
|
2023-04-14 11:27:42 +02:00
|
|
|
# Create an empty file to retrive Selenium version
|
2021-10-28 22:17:05 +03:00
|
|
|
$seleniumFullVersion = $seleniumDownloadUrl.Split("-")[1].Split("/")[0]
|
|
|
|
|
New-Item -Path $seleniumDirectory -Name "$seleniumBinaryName-$seleniumFullVersion"
|
|
|
|
|
|
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"
|