[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
This commit is contained in:
Maxim Lobanov
2021-09-07 10:56:55 +03:00
committed by GitHub
parent 19717dd758
commit 4394e4414f
7 changed files with 31 additions and 6 deletions

View File

@@ -0,0 +1,16 @@
#!/bin/bash -e -o pipefail
echo "Enabling safari driver..."
# https://developer.apple.com/documentation/webkit/testing_with_webdriver_in_safari
# Safaris 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"
# "|| true" is needed to suppress exit code 1 in case if property or file doesn't exist
/usr/libexec/PlistBuddy -c 'delete AllowRemoteAutomation' $safari_plist || true
/usr/libexec/PlistBuddy -c 'add AllowRemoteAutomation bool true' $safari_plist
invoke_tests "Browsers" "Safari"