|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface PositronAPI
A portable interface defining positron's features.
Nested Class Summary | |
---|---|
static interface |
PositronAPI.Intents
Constants from Intent. |
static interface |
PositronAPI.Key
Constants from KeyEvent. |
static interface |
PositronAPI.Menu
Constants from Menu. |
static interface |
PositronAPI.Motion
Constants from MotionEvent. |
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 |
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(). |
Method Detail |
---|
void backup()
void backup(String database)
boolean booleanAt(int depth, String path)
boolean booleanAt(String path)
void click()
double doubleAt(int depth, String path)
double doubleAt(String path)
void sql(String database, String script)
void finish()
void finish(int depth)
void finishAll()
float floatAt(int depth, String path)
float floatAt(String path)
int intAt(int depth, String path)
int intAt(String path)
boolean menu(int id)
boolean menu(int id, int flag)
boolean menu(int depth, int id, int flag)
boolean contextMenu(int id)
boolean contextMenu(int id, int flag)
boolean contextMenu(int depth, int id, int flag)
void pause()
boolean paused()
void press(Object... keys)
keys
- A mixture of ints and Strings. ints are sent with sendKeyDownUpSync,
Strings are send with sendStringSync.
IllegalArgumentException
- if something other than an int or String was passed.void quit()
void resume()
void restore(String database)
void restore()
void sendCharacter(int keyCode)
void sendKey(int action, int code)
void sendKey(long eventTimeAfterDown, int action, int code, int repeat)
void sendKey(long eventTimeAfterDown, int action, int code, int repeat, int metaState)
void sendKey(long eventTimeAfterDown, int action, int code, int repeat, int metaState, int device, int scancode)
void sendKey(long eventTimeAfterDown, int action, int code, int repeat, int metaState, int device, int scancode, int flags)
void sendKeyDownUp(int key)
void sendString(String text)
void startActivity(String action)
void startActivity(String packageName, String className)
void startActivity(String action, String data, String type)
void startActivity(String action, String data, String type, String[] categories, int[] flags)
void startActivity(String action, String[] categories)
void startActivity(String action, String[] categories, int[] flags)
String stringAt(int depth, String path)
String stringAt(String path)
void touch(float x, float y)
void touch(String path)
void drag(float startX, float startY, float endX, float endY)
void drag(String start, String end)
void sendPointer(int action, float x, float y)
void sendPointer(int action, float x, float y, int metaState)
void sendPointer(long eventTimeAfterDown, int action, float x, float y, int metaState)
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.void sendPointer(long eventTimeAfterDown, int action, float x, float y, float pressure, float size, int metaState, float xPrecision, float yPrecision, int deviceId, int edgeFlags)
void flick(float x, float y)
void sendTrackball(int action, float x, float y)
void sendTrackball(int action, float x, float y, int metaState)
void sendTrackball(long eventTimeAfterDown, int action, float x, float y, int metaState)
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.void sendTrackball(long eventTimeAfterDown, int action, float x, float y, float pressure, float size, int metaState, float xPrecision, float yPrecision, int deviceId, int edgeFlags)
boolean waitFor(String path, String value, long timeout)
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.
boolean waitFor(int depth, String path, String value, long timeout)
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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |