r16439 - gnucash/branches/dogtail/src/test-dogtail - add new account wizard wrappers

Ahmed Sayed asayed at cvs.gnucash.org
Thu Aug 16 18:05:15 EDT 2007


Author: asayed
Date: 2007-08-16 18:05:14 -0400 (Thu, 16 Aug 2007)
New Revision: 16439
Trac: http://svn.gnucash.org/trac/changeset/16439

Modified:
   gnucash/branches/dogtail/src/test-dogtail/GnuCash.py
Log:
add new account wizard wrappers


Modified: gnucash/branches/dogtail/src/test-dogtail/GnuCash.py
===================================================================
--- gnucash/branches/dogtail/src/test-dogtail/GnuCash.py	2007-08-16 17:10:44 UTC (rev 16438)
+++ gnucash/branches/dogtail/src/test-dogtail/GnuCash.py	2007-08-16 22:05:14 UTC (rev 16439)
@@ -13,6 +13,7 @@
 from dogtail.tree import Window
 from dogtail.tree import predicate
 from dogtail.tree import Application
+from dogtail.tree import Wizard
 from dogtail.procedural import click
 from time import sleep
 from dogtail import tree, predicate
@@ -1644,8 +1645,30 @@
     def finish(self):
         self.menu('Reconcile').menuItem('Finish').click()
 
+class NewAccountSetup(Wizard):
+
+    def __init__(self, node):
+        Wizard.__init__(self, node)
+
+    def set_account_category(self, category_list):
+        simple_checkbook = self.currentPage().child(name='A Simple Checkbook')
+        self.currentPage().button('Clear All').click()
+        categorize_table = simple_checkbook.findAncestor(predicate.GenericPredicate(roleName='table'))
+        cells = categorize_table.findChildren(predicate.GenericPredicate(roleName='table cell'))
+        for category in category_list:
+            for i, cell in enumerate(cells):
+                if cell.name == category:
+                    cells[i-1].doAction('toggle')
+
 if __name__ == '__main__':
     """ This main Changes Frequently because it used to test most recent added widget """
     config.childrenLimit = 1500
-
-
+    gnucash = GnuCashApp()
+    gnucash.menu('File').menu('New').menuItem('New File').click()
+    duride_frame = gnucash.findChild(\
+    predicate.GenericPredicate(roleName='frame', \
+    name='New Account Hierarchy Setup'))
+    new_account_setup = NewAccountSetup(duride_frame)
+    new_account_setup.clickForward()
+    new_account_setup.clickForward()
+    new_account_setup.set_account_category([ 'Car Loan'])



More information about the gnucash-changes mailing list