Running UI Automation tests using Appium and Mocha
Now that we've got our tests defined, how do we start them? First, we need to ensure Appium is running. You should do this in its own session, since once started, you can't do anything else unless you stop the server:
appium
Tip
You can run appium &
to put Appium in the background on Linux and Mac OS X. The output still generates on the screen, so if you do put it in the background, you'll probably want to log the output, as follows: appium > output.log & 2>&1
.
Once Appium starts, it will wait for an automation test to be run. If we're using emulators or physical Android devices, we could start these tests now. However, for iOS, we need to start the WebKit Proxy (again, in another session) if testing on a physical device:
ios_webkit_debug_proxy -u <your device's UDID>:27753 -d
For our code tests, we'll use Mocha to run the tests themselves. However, we need to set some environment variables first:
# if using sh or bash...