To run the tests with Safari on macOS, follow these steps:
-
Configure Safari to Enable WebDriver Support (see Testing with WebDriver in Safari):
safaridriver --enable
For Safari Technology Preview:
/Applications/Safari Technology Preview.app/Contents/MacOS/safaridriver --enable
-
Download and install MJPEG Server as
mjpeg-server
in yourPATH
and install FFmpeg and NGINX via Homebrew:brew install ffmpeg nginx
-
Add the
example
host to your/etc/hosts
file:printf '127.0.0.1\t%s\n' example | sudo tee -a /etc/hosts
-
Start
safaridriver
withnginx
as reverse proxy:bin/safaridriver.sh [-t]
Providing the
-t
argument starts thesafaridriver
for Safari Technology Preview and requires settingbrowserName
in ../conf/safari.js tosafari technology preview
. -
Start
mjpeg-server
to provide a MJPEG stream of the macOS desktop to capture video records of the test runs:bin/mjpeg-server.sh [screen index]
Providing a number as screen index (e.g.
2
) allows to use a different capture screen. Running the command without this argument will display a selection of available screens if there are more than one available.Please Note:
The Terminal application themjpeg-server
command is started from requires Screen Recording permissions:
System Preferences => Security & Privacy => Privacy => Screen Recording -
Run the tests with Safari:
docker-compose run --rm wdio conf/safari.js