User interface: Testing
This is a framework for testing graphical applications. The two main parts of the framework are the L{Player<kiwi.ui.test.player.Player>} and the L{Recorder<kiwi.ui.test.recorder.Recorder>}.
The recorder listens to certain events happening inside the application and writes a script which later on can be played back by the player.
To record a test:
kiwi-ui-test --record=script.py application [arguments]
To play back a recorded test:
kiwi-ui-test script.py
Common routines used by other parts of the ui test framework.
Bases: gobject._gobject.GObject
Called when a GtkContainer is about to be traversed
Parsers all the children and listens for new children, which may be added at a later point.
Called when a GtkDialog is about to be traversed
Just parses the widgets embedded in the dialogs.
Called when a GtkMenuItem is about to be traversed
It does some magic to tie a stronger connection between toplevel menuitems and submenus, which later will be used.
User interface event recorder and serializer.
This module provides an interface for creating, listening to and saving events. It uses the gobject introspection base class kiwi.ui.test.common.WidgetIntrospecter to gather widgets, windows and other objects.
The user interfaces are saved in a format so they can easily be played back by simply executing the script through a standard python interpreter.
Bases: kiwi.ui.test.recorder.SignalEvent
This event represents a button click. Note that this will also work for GtkToggleButton, GtkRadioButton and GtkCheckButton.
alias of Button
Bases: kiwi.ui.test.recorder.SignalEvent
This event represents an activate event for a GtkEntry, eg when the user presses enter in a GtkEntry.
alias of Entry
Bases: kiwi.ui.test.recorder.SignalEvent
This event represents a content modification of a GtkEntry. When the user deletes, clears, adds, modifies the text this event will be created.
alias of Entry
Bases: object
Event is a base class for all events. An event represent a user change of an interactive widget. :cvar object_type: subclass for type, Recorder uses this to
automatically attach events to objects when they appear
This fetches the toplevel widget for a specific object, by default it assumes it’s a wiget subclass and calls get_toplevel() for the widget
Override this in a subclass.
Bases: kiwi.ui.test.recorder.SignalEvent
This event represents a click on a normal menu entry It’s sort of a hack to use button-press-event, instea of listening to activate, but we’ll get the active callback after the user specified callbacks are called, at which point it is already too late.
alias of ImageMenuItem
Bases: kiwi.ui.test.recorder.SignalEvent
This event represents a user click on a menu item. It could be a toplevel or a normal entry in a submenu.
alias of MenuItem
Bases: kiwi.ui.test.recorder.SignalEvent
This event represents a double click on a row in objectlist
alias of ObjectList
Bases: kiwi.ui.test.recorder.SignalEvent
This event represents a selection change on a kiwi.ui.objectlist.ObjectList, eg when the user selects or unselects a row. It is actually tied to the signal changed on GtkTreeSelection object.
alias of ObjectList
Bases: kiwi.ui.test.common.WidgetIntrospecter
Recorder takes care of attaching events to widgets, when the appear, and creates the events when the user is interacting with some widgets. When the tracked program is closed the events are serialized into a script which can be played back with help of kiwi.ui.test.player.Player.
Bases: kiwi.ui.test.recorder.Event
A SignalEvent is an Event which is tied to a GObject signal, Recorder uses this to automatically attach itself to a signal at which point this object will be instantiated.
Variables: | signal_name – signal to listen to |
---|
Calls connect on I{object} for signal I{signal_name}.
Parameters: |
|
---|
Bases: kiwi.ui.test.recorder.SignalEvent
This event represents a click on a normal toolbar button Hackish, see ImageMenuItemButtonReleaseEvent for more details.
alias of Button
Bases: kiwi.ui.test.recorder.Event
This event represents a user click on the close button in the window manager.