Skip to content

hugs/appium

 
 

Repository files navigation

Appium

Build Status

Appium is a test automation tool for use with native and hybrid iOS applications. It uses the webdriver JSON wire protocol to drive Apple's UIAutomation. Appium is based on Dan Cuellar's work on iOS Auto.

There are two big benefits to testing with Appium:

  1. Appium uses Apple's UIAutomation library under the hood to perform the automation, which means you do not have to recompile your app or modify in any way to be able to test automate it.
  2. With Appium, you are able to write your test in your choice of programming language, using the Selenium WebDriver API and language-specific client libraries. If you only used UIAutomation, you would be required to write tests in JavaScript, and only run the tests through the Instruments application. With Appium, you can test your native iOS app with any language, and with your preferred dev tools.

Prerequisite

Install node.js which come with its package manager npm. Change into your local repo clone and install packages using following commands:

> sudo npm install -g mocha
> sudo npm install -g grunt
> npm install

First two commands will make test and build tools available (sudo may not be necessary if you installed node.js through homebrew). The third command will install all app dependencies.

To avoid a security dialog that can appear when launching your iOS app, you need to modify your /etc/authorization file. You can do this by settings the element following <allow-root> under <key>system.privilege.taskport</key> to <true/> or by running the supplied grunt task (at your own risk)

> sudo grunt authorize

Quick Start

Download UICatalog:

> grunt downloadApp

Build an app:

> grunt buildApp:UICatalog
> grunt buildApp:TestApp

Run functional tests against TestApp:

> grunt functional

Run unit tests against TestApp:

> grunt unit

Run tests against UICatalog:

> grunt uicatalog

Run all tests against TestApp and UICatalog:

> grunt test

Before commiting code please run grunt to run test and check your changes against code quality standards:

> grunt
Running "lint:all" (lint) task
Lint free.

Done, without errors.

More things, low-level things

If you want to run the appium server and have it listen indefinitely, you can do one of the following:

> grunt appium:TestApp
> grunt appium:UICatalog

Then you can, e.g., run individual testfiles using Mocha directly:

> mocha -t 60000 -R spec test/functional/simple.js

Do you like getting close to the metal? Or are you trying to run this from a script with a custom app? Start appium without grunt from the command line (see parser.js for more CLI arguments):

> node server.js --app /absolute/path/to/app -V 1

In this case, the app has to be compiled for the iphone simulator, e.g., by doing this in the Xcode project:

> xcodebuild -sdk iphonesimulator6.0

This will create a directory called build/Release-iphonesimulator in your Xcode project, and this dir will contain the .app package you need to send to the server.

You can also run against an app on an actual device by plugging the device in and passing the udid argument to server.js in the command above.

Using with a Bitbeambot

AWAITING THE FUTURE

Contributing

Fork the project, make a change, and send a pull request!

Mailing List

Discussion Group

Releases

No releases published

Packages

No packages published