Yahoo! UI Library

yuitest  2.5.2

Yahoo! UI Library > yuitest > YAHOO.util.UserAction

Show Private Show Protected

static Class YAHOO.util.UserAction

The UserAction object provides functions that simulate events occurring in the browser. Since these are simulated events, they do not behave exactly as regular, user-initiated events do, but can be used to test simple user interactions safely.

Methods

click

static void click ( target , options )
Simulates a click on a particular element.
Parameters:
target <HTMLElement> The element to click on.
options <Object> Additional event options (use DOM standard names).
Returns: void

dblclick

static void dblclick ( target , options )
Simulates a double click on a particular element.
Parameters:
target <HTMLElement> The element to double click on.
options <Object> Additional event options (use DOM standard names).
Returns: void

keydown

static void keydown ( target , options )
Simulates a keydown event on a particular element.
Parameters:
target <HTMLElement> The element to act on.
options <Object> Additional event options (use DOM standard names).
Returns: void

keypress

static void keypress ( target , options )
Simulates a keypress on a particular element.
Parameters:
target <HTMLElement> The element to act on.
options <Object> Additional event options (use DOM standard names).
Returns: void

keyup

static void keyup ( target , options )
Simulates a keyup event on a particular element.
Parameters:
target <HTMLElement> The element to act on.
options <Object> Additional event options (use DOM standard names).
Returns: void

mousedown

static void mousedown ( target , options )
Simulates a mousedown on a particular element.
Parameters:
target <HTMLElement> The element to act on.
options <Object> Additional event options (use DOM standard names).
Returns: void

mouseEvent

static void mouseEvent ( target , type , options )
Simulates a mouse event on a particular element.
Parameters:
target <HTMLElement> The element to click on.
type <String> The type of event to fire. This can be any one of the following: click, dblclick, mousedown, mouseup, mouseout, mouseover, and mousemove.
options <Object> Additional event options (use DOM standard names).
Returns: void

mousemove

static void mousemove ( target , options )
Simulates a mousemove on a particular element.
Parameters:
target <HTMLElement> The element to act on.
options <Object> Additional event options (use DOM standard names).
Returns: void

mouseout

static void mouseout ( target , options )
Simulates a mouseout event on a particular element. Use "relatedTarget" on the options object to specify where the mouse moved to. Quirks: Firefox less than 2.0 doesn't set relatedTarget properly, so toElement is assigned in its place. IE doesn't allow toElement to be be assigned, so relatedTarget is assigned in its place. Both of these concessions allow YAHOO.util.Event.getRelatedTarget() to work correctly in both browsers.
Parameters:
target <HTMLElement> The element to act on.
options <Object> Additional event options (use DOM standard names).
Returns: void

mouseover

static void mouseover ( target , options )
Simulates a mouseover event on a particular element. Use "relatedTarget" on the options object to specify where the mouse moved from. Quirks: Firefox less than 2.0 doesn't set relatedTarget properly, so fromElement is assigned in its place. IE doesn't allow fromElement to be be assigned, so relatedTarget is assigned in its place. Both of these concessions allow YAHOO.util.Event.getRelatedTarget() to work correctly in both browsers.
Parameters:
target <HTMLElement> The element to act on.
options <Object> Additional event options (use DOM standard names).
Returns: void

mouseup

static void mouseup ( target , options )
Simulates a mouseup on a particular element.
Parameters:
target <HTMLElement> The element to act on.
options <Object> Additional event options (use DOM standard names).
Returns: void


Copyright © 2007 Yahoo! Inc. All rights reserved.