testmanager package implements all the functionality required by the testmanager application. In particular, it contains packages and modules to drive the GTK interface and handle the testing information needed in a testing project.
testmanager main application module
Application implementation
Run GTK main loop
Returns: | None |
---|
Load test data
Parameters: | widget (Gtk.ToolButton | Gtk.MenuItem) – Widget that emitted the clicked or the activate signal |
---|---|
Returns: | None |
Set widget sensitivity properly
Parameters: | file (ApplicationFile) – The file that emitted the opened signal |
---|---|
Returns: | None |
Close test data
Parameters: | widget (Gtk.ToolButton | Gtk.MenuItem) – Widget that emitted the clicked or the activate signal |
---|---|
Returns: | None |
Reset application state
Parameters: | file (ApplicationFile) – The file that emitted the opened signal |
---|---|
Returns: | None |
Save changes to opened file
Parameters: | widget (Gtk.ToolButton | Gtk.MenuItem) – Widget that emitted the clicked or the activate signal |
---|---|
Returns: | None |
Save changes to a new file
Parameters: | widget (Gtk.ToolButton | Gtk.MenuItem) – Widget that emitted the clicked or the activate signal |
---|---|
Returns: | None |
Set widget sensitivity properly
Parameters: | file (ApplicationFile) – The file that emitted the saved signal |
---|---|
Returns: | None |
Revert changes
Parameters: | widget (Gtk.ToolButton | Gtk.MenuItem) – Widget that emitted the clicked or the activate signal |
---|---|
Returns: | None |
Exit from application
Parameters: | widget (Gtk.ToolButton | Gtk.MenuItem) – Widget that emitted the clicked or the activate signal |
---|---|
Returns: | None |
Quit from application
Parameters: | window (gkt.Window) – Main application window |
---|---|
Returns: | None |
Check name server status
Parameters: | menuitem (Gtk.MenuItem) – The menuitem that emitted the activated signal |
---|---|
Returns: | None |
ApplicationFile object takes care of loading/saving data from/to a file
Load data from a file encoded in json format
Once the data has been loaded, the opened signal is emitted.
Parameters: | filename (str) – File to open |
---|---|
Returns: | None |
Save data to a file encoded in json format
Once the data has been loaded, the saved signal is emitted.
Parameters: |
|
---|---|
Returns: | None |
Revert changes
Since filename and data are cached, data file isn’t reloaded, but just the opened signal is emitted so that widgets are updated with the stored data.
Returns: | None |
---|
Close file and reset internal data
Filename and data are set to None to make clear that no file is opened and the closed signal i emitted so that widgets listening to it can be updated.
Returns: | None |
---|
Dialogs used in the application
Dialog with an interface defined in a .ui file and that can be run as a context manager
Disconnect all signal handlers
Parameters: | dialog (Gtk.Dialog) – The dialog that emitted the destroy signal |
---|---|
Returns: | None |
Name server dialog to check name server status
Handle dialog buttons activity
ResponseType.APPLY is the response id assigned to the refresh button so when that happens, a request to refresh the name server information will be made.
For all other responses, the dialog will be destroyed.
Parameters: |
|
---|---|
Returns: | None |
Update widget contents for every signal emitted by the NameServer object.
Parameters: |
|
---|---|
Returns: | None |
Server dialog to select on which hardware run a test case
Get selected server name
Returns: | Selected server name |
---|---|
Return type: | str |
Set ok button sensitivity
Parameters: | selection (Gtk.TreeSelection) – Treeview selection that emitted the selection-changed signal |
---|---|
Returns: | None |
Run test case on selected server if available
Parameters: |
|
---|
History package contains all the modules needed to handle the history of the actions taken by the user to modify test object data
History object captures signals with information to undo/redo user actions gracefully
Keep action information regarding all rows added to a test plan
Parameters: | |
---|---|
Returns: | None |
Keep action information regarding rows removed from a test plan
Parameters: | |
---|---|
Returns: | None |
Block signal handlers in a block of code
This is used to prevent new actions from being added to history when they happen as a result of clicking on undo/redo buttons
Returns: | None |
---|
Redo last undone action
Parameters: |
|
---|---|
Returns: | None |
Keep a record about the added row action
Parameters: |
|
---|---|
Returns: | None |
Keep a record about the removed row action
Parameters: |
|
---|---|
Returns: | None |
Keep action information regarding rows added to a test plan
Parameters: | |
---|---|
Returns: | None |
Keep action information regarding all rows removed from a test plan
Parameters: | |
---|---|
Returns: | None |
Keep action information regarding attributes changed in a tab
Parameters: |
|
---|---|
Returns: | None |
Undo last action
Parameters: |
|
---|---|
Returns: | None |
Action package contains all the action class definitions needed to undo/redo specific actions on test object data
Actions object keeps a record of all the actions that can be undone/redone
Append action to the list
Parameters: | action (Action (any of its subclasses)) – Action captured to be recorded |
---|---|
Returns: | None |
Clear all actions
Returns: | None |
---|
Clear history and filename information
Parameters: | file (ApplicationFile) – File that emitted the closed signal |
---|---|
Returns: | None |
Clear history information and keep filename
Parameters: | file (ApplicationFile) – File that emitted the opened signal |
---|---|
Returns: | None |
Set last saved action index
Parameters: | file (ApplicationFile) – File that emitted the saved signal |
---|---|
Returns: | None |
Redo last action
When the action is redone, no other actions can be added. This means that any event that happens when the action is redone is ignored and a new action is not added.
Returns: | None |
---|
Undo last action
When the action is undone, no other actions can be added. This means that any event that happens when the action is undone is ignored and a new action is not added.
Returns: | None |
---|
Action objects keep information about a single user action and are able to undo/redo it
TreeStore undo/redo for row addition/removal actions
Plan tab undo/redo for selection actions
Action objects that are able to undo/redo changes to tabs
Action objects that are able to undo/redo changes to tab attributes
Undo tab attribute change
Returns: | None |
---|
redo tab attribute change
Returns: | None |
---|
Action objects that are able to add/remove the selected rows to/from the desired test plan
Select test rows in the tab and add them to the plan
Returns: | None |
---|
Select test row in the tab and remove them from the plan
Returns: | None |
---|
Action objects that are able to remove (undo) or add (redo) the added rows to the desired plan as required
Undo row(s) addition to test plan
Returns: | None |
---|
Redo row(s) addition to test plan
Returns: | None |
---|
Action objects that are able to remove (undo) or add (redo) all the added rows to the desired plan as required
Action objects that are able to add (undo) or removed (redo) the added rows to the desired plan as required
Undo row(s) removal from test plan
Returns: | None |
---|
Redo row(s) removal from test plan
Returns: | None |
---|
Action objects that are able to add (undo) or remove (redo) all the removed rows to the desired plan as required
Networking modules to interact with Pyro4 objects
Name server proxy wrapper
Get name_server connection data and start refreshing it periodically
Returns: | None |
---|
Refresh connection information if no other update is already running
This method can be used to update data immediately by calling it directly or periodically by calling it through GLib.timeout_add* functions. In such a case, it will be executed forever since it always returns True.
Returns: | True |
---|---|
Return type: | bool |
Notebook package contains the class definitions needed to work with a notebook and their tabs
Gtk.Notebook wrapper that takes care of opening/closing tabs that display the contents of a row in any of the application models.
New tabs are opened when a row is activated in the treeview and closed when the tab close button is clicked or when the row that it displays is removed from the model
Close an existing tab
Parameters: | tab (Tab (any of its subclasses)) – The tab to be closed |
---|---|
Returns: | None |
Look for an already opened tab displaying a row
Parameters: | row (TreeModelRowWrapper) – Row displayed by the tab |
---|---|
Returns: | tab displaying row contents |
Return type: | Tab (any of its subclasses) |
Display row contents in a tab. A new tab will be created if the row is not being displayed in any existing tab. Otherwise, the tab will be just focused.
Parameters: | row (TreeModelRowWrapper) – Row to be displayed |
---|---|
Returns: | The tab created/focused |
Return type: | Tab (any of its subclasses) |
Close tab showing data for a row that no longer exists
Parameters: |
|
---|
Open tab for activated row so that its contents can be edited
Parameters: |
|
---|---|
Returns: | None |
Tab module contains the class definitions needed to work with all kind of test object related tabs in testmanager
Notebook tab with a close button
Tab shows the contents of a TreeView row
Close tab and save changes to row
Parameters: | button (Gtk.Button) – Button that emitted the clicked signal |
---|
Factory method to create tabs using the most suitable class
Parameters: |
|
---|---|
Returns: | New tab object |
Return type: | Tab (any of its subclasses) |
Raises : | ValueError when tab_type is not valid |
Save changes in tab to the model that contains the displayed row, disconnect all signal handlers and destroy widgets
Once the tab is destroyed, an attempt call them will still be made by Gtk when their associated signals are emitted. To avoid this, the handlers are cleanly disconnected.
Returns: | None |
---|
Save contents of the widgets in the tab to the row in the store
Each subclass must implement this method to save any additional information not displayed in other tabs
Get tab title
Returns: | Tab title |
---|---|
Return type: | str |
Tab that shows the contents of a LeftTreeStore row
Get description field
Returns: | Description field |
---|---|
Return type: | str |
Validate description, update it and save change to history
Parameters: | textbuffer (Gtk.TextBuffer) – The textbuffer that emitted the changed signal |
---|---|
Returns: | None |
Get name field
Returns: | None |
---|
Validate name, update it and save changes to history
Parameters: | name_entry (Gtk.Entry) – The entry widget that emitted the changed signal |
---|---|
Returns: | None |
Remove row displayed by this tab. The tab itself will be automatically closed after the row is removed
Parameters: | button (Gtk.Button) – Button that emitted the clicked signal |
---|---|
Returns: | None |
Save contents of the widgets in the tab to the row in the store
Each subclass must implement this method to save any additional information not displayed in other tabs
LeftTab that displays test suite data
Add a test case under the suite displayed by this tab
Parameters: | button (Gtk.Button) – Button that emitted the clicked signal |
---|---|
Returns: | None |
Add a test suite under the one displayed by this tab
Parameters: | button (Gtk.Button) – Button that emitted the clicked signal |
---|---|
Returns: | None |
Tab that displays test case data
Destroy tab widgets and all cached widgets from runners UI
Returns: | None |
---|
Get runner field
Returns: | Runner field |
---|---|
Return type: | str |
Validate runner, update it and save change to history
Parameters: | combobox (Gtk.ComboBox) – Combobox that emitted the changed signal |
---|---|
Returns: | None |
Save contents of the widgets in the tab to the row in the store
Returns: | None |
---|
Tab that displays hardware data
Add an inventory under the hardware displayed by this tab
Parameters: | button (gtk.Button) – Button that emitted the clicked signal |
---|---|
Returns: | None |
Validate name, update it and save changes to history
Parameters: | name_entry (gtk.Entry) – The entry widget that emitted the changed signal |
---|---|
Returns: | None |
Update status lavel for every signal emitted by the NameServer object.
Parameters: |
|
---|---|
Returns: | None |
LeftTab that displays hardware inventory data
Tab that displays test plan data
Move all tests from unselected_tests to selected_tests
Parameters: | button (Gtk.Button) – The button that emitted the clicked signal |
---|---|
Returns: | None |
Move selected rows from unselected_tests to selected_tests and add action to application history
Parameters: | button (Gtk.Button) – The button that emitted the clicked signal |
---|---|
Returns: | None |
Add a test suite under the one displayed by this tab
Parameters: | button (Gtk.Button) – Button that emitted the clicked signal |
---|---|
Returns: | None |
Move selected rows from unselected_tests to selected_tests
Returns: | Path information of the moved rows (both path and key path) |
---|---|
Return type: | list(tuple(tuple, KeyPath)) |
Move all tests from selected_tests to unselected_tests
Parameters: | button (Gtk.Button) – The button that emitted the clicked signal |
---|---|
Returns: | None |
Move selected tests from selected_tests to unselected_tests
Parameters: | button (Gtk.Button) – The button that emitted the clicked signal |
---|---|
Returns: | None |
Move selected rows from selected_tests to unselected_tests
Returns: | Key path of the rows that were moved |
---|---|
Return type: | list(KeyPath) |
Open test tab for row being activated
Parameters: |
|
---|
Save contents of the widgets in the tab to the row in the store
Returns: | None |
---|
Rows removed from all_tests are also removed from unselected/selected_test
Parameters: |
|
---|---|
Returns: | None |
Rows added to all_tests are also added to unselected_tests
Parameters: |
|
---|---|
Returns: | None |
Get a list of selected tests as displayed in the tab
Returns: | Whitelist containing all selected tests |
---|---|
Return type: | list |
Tab that displays test run results
Execute selected test
Parameters: | button (Gtk.Button) – Button that emitted the clicked signal |
---|---|
Returns: | None |
Get results as displayed in the tab
Returns: | Results for all test cases in the test run |
---|---|
Return type: | list |
Open tab for selected object
Parameters: |
|
---|
Save contents of the widgets in the tab to the row in the store
Returns: | None |
---|
Set execute button sensitivity
Parameters: | selection (Gtk.TreeSelection) – Treeview selection that emitted the selection-changed signal |
---|---|
Returns: | None |
Make sure that missing rows are marked as such
Parameters: |
|
---|---|
Returns: | None |
Make sure that existing rows aren’t marked as missing
Parameters: |
|
---|---|
Returns: | None |
tree package contains all the tree related modules needed to deal with tree-like data in a gtk application
Gtk.TreeView specialized classes
Gtk.TreeView wrapper
Get model used by this view
Returns: | model |
---|---|
Return type: | TreeStore |
TreeView wrapper that takes care of the buttons in the toolbar next to the treeview
Factory method used to create treeviews using the most suitable class
Parameters: |
|
---|---|
Returns: | New treeview object |
Return type: | |
Raises : | ValueError when treeview_type is not valid |
Set treeview toolbar buttons sensitivity
Parameters: | selection (Gtk.TreeSelection) – Treeview selection that emitted the selection-changed signal |
---|---|
Returns: | None |
Add a new row with default values
Parameters: | toolbutton (Gtk.ToolButton) – Toolbutton that emitted the clicked signal |
---|---|
Returns: | None |
Edit selected row contents in a tab
Parameters: | toolbutton (Gtk.ToolButton) – Toolbutton that emitted the clicked signal |
---|---|
Returns: | None |
Remove selected row and any related open tab
Parameters: | toolbutton (Gtk.ToolButton) – Toolbutton that emitted the clicked signal |
---|---|
Returns: | None |
Expand treeview to display rows being added
Parameters: |
|
---|---|
Returns: | None |
Make sure toolbar buttons sensitivity is correctly set when rows are deleted
When rows are deleted, selection does not always fire the ‘changed’ event, so here the callback is explicitly called to avoid problems with the toolbar buttons sensitivity
Parameters: |
|
---|
ToolbarTreeView that displays test cases hierarchy
Set treeview toolbar buttons sensitivity
Parameters: | selection (Gtk.TreeSelection) – Treeview selection that emitted the selection-changed signal |
---|---|
Returns: | None |
Raises : | ValueError when selected row type is not valid |
ToolbarTreeView that displays resources hierarchy
Set treeview toolbar buttons sensitivity
Parameters: | selection (Gtk.TreeSelection) – Treeview selection that emitted the selection-changed signal |
---|---|
Returns: | None |
Raises : | ValueError when selected row type is not valid |
ToolbarTreeView that displays test plans hierarchy
Set treeview toolbar buttons sensitivity
Parameters: | selection (Gtk.TreeSelection) – Treeview selection that emitted the selection-changed signal |
---|---|
Returns: | None |
Raises : | ValueError when selected row type is not valid |
TreeView for selecting tests in a plan tab
Set test plan selection buttons sensitivity
Parameters: | selection (Gtk.TreeSelection) – Treeview selection that emitted the selection-changed signal |
---|---|
Returns: | None |
Expand treeview to display rows being added and set test plan selection buttons sensitivity
Parameters: |
|
---|---|
Returns: | None |
Set test plan selection buttons sensitivity
When rows are deleted, selection does not always fire the ‘changed’ event, so here the callback is explicitly called to avoid problems with the buttons sensitivity
Parameters: |
|
---|
Tree model row-related classes
Gtk.TreeModelRow wrapper with some additional funcionality:
- Rows are compared by their contents
- Attribute access using column name (defined in TreeStore object)
Get next row in the tree
Returns: | Next row |
---|---|
Return type: | TreeModelRowWrapper |
Get parent row
Returns: | Parent row or None if there isn’t a parent row |
---|---|
Return type: | TreeModelRowWrapper | None |
Iterate through row children
Returns: | Children rows |
---|---|
Return type: | iterable(TreeModelRowWrapper) |
Iterate through row ancestors
Returns: | ancestor rows |
---|---|
Return type: | generator(TreeModelRowWrapper) |
Breadth first iteration
Returns: | Rows using breadth first iteration |
---|---|
Return type: | iterable(TreeModelRowWrapper) |
Depth first iteration
Returns: | Rows using depth first iteration |
---|---|
Return type: | iterable(TreeModelRowWrapper) |
Get a reference object for this row
Returns: | Refernce to the row |
---|---|
Return type: | TreeRowReferenceWrapper |
Get path created from the key column value of each row in the tree hierarchy needed to get to this row
Returns: | Path of names to the row |
---|---|
Return type: | KeyPath |
Get the number of children under this row (not recursive)
Returns: | The number of child rows |
---|---|
Return type: | int |
Get the number of rows under this row (recursive)
Returns: | The number of rows under this one |
---|---|
Return type: | int |
Remove row from model
This is just a shortcut to avoid using the following less readable code:
row.model.remove(row.iter)
Returns: | None |
---|
A list of keys used to access a tree element by name
To be able to use a key path, a key column index has be defined in the model so that which column should be used to extract the path to a row
All python lists methods apply
A Gtk.TreeRowReference wrapper that compares to another one based on model and path
Check if the reference still points to a valid row
Returns: | True | False |
---|---|
Return type: | bool |
Get model
Returns: | Model pointed by this reference |
---|---|
Return type: | TreeStore |
Get path
Returns: | Path to the row pointed by this reference |
---|---|
Return type: | tuple |
Get row
Returns: | Row pointed by this reference |
---|---|
Return type: | TreeModelRowWrapper |
Runner package contains test runners that can be used to run a particular test case
Runner objects run test cases, collect results and gather additional information such as log files
Get all classes that are subclasses of Runner
Returns: | Classes that inherit from Runner |
---|---|
Return type: | list(type) |
Return runner name based on class name
Runner name is just the class name with spaces added for each uppercase letter
Returns: | Runner name |
---|---|
Return type: | str |
RunnerCaseUI objects take care of handling additional widgets to collect the information required to run the case
Create RunnerCaseUI object based on runner name
Parameters: | runner_name (str) – Runner name used to execute case |
---|---|
Returns: | Runner UI |
Return type: | RunnerCaseUI (any of its subclasses) |
Get all classes that are subclasses of RunnerCaseUI
Returns: | Classes that inherit from RunnerCaseUI |
---|---|
Return type: | list(type) |
Return runner name based on class name
Runner name is just the class name with spaces added for each uppercase letter
Returns: | Runner name |
---|---|
Return type: | str |
Return ui filename based on class name
Returns: | UI filename |
---|---|
Return type: | str |
RunnerResultUI objects take car of handling additional widgets to display the additional result information
Create RunnerResultUI object based on runner name
Parameters: |
|
---|---|
Returns: | Runner UI |
Return type: | RunnerResultUI (any of its subclasses) |
Get all classes that are subclasses of RunnerResultUI
Returns: | Classes that inherit from RunnerResultUI |
---|---|
Return type: | list(type) |
Return runner name based on class name
Runner name is just the class name with spaces added for each uppercase letter
Returns: | Runner name |
---|---|
Return type: | str |
Return ui filename based on class name
Returns: | UI filename |
---|---|
Return type: | str |
GtkManualRunner object guides user in manual tests
GTK manual runner requires a procedure field
Get procedure field
Returns: | Procedure field |
---|---|
Return type: | str |
Validate procedure, update it and save change to history
Parameters: | textbuffer (Gtk.TextBuffer) – The textbuffer that emitted the changed signal |
---|---|
Returns: | None |
Save contents of the widgets in the UI to the row in the store
Returns: | None |
---|
Display case result and tester comments
AutomaticRunner executes a given command
Automatic runner requires a command field
Get command field
Returns: | Command field |
---|---|
Return type: | str |
Validate command, update it and save change to history
Parameters: | entry (Gtk.Entry) – The entry that emitted the changed signal |
---|---|
Returns: | None |
Save contents of the widgets in the UI to the row in the store
Returns: | None |
---|
Display command execution results
User interface file handling classes
Load user interface file and provide the following features:
Connect signal handler and keep a record of its id to disconnect it on destroy
Parameters: |
|
---|---|
Returns: | None |
Disconnect all handlers
Returns: | None |
---|