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 element, String eventString, String character)

Fires a DOM Event in a cross Browser compatible way.

<static> void fireKeyEvent(DOM Element element, String eventString, String character, Map options)

Fires a DOM KeyboardEvent in a cross Browser compatible way.

<static> void fireMouseEvent(DOM Element element, String eventString, Map options)

Fires a DOM MouseEvents in a cross Browser compatible way.

<static> void fireScrollEvent(DOM Element element)

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

<static> Number getKeyCodeForChar(String character)

Returns the Keycode of a letter.

<static> void loadCSSAndAttachToPage(Array cssFiels)

Attaches CSS files to the test page.

<static> void removeLoadedAndAttachedCSSFromPage(Array cssFiles)

Attaches CSS files to the test page.

Constructor Detail

caplin.testing.Utils()

Method Detail

<static> void fireDomEvent(DOM Element element, String eventString, String character)

Fires a DOM Event in a cross Browser compatible way.

Parameters
DOM Element element The DOM Element the Event is fired from
String eventString The Event to be fired without 'on', e.g. 'click', 'keydown'
String character Optional A character associated with typing events

<static> void fireKeyEvent(DOM Element element, String eventString, String character, Map options)

Fires a DOM KeyboardEvent in a cross Browser compatible way.

Parameters
DOM Element element The DOM Element the Event is fired from
String eventString The Event to be fired without 'on', e.g. 'keydown'
String character a character associated with typing events.
Map options a map of values, passed in to initKeyboardEvent, associated with typing events.

<static> void fireMouseEvent(DOM Element element, String eventString, Map options)

Fires a DOM MouseEvents in a cross Browser compatible way.

Parameters
DOM Element element The DOM Element the Event is fired from
String eventString The Event to be fired without 'on', e.g. 'click'
Map options a map of values, passed in to initMouseEvent, associated with mouse events.

<static> void fireScrollEvent(DOM Element element)

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

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

<static> Number getKeyCodeForChar(String character)

Returns the Keycode of a letter.

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

<static> void loadCSSAndAttachToPage(Array cssFiels)

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

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

<static> void removeLoadedAndAttachedCSSFromPage(Array cssFiles)

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

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