Support UI driven test for Android

Registered by Le Chi Thu

There is a open source project http://tema.cs.tut.fi/ which enable UI driven test of Android application. LAVA should support such tests.

example of test script - testing the calculator application.

import pexpect
import sys

def proc_ask(cmd, result="result: True"):
    proc.sendline(cmd)
    proc.expect(result)

cmd = "python tema.android-adapter.py -i DEFAULT"
try:
    proc = pexpect.spawn(cmd, timeout=10, logfile=sys.stdout)
    proc.expect("setup complete")

    proc_ask("PressKey KEYCODE_MENU")
    proc_ask("launchApp 'com.android.calculator2.Calculator'")
    proc_ask("UpdateScreen")

    try:
        proc_ask("LongTapObject 3,id/del")
    except:
        proc_ask("LongTapObject 3,id/clear")

    proc_ask("typetext '123'")
    proc_ask("tapobject id/plus")
    proc_ask("typetext '456'")
    proc_ask("tapobject id/equal")

    proc_ask("verifyText '579',id/display:::NO_ID/1")

    print "\nCalculate/1: checking 123+456=579... pass"
except:
    print "\nCalculate/1: checking 123+456=579... fail"

proc_ask("PressKey KEYCODE_HOME")

Blueprint information

Status:
Complete
Approver:
Andy Doan
Priority:
Undefined
Drafter:
Le Chi Thu
Direction:
Needs approval
Assignee:
Le Chi Thu
Definition:
Obsolete
Series goal:
Accepted for trunk
Implementation:
Unknown
Milestone target:
None
Completed by
Michael Hudson-Doyle

Related branches

Sprints

Whiteboard

[le-chi-thu, 2012-03-22] I picked part of Android support from the tema project and updated to work with ICS.
[doanac, 2012-04-11] We are going to put this on hold for a bit, until the Android team has more interest.

Meta:
Headline: TBD
Acceptance: TBD

(?)

Work Items

Work items:
Define work items: TODO

This blueprint contains Public information 
Everyone can see this information.