orwanec / wdio

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.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WDIO

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.

Usage

Chrome

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.

Firefox

Run the tests with Firefox:

docker-compose run --rm wdio firefox

Connect to Firefox via VNC:

open vnc://user:secret@localhost:5901

Safari

To run the tests with Safari on MacOS, follow these steps:

  1. Configure Safari to Enable WebDriver Support.

  2. Run safaridriver on port 4444:

    safaridriver -p 4444
  3. Run the tests with Safari:

    docker-compose run --rm wdio safari

Mobile Safari

To run the tests with Mobile Safari on iOS Simulator, follow these steps:

  1. Install Xcode from the Mac App Store.

  2. Install the Xcode Command Line Tools:

    xcode-select --install
  3. Install Node.JS and Carthage via Homebrew:

    brew install node carthage
  4. Make sure the necessary Appium dependencies for iOS testing are installed:

    npx appium-doctor --ios
  5. Install Appium Desktop.

  6. Open Appium Desktop and click on "Start Server":

    open -a appium
  7. Run the tests with Mobile Safari:

    docker-compose run --rm wdio mobile-safari

Mobile Chrome

To run the tests with Mobile Chrome on Android Simulator, follow these steps:

  1. Download Android Studio and on first start, follow the instructions to install the Android SDK and Emulator.

  2. 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
  3. Install Node.JS via Homebrew:

    brew install node
  4. Make sure the necessary Appium dependencies for Android testing are installed:

    npx appium-doctor --android
  5. Install Appium Desktop.

  6. Make sure to configure Appium with a Chromedriver version compatible with the version of Chrome running in your Android device.

  7. Open Appium Desktop and click on "Start Server":

    open -a appium
  8. Start an Android Virtual Device via

    Android Studio → Configure → AVD Manager

  9. Run the tests with Mobile Chrome:

    docker-compose run --rm wdio mobile-chrome

Cleanup

Stop and remove the docker-compose container set:

docker-compose down

License

Released under the MIT license.

Author

Sebastian Tschan

About

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.


Languages

Language:JavaScript 37.4%Language:Shell 21.2%Language:Python 18.9%Language:HTML 14.6%Language:Dockerfile 7.9%