TestCase - Documentation

Index

The Events Firing Functionality Description

Since TestCase v. 1.0, the library provides the events test fires functionality. That means you can fire your own test events on your elements in the testing environment and test your page response right in your test-cases.

The functionality is generally crossbrowsing. It was tested with FF (1.5, 2.0, 3.0), Opera, IE (6 and 7), Konqueror and Safari. But case all of the browses are different, with own unique "features", some stuffs works different and some don't work at all. So be ware.

With Safari and Konqueror, currently, you cannot specify the key-codes on the keyboard events correctly. The events will get fired up, but you won't get any correct key-codes from them. Looking forward for a solution.

You may pass the following options with the mouse events

With the keyboard events, you can specify the follwoing options

The usage by itself is pretty simple and plain. Just pass your element in some of the methods, and if you are trying to call the common mouse/keyboar event firing methods, then specify the event-name. Downcased and without the 'on' prefix. Like that. this.fire_click('element-id'); this.fire_mouse_event(element, 'mouseover', { shiftKey: true }); this.fire_key_press(element, Event.KEY_ESC); var event = this.fire_key_event('element', 'keydown', Event.KEY_UP);

Note that each of the methods return the fired event object. So you can get it right there if you like.

That's all, enjoy!