2021-09-07 10:56:55 +03:00
|
|
|
|
#!/bin/bash -e -o pipefail
|
2023-11-28 02:25:03 +01:00
|
|
|
|
################################################################################
|
|
|
|
|
|
## File: install-safari.sh
|
|
|
|
|
|
## Desc: Install Safari browser
|
|
|
|
|
|
################################################################################
|
2021-09-07 10:56:55 +03:00
|
|
|
|
|
|
|
|
|
|
echo "Enabling safari driver..."
|
|
|
|
|
|
# https://developer.apple.com/documentation/webkit/testing_with_webdriver_in_safari
|
|
|
|
|
|
# Safari’s executable is located at /usr/bin/safaridriver
|
|
|
|
|
|
# Configure Safari to Enable WebDriver Support
|
|
|
|
|
|
sudo safaridriver --enable
|
|
|
|
|
|
|
|
|
|
|
|
echo "Enabling the 'Allow Remote Automation' option in Safari's Develop menu"
|
|
|
|
|
|
mkdir -p $HOME/Library/WebDriver
|
|
|
|
|
|
safari_plist="$HOME/Library/WebDriver/com.apple.Safari.plist"
|
2024-01-09 14:47:31 +01:00
|
|
|
|
# "|| true" is needed to suppress exit code 1 in case if property or file doesn't exist
|
2021-09-07 10:56:55 +03:00
|
|
|
|
/usr/libexec/PlistBuddy -c 'delete AllowRemoteAutomation' $safari_plist || true
|
|
|
|
|
|
/usr/libexec/PlistBuddy -c 'add AllowRemoteAutomation bool true' $safari_plist
|
|
|
|
|
|
|
2023-11-28 02:25:03 +01:00
|
|
|
|
invoke_tests "Browsers" "Safari"
|