Files
runner-images/images/macos/tests/Browsers.Tests.ps1
Maxim Lobanov 4394e4414f [macOS] Activate "Allow Remote Automation" Safari option during image generation (#3996)
* Move logic to activate "Allow Remote Automation" from base image to image gen scripts

* add shebang
2021-09-07 10:56:55 +03:00

45 lines
1.4 KiB
PowerShell

Describe "Chrome" {
It "Chrome" {
$chromeLocation = "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
$chromeLocation | Should -Exist
"'$chromeLocation' --version" | Should -ReturnZeroExitCode
}
It "Chrome Driver" {
"chromedriver --version" | Should -ReturnZeroExitCode
}
}
Describe "Edge" {
It "Microsoft Edge" {
$edgeLocation = "/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge"
$edgeLocation | Should -Exist
"'$edgeLocation' --version" | Should -ReturnZeroExitCode
}
It "Microsoft Edge Driver" {
"msedgedriver --version" | Should -ReturnZeroExitCode
}
}
Describe "Firefox" {
It "Firefox" {
$firefoxLocation = "/Applications/Firefox.app/Contents/MacOS/firefox"
$firefoxLocation | Should -Exist
"'$firefoxLocation' --version" | Should -ReturnZeroExitCode
}
It "Geckodriver" {
"geckodriver --version" | Should -ReturnZeroExitCode
}
}
Describe "Safari" {
It "'Allow Remote Automation' option is activated" {
$plistPath = "$env:HOME/Library/WebDriver/com.apple.Safari.plist"
$command = "/usr/libexec/PlistBuddy -c 'print AllowRemoteAutomation' $plistPath"
$plistPath | Should -Exist
$commandResult = Get-CommandResult $command
$commandResult.ExitCode | Should -Be 0
$commandResult.Output | Should -Be "true"
}
}