Package com :: Package dtmilano :: Package android :: Module culebron :: Class Culebron |
[hide private]
[frames] | no frames]

# Class Culebron

source code

Instance Methods | [hide private]
__init__(self, vc, device, serialno, printOperation, scale=1, concertina=False) Culebron constructor. | source code
printGridInfo(self) | source code
takeScreenshotAndShowItOnWindow(self) Takes the current screenshot and shows it on the main window. | source code
createMessageArea(self, width, height) | source code
showMessageArea(self) | source code
hideMessageArea(self) | source code
toggleMessageArea(self) | source code
message(self, text, background=None) | source code
toast(self, text, background=None, timeout=5) | source code
createVignette(self, width, height) | source code
showVignette(self) | source code
hideVignette(self) | source code
deleteVignette(self) | source code
showPopupMenu(self, event) | source code
showHelp(self) | source code
showSideFrame(self) | source code
hideSideFrame(self) | source code
showViewTree(self) | source code
hideViewTree(self) | source code
showViewDetails(self) | source code
hideViewDetails(self) | source code
viewTreeItemClicked(self, event) | source code
populateViewTree(self, view) Populates the View tree. | source code
findTargets(self) Finds the target Views (i.e. | source code
getViewContainingPointAndGenerateTestCondition(self, x, y) | source code
findViewContainingPointInTargets(self, x, y) | source code
getViewContainingPointAndTouch(self, x, y) | source code
pressBack(self) | source code
pressHome(self) | source code
pressRecentApps(self) | source code
setText(self, v, text) | source code
touchView(self, v, root=None) | source code
touchPoint(self, x, y) Touches a point in the device screen. | source code
longTouchPoint(self, x, y) Long-touches a point in the device screen. | source code
longTouchView(self, v, root=None) | source code
onButton1Pressed(self, event) | source code
onCtrlButton1Pressed(self, event) | source code
onButton2Pressed(self, event) | source code
onButton3Pressed(self, event) | source code
command(self, keycode) Presses a key. | source code
onKeyPressed(self, event) | source code
wake(self) | source code
refresh(self) | source code
cancelOperation(self) Cancels the ongoing operation if any. | source code
printStartActivityAtTop(self) | source code
onCtrlA(self, event) | source code
showDragDialog(self) | source code
onCtrlD(self, event) | source code
onCtrlF(self, event) | source code
saveSnapshot(self) Saves the current shanpshot to the specified file. | source code
saveViewSnapshot(self, view) Saves the View snapshot. | source code
toggleTouchPointDip(self) Toggles the touch point operation using Unit.DIP. | source code
onCtrlI(self, event) | source code
toggleLongTouchPoint(self) Toggles the long touch point operation. | source code
toggleLongTouchView(self) Toggles the long touch View operation. | source code
onCtrlL(self, event) | source code
toggleTouchPoint(self) Toggles the touch point operation using the units specified in `coordinatesUnit`. | source code
toggleTouchPointPx(self) | source code
onCtrlP(self, event) | source code
onCtrlQ(self, event) | source code
quit(self) | source code
showSleepDialog(self) | source code
onCtrlS(self, event) | source code
startGeneratingTestCondition(self) | source code
finishGeneratingTestCondition(self) | source code
toggleGenerateTestCondition(self) Toggles generating test condition | source code
onCtrlT(self, event) | source code
onCtrlU(self, event) | source code
onCtrlV(self, event) | source code
toggleTargetZones(self) | source code
onCtrlZ(self, event) | source code
showControlPanel(self) | source code
onCtrlK(self, event) | source code
drag(self, start, end, duration, steps, units=`'``DIP``'`) | source code
enableEvents(self) | source code
disableEvents(self, permanently=False) | source code
toggleTargets(self) | source code
markTargets(self) | source code
markTarget(self, x1, y1, x2, y2, color=`'``#ff00ff``'`) @return the id of the rectangle added | source code
unmarkTarget(self, _id) | source code
unmarkTargets(self) | source code
setDragDialogShowed(self, showed) | source code
drawTouchedPoint(self, x, y) | source code
drawDragLine(self, x0, y0, x1, y1) | source code
executeCommandAndRefresh(self, command) | source code
changeLanguage(self) | source code
setOnTouchListener(self, listener) | source code
setGrab(self, state) | source code
mainloop(self) | source code
concertinaLoop(self) | source code
concertinaLoopCallback(self, dontinteract=False) | source code
getViewContainingPointAndLongTouch(self, x, y) | source code

Static Methods | [hide private]
checkSupportedSdkVersion(sdkVersion) | source code
checkDependencies() | source code
isClickableCheckableOrFocusable(v) | source code

Class Variables | [hide private]
| APPLICATION_NAME = ``'``Culebra``'``
| UPPERCASE_CHARS = ``'``ABCDEFGHIJKLMNOPQRSTUVWXYZ``'``
| KEYSYM_TO_KEYCODE_MAP = ``{``'``BackSpace``'``:` `'``BACK``'``,` `'``Down``'``:` `'``DPAD_DO``...``
| KEYSYM_CULEBRON_COMMANDS = ``{``'``F1``'``:` None`,` `'``F5``'``:` None`}``
| canvas = `None`
| imageId = `None`
| vignetteId = `None`
| areTargetsMarked = `False`
| isDragDialogShowed = `False`
| isGrabbingTouch = `False`
| isGeneratingTestCondition = `False`
| isTouchingPoint = `False`
| isLongTouchingPoint = `False`
| isLongTouchingView = `False`
| onTouchListener = `None`
| snapshotDir = ``'``/tmp``'``
| snapshotFormat = ``'``PNG``'``
| deviceArt = `None`
| dropShadow = `False`
| screenGlare = `False`
| osName = ``'``Linux``'`` The OS name.
| isDarwin = `False` Is it Mac OSX?

Instance Variables | [hide private]
| targets The list of target coordinates (x1, y1, x2, y2)
| targetViews The list of target Views

Method Details | [hide private]

### __init__(self, vc, device, serialno, printOperation, scale=1, concertina=False) (Constructor) | source code
Culebron constructor. Parameters: `vc` (ViewClient) - The ViewClient used by this Culebron instance. Can be `None` if no back-end is used. `device` (AdbClient) - The device `serialno` (str) - The device's serial number `printOperation` (method) - the method invoked to print operations to the script `scale` (float @:param concertina: bool @:type concertina: enable concertina mode (see documentation)) - the scale of the device screen used to show it on the window

### takeScreenshotAndShowItOnWindow(self) | source code
Takes the current screenshot and shows it on the main window. It also: sizes the window create the canvas set the focus enable the events create widgets finds the targets (as explained in findTargets) hides the vignette (that could have been showed before)

### findTargets(self) | source code
Finds the target Views (i.e. for touches).

### touchPoint(self, x, y) | source code
    Touches a point in the device screen.
    The generated operation will use the units specified in L{coordinatesUnit} and the
    orientation in L{vc.display['orientation']}.

### longTouchPoint(self, x, y) | source code
    Long-touches a point in the device screen.
    The generated operation will use the units specified in L{coordinatesUnit} and the
    orientation in L{vc.display['orientation']}.

### command(self, keycode) | source code
Presses a key. Generates the actual key press on the device and prints the line in the script.

### saveSnapshot(self) | source code
Saves the current shanpshot to the specified file. Current snapshot is the image being displayed on the main window.

### toggleTouchPointDip(self) | source code
Toggles the touch point operation using Unit.DIP. This invokes toggleTouchPoint.

### toggleLongTouchView(self) | source code
Toggles the long touch View operation. :return:

### toggleTouchPoint(self) | source code
Toggles the touch point operation using the units specified in `coordinatesUnit`. When there are Views (obtained from the back-end) we have to determine if the intention when something is touched on the window if we want to touch the View or the point. If there's no back-end, we don't allow self.isTouchingPoint to be disabled so we will never be attempting to touch Views.

Class Variable Details | [hide private]

  ### KEYSYM_TO_KEYCODE_MAP Value:
      {'BackSpace': 'BACK',
       'Down': 'DPAD_DOWN',
       'F12': 'F12',
       'Home': 'HOME',
       'Left': 'DPAD_LEFT',
       'Right': 'DPAD_RIGHT',
       'Up': 'DPAD_UP'}

  ### osName The OS name. We sometimes need specific behavior. Value:
      'Linux'