Class
caplin.testing

Utils

Utility class containing static methods that can be useful for tests.

Constructor Summary

Attributes Name and Description
caplin.testing.Utils()

Method Summary

Attributes Name and Description
<static> void fireDomEvent(DOM Element eElement, String sEvent, String sChar)

Fires a DOM Event in a cross Browser compatible way.

<static> void fireKeyEvent(DOM Element eElement, String sEvent, String sChar, Map mValues)

Fires a DOM KeyboardEvent in a cross Browser compatible way.

<static> void fireMouseEvent(DOM Element eElement, String sEvent, Map mValues)

Fires a DOM MouseEvents in a cross Browser compatible way.

<static> void fireScrollEvent(DOM Element eElement)

Fires a DOM scroll event in a cross Browser compatible way.

<static> Number getKeyCodeForChar(String sChar)

Returns the Keycode of a letter.

<static> void loadCSSAndAttachToPage(Array pCSSFiles)

Attaches CSS files to the test page.

<static> void removeLoadedAndAttachedCSSFromPage(Array pCSSFiles)

Attaches CSS files to the test page.

Constructor Detail

caplin.testing.Utils()

Method Detail

<static> void fireDomEvent(DOM Element eElement, String sEvent, String sChar)

Fires a DOM Event in a cross Browser compatible way.

Parameters
DOM Element eElement The DOM Element the Event is fired from
String sEvent The Event to be fired without "on", e.g. "click", "keydown"
String sChar Optional an character associated with typing events

<static> void fireKeyEvent(DOM Element eElement, String sEvent, String sChar, Map mValues)

Fires a DOM KeyboardEvent in a cross Browser compatible way.

Parameters
DOM Element eElement The DOM Element the Event is fired from
String sEvent The Event to be fired without "on", e.g. "keydown"
String sChar a character associated with typing events.
Map mValues a map of values, passed in to initKeyboardEvent, associated with typing events.

<static> void fireMouseEvent(DOM Element eElement, String sEvent, Map mValues)

Fires a DOM MouseEvents in a cross Browser compatible way.

Parameters
DOM Element eElement The DOM Element the Event is fired from
String sEvent The Event to be fired without "on", e.g. "click"
Map mValues a map of values, passed in to initMouseEvent, associated with mouse events.

<static> void fireScrollEvent(DOM Element eElement)

Fires a DOM scroll event in a cross Browser compatible way.

Parameters
DOM Element eElement The DOM Element the Event is fired from

<static> Number getKeyCodeForChar(String sChar)

Returns the Keycode of a letter.

Parameters
String sChar a single Character to get the Keycode for
Returns
{Number} keyCode The key code for the specified char.

<static> void loadCSSAndAttachToPage(Array pCSSFiles)

Attaches CSS files to the test page. Cleaning them up is done via the removeLoadedAndAttachedCSSFromPage method.

Parameters
Array pCSSFiles list of css file URLs to be loaded into the test page.

<static> void removeLoadedAndAttachedCSSFromPage(Array pCSSFiles)

Attaches CSS files to the test page. Cleaning them up is done via the removeLoadedAndAttachedCSSFromPage method.

Parameters
Array pCSSFiles list of css file URLs to be loaded into the test page.