Docker setup for WebdriverIO with automatic screenshots, image diffing and screen recording support for containerized versions of Chrome and Firefox.
Also includes MacOS host configs to test an app running in Docker with Safari Desktop as well as Safari Mobile and Chrome Mobile via Appium.
Run the tests with Chrome:
docker-compose run --rm wdio [chrome]
Connect to Chrome via VNC:
open vnc://user:secret@localhost:5900
Please Note:
To be able to see Chrome running via VNC or screen recordings, disable headless
mode in chrome.js.
Run the tests with Firefox:
docker-compose run --rm wdio firefox
Connect to Firefox via VNC:
open vnc://user:secret@localhost:5901
To run the tests with Safari on MacOS, follow these steps:
-
Run
safaridriver
on port4444
:safaridriver -p 4444
-
Run the tests with Safari:
docker-compose run --rm wdio safari
To run the tests with Mobile Safari on iOS Simulator, follow these steps:
-
Install Xcode from the Mac App Store.
-
Install the Xcode Command Line Tools:
xcode-select --install
-
Install Node.JS and Carthage via Homebrew:
brew install node carthage
-
Make sure the necessary Appium dependencies for iOS testing are installed:
npx appium-doctor --ios
-
Install Appium Desktop.
-
Open Appium Desktop and click on "Start Server":
open -a appium
-
Run the tests with Mobile Safari:
docker-compose run --rm wdio mobile-safari
To run the tests with Mobile Chrome on Android Simulator, follow these steps:
-
Download Android Studio and on first start, follow the instructions to install the Android SDK and Emulator.
-
Add the following lines to your
~/.profile
to make the JDK included in Android Studio and the installed Android SDK available to Appium:export JAVA_HOME='/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home' export PATH="$JAVA_HOME/bin:$PATH" export ANDROID_HOME=~/Library/Android/sdk
-
brew install node
-
Make sure the necessary Appium dependencies for Android testing are installed:
npx appium-doctor --android
-
Install Appium Desktop.
-
Make sure to configure Appium with a Chromedriver version compatible with the version of Chrome running in your Android device.
-
Open Appium Desktop and click on "Start Server":
open -a appium
-
Start an Android Virtual Device via
Android Studio → Configure → AVD Manager
-
Run the tests with Mobile Chrome:
docker-compose run --rm wdio mobile-chrome
Stop and remove the docker-compose container set:
docker-compose down
Released under the MIT license.