Skip to content
This repository has been archived by the owner on Jan 19, 2021. It is now read-only.

Latest commit

 

History

History
50 lines (38 loc) · 2.01 KB

android.md

File metadata and controls

50 lines (38 loc) · 2.01 KB

Nightwatch-Extra guide for iOS app test

Pre-requisites

  1. install Android Studio (follow steps from here).
  2. setup AVD and create the emulator will be used for testing.
  3. make sure emulator in use has the latest chrome browser. if now, follow here to install latest chrome apk

Usage

1. Create test entry in nightwatch.json

In order to run test in appium locally, you can start with adding following code block into nightwatch.json

"appiumandroidmweb": {
    "desiredCapabilities": {
        "browserName": "Chrome",
        "appiumVersion": "1.6.3",
        "platformName": "Android",
        "platformVersion": "7.0",
        "deviceName": "Pixel_API_24",
        "avd": "Pixel_API_24",
        "avdArgs": "-netfast -noaudio -no-boot-anim"
    },
    "selenium": {
        "start_process": false
    },
    "appium": {
        "start_process": true
    }
}

Notice that

  1. appiumVersion has to match the appium version you installed
  2. platformVersion has to match the emulator version you installed
  3. avd has to match the AVD name you created
  4. avdArgs is optional

PLEASE NOTE:

  1. If avd is present, appium will launch emulator automatically. However there might be a chance that appium will time out before the emulator is launched which will fail your test. We recommend you to launch the emulator before your test run first.

2. Config test entry

The allowed configuration for desiredCapabilities can be found here.

if appium.start_process is configured and is true, nightwatch-extra will launch appium automatically at http://${selenium_host}:${selenium_port}.

NOTE: appium is also a selenium server. so selenium.start_process and appium.start_process are mutually exclusive, meaning that you can only enable one at a time.