|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.googlecode.autoandroid.positron.junit4.TestCase
public class TestCase
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.googlecode.autoandroid.positron.PositronAPI |
---|
PositronAPI.Intents, PositronAPI.Key, PositronAPI.Menu, PositronAPI.Motion |
Field Summary | |
---|---|
protected static PositronAPI |
positron
|
Constructor Summary | |
---|---|
TestCase()
|
Method Summary | |
---|---|
void |
backup()
Backup all databases in the tested application. |
void |
backup(String database)
Backup the given database. |
boolean |
booleanAt(int depth,
String path)
Evaluate the ViewShorthand path starting from the activity at the given depth. |
boolean |
booleanAt(String path)
Evaluate the ViewShorthand path starting from the current activity. |
void |
click()
sendKeyDownUp(KEYCODE_DPAD_CENTER) |
boolean |
contextMenu(int id)
invokeContextMenuActionSync with the current activity. |
boolean |
contextMenu(int id,
int flag)
invokeContextMenuActionSync with the current activity. |
boolean |
contextMenu(int depth,
int id,
int flag)
invokeContextMenuActionSync with the activity at the given depth on the stack, resuming momentarily if necessary. |
double |
doubleAt(int depth,
String path)
Evaluate the ViewShorthand path starting from the activity at the given depth. |
double |
doubleAt(String path)
Evaluate the ViewShorthand path starting from the current activity. |
void |
drag(float startX,
float startY,
float endX,
float endY)
Drag from one point on the screen to another. |
void |
drag(String start,
String end)
Drag from the center of one view to the center of another. |
void |
finish()
Finish the current activity. |
void |
finish(int depth)
Activity.finish() the activity with the given depth on the stack. |
void |
finishAll()
Finish all detected activities on the stack. |
void |
flick(float x,
float y)
Flick the trackball in the given direction. |
float |
floatAt(int depth,
String path)
Evaluate the ViewShorthand path starting from the activity at the given depth. |
float |
floatAt(String path)
Evaluate the ViewShorthand path starting from the current activity. |
int |
intAt(int depth,
String path)
Evaluate the ViewShorthand path starting from the activity at the given depth. |
int |
intAt(String path)
Evaluate the ViewShorthand path starting from the current activity. |
boolean |
menu(int id)
invokeMenuAction with the current activity. |
boolean |
menu(int id,
int flag)
invokeMenuAction with the current activity. |
boolean |
menu(int depth,
int id,
int flag)
invokeMenuActionSync with the activity at the given depth on the stack, resuming momentarily if necessary. |
void |
pause()
Pause execution of the target package. |
boolean |
paused()
Is the target package paused? |
void |
press(Object... keys)
sendKeyDownUpSync on all keys in order, resuming momentarily if necessary. |
void |
quit()
Stop the positron instrumentation and cleanup. |
void |
restore()
Restore all databases in the tested application that have backups. |
void |
restore(String database)
Restore the given database from a previous backup call. |
void |
resume()
Resume executing the target package if it has been paused. |
void |
sendCharacter(int keyCode)
sendCharacterSync, resuming momentarily if necessary. |
void |
sendKey(int action,
int code)
sendKeySync, resuming momentarily if necessary. |
void |
sendKey(long eventTimeAfterDown,
int action,
int code,
int repeat)
sendKeySync, resuming momentarily if necessary. |
void |
sendKey(long eventTimeAfterDown,
int action,
int code,
int repeat,
int metaState)
sendKeySync, resuming momentarily if necessary. |
void |
sendKey(long eventTimeAfterDown,
int action,
int code,
int repeat,
int metaState,
int device,
int scancode)
sendKeySync, resuming momentarily if necessary. |
void |
sendKey(long eventTimeAfterDown,
int action,
int code,
int repeat,
int metaState,
int device,
int scancode,
int flags)
sendKeySync, resuming momentarily if necessary. |
void |
sendKeyDownUp(int key)
sendKeyDownUpSync, resuming momentarily if necessary. |
void |
sendPointer(int action,
float x,
float y)
Send a MotionEvent via sendPointerSync, resuming momentarily if needed. |
void |
sendPointer(int action,
float x,
float y,
int metaState)
Send a MotionEvent via sendPointerSync, resuming momentarily if needed. |
void |
sendPointer(long eventTimeAfterDown,
int action,
float x,
float y,
float pressure,
float size,
int metaState,
float xPrecision,
float yPrecision,
int deviceId,
int edgeFlags)
Send a MotionEvent via sendPointerSync, resuming momentarily if needed. |
void |
sendPointer(long eventTimeAfterDown,
int action,
float x,
float y,
int metaState)
Send a MotionEvent via sendPointerSync, resuming momentarily if needed. |
void |
sendString(String text)
sendStringSync, resuming momentarily if necessary. |
void |
sendTrackball(int action,
float x,
float y)
Send a MotionEvent via sendTrackballEventSync, resuming momentarily if needed. |
void |
sendTrackball(int action,
float x,
float y,
int metaState)
Send a MotionEvent via sendTrackballEventSync, resuming momentarily if needed. |
void |
sendTrackball(long eventTimeAfterDown,
int action,
float x,
float y,
float pressure,
float size,
int metaState,
float xPrecision,
float yPrecision,
int deviceId,
int edgeFlags)
Send a MotionEvent via sendTrackballEventSync, resuming momentarily if needed. |
void |
sendTrackball(long eventTimeAfterDown,
int action,
float x,
float y,
int metaState)
Send a MotionEvent via sendTrackballEventSync, resuming momentarily if needed. |
void |
sql(String database,
String script)
Execute the given Sql script. |
void |
startActivity(String action)
startActivitySync, resuming momentarily if necessary. |
void |
startActivity(String packageName,
String className)
startActivitySync, resuming momentarily if necessary. |
void |
startActivity(String action,
String[] categories)
startActivitySync, resuming momentarily if necessary. |
void |
startActivity(String action,
String[] categories,
int[] flags)
startActivitySync, resuming momentarily if necessary. |
void |
startActivity(String action,
String data,
String type)
startActivitySync, resuming momentarily if necessary. |
void |
startActivity(String action,
String data,
String type,
String[] categories,
int[] flags)
startActivitySync, resuming momentarily if necessary. |
String |
stringAt(int depth,
String path)
Evaluate the ViewShorthand path starting from the activity at the given depth. |
String |
stringAt(String path)
Evaluate the ViewShorthand path starting from the current activity. |
void |
tearDown()
|
void |
touch(float x,
float y)
Touch the screen (or click the pointer) at the given location. |
void |
touch(String path)
Touch the screen (or click the pointer) at the center of the view with the given path. |
boolean |
waitFor(int depth,
String path,
String value,
long timeout)
Wait until value.equals(stringAt(depth, path)) or the given timeout expires, then pause(). |
boolean |
waitFor(String path,
String value,
long timeout)
Wait until value.equals(stringAt(path)) or the given timeout expires, then pause(). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static PositronAPI positron
Constructor Detail |
---|
public TestCase()
Method Detail |
---|
public void tearDown() throws Exception
Exception
public void backup()
PositronAPI
backup
in interface PositronAPI
public void backup(String database)
PositronAPI
backup
in interface PositronAPI
public boolean booleanAt(int depth, String path)
PositronAPI
booleanAt
in interface PositronAPI
public boolean booleanAt(String path)
PositronAPI
booleanAt
in interface PositronAPI
public void click()
PositronAPI
click
in interface PositronAPI
public double doubleAt(int depth, String path)
PositronAPI
doubleAt
in interface PositronAPI
public double doubleAt(String path)
PositronAPI
doubleAt
in interface PositronAPI
public void finish()
PositronAPI
finish
in interface PositronAPI
public void finish(int depth)
PositronAPI
finish
in interface PositronAPI
public void finishAll()
PositronAPI
finishAll
in interface PositronAPI
public float floatAt(int depth, String path)
PositronAPI
floatAt
in interface PositronAPI
public float floatAt(String path)
PositronAPI
floatAt
in interface PositronAPI
public int intAt(int depth, String path)
PositronAPI
intAt
in interface PositronAPI
public int intAt(String path)
PositronAPI
intAt
in interface PositronAPI
public boolean menu(int depth, int id, int flag)
PositronAPI
menu
in interface PositronAPI
public boolean menu(int id, int flag)
PositronAPI
menu
in interface PositronAPI
public boolean menu(int id)
PositronAPI
menu
in interface PositronAPI
public boolean contextMenu(int depth, int id, int flag)
PositronAPI
contextMenu
in interface PositronAPI
public boolean contextMenu(int id, int flag)
PositronAPI
contextMenu
in interface PositronAPI
public boolean contextMenu(int id)
PositronAPI
contextMenu
in interface PositronAPI
public void pause()
PositronAPI
pause
in interface PositronAPI
public boolean paused()
PositronAPI
paused
in interface PositronAPI
public void press(Object... keys)
PositronAPI
press
in interface PositronAPI
keys
- A mixture of ints and Strings. ints are sent with sendKeyDownUpSync,
Strings are send with sendStringSync.public void quit()
PositronAPI
quit
in interface PositronAPI
public void restore()
PositronAPI
restore
in interface PositronAPI
public void restore(String database)
PositronAPI
restore
in interface PositronAPI
public void resume()
PositronAPI
resume
in interface PositronAPI
public void sendCharacter(int keyCode)
PositronAPI
sendCharacter
in interface PositronAPI
public void sendKey(int action, int code)
PositronAPI
sendKey
in interface PositronAPI
public void sendKey(long eventTimeAfterDown, int action, int code, int repeat)
PositronAPI
sendKey
in interface PositronAPI
public void sendKey(long eventTimeAfterDown, int action, int code, int repeat, int metaState)
PositronAPI
sendKey
in interface PositronAPI
public void sendKey(long eventTimeAfterDown, int action, int code, int repeat, int metaState, int device, int scancode)
PositronAPI
sendKey
in interface PositronAPI
public void sendKey(long eventTimeAfterDown, int action, int code, int repeat, int metaState, int device, int scancode, int flags)
PositronAPI
sendKey
in interface PositronAPI
public void sendKeyDownUp(int key)
PositronAPI
sendKeyDownUp
in interface PositronAPI
public void sendString(String text)
PositronAPI
sendString
in interface PositronAPI
public void sql(String database, String script)
PositronAPI
sql
in interface PositronAPI
public void startActivity(String action, String data, String type, String[] categories, int[] flags)
PositronAPI
startActivity
in interface PositronAPI
public void startActivity(String action, String data, String type)
PositronAPI
startActivity
in interface PositronAPI
public void startActivity(String packageName, String className)
PositronAPI
startActivity
in interface PositronAPI
public void startActivity(String action, String[] categories, int[] flags)
PositronAPI
startActivity
in interface PositronAPI
public void startActivity(String action, String[] categories)
PositronAPI
startActivity
in interface PositronAPI
public void startActivity(String action)
PositronAPI
startActivity
in interface PositronAPI
public String stringAt(int depth, String path)
PositronAPI
stringAt
in interface PositronAPI
public String stringAt(String path)
PositronAPI
stringAt
in interface PositronAPI
public void touch(float x, float y)
PositronAPI
touch
in interface PositronAPI
public void drag(float startX, float startY, float endX, float endY)
PositronAPI
drag
in interface PositronAPI
public void sendPointer(int action, float x, float y)
PositronAPI
sendPointer
in interface PositronAPI
public void sendPointer(int action, float x, float y, int metaState)
PositronAPI
sendPointer
in interface PositronAPI
public void sendPointer(long eventTimeAfterDown, int action, float x, float y, int metaState)
PositronAPI
sendPointer
in interface PositronAPI
eventTimeAfterDown
- Time in milliseconds since the initial down event.action
- One of the MotionEvent action constants.x
- The x coordinate.y
- The y coordinate.metaState
- Any meta / modifier keys to hold while the sending the event.public void sendPointer(long eventTimeAfterDown, int action, float x, float y, float pressure, float size, int metaState, float xPrecision, float yPrecision, int deviceId, int edgeFlags)
PositronAPI
sendPointer
in interface PositronAPI
public void flick(float x, float y)
PositronAPI
flick
in interface PositronAPI
public void sendTrackball(int action, float x, float y)
PositronAPI
sendTrackball
in interface PositronAPI
public void sendTrackball(int action, float x, float y, int metaState)
PositronAPI
sendTrackball
in interface PositronAPI
public void sendTrackball(long eventTimeAfterDown, int action, float x, float y, int metaState)
PositronAPI
sendTrackball
in interface PositronAPI
eventTimeAfterDown
- Time in milliseconds since the initial down event.action
- One of the MotionEvent action constants.x
- The x coordinate.y
- The y coordinate.metaState
- Any meta / modifier keys to hold while the sending the event.public void sendTrackball(long eventTimeAfterDown, int action, float x, float y, float pressure, float size, int metaState, float xPrecision, float yPrecision, int deviceId, int edgeFlags)
PositronAPI
sendTrackball
in interface PositronAPI
public void touch(String path)
PositronAPI
touch
in interface PositronAPI
public boolean waitFor(String path, String value, long timeout)
PositronAPI
waitFor
in interface PositronAPI
path
- The view shorthand expression to watch.value
- The value to wait for.timeout
- Time in milliseconds to wait before giving up and pausing anyway.
public boolean waitFor(int depth, String path, String value, long timeout)
PositronAPI
waitFor
in interface PositronAPI
depth
- The depth down the activity stackpath
- The view shorthand expression to watch.value
- The value to wait for.timeout
- Time in milliseconds to wait before giving up and pausing anyway.
public void drag(String start, String end)
PositronAPI
drag
in interface PositronAPI
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |