[Erp5-report] r46004 arnaud.fontaine - in /erp5/trunk/utils: erp5.utils.benchmark/examples/...

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Aug 29 09:58:20 CEST 2011


Author: arnaud.fontaine
Date: Mon Aug 29 09:58:20 2011
New Revision: 46004

URL: http://svn.erp5.org?rev=46004&view=rev
Log:
Update examples following r46000

Modified:
    erp5/trunk/utils/erp5.utils.benchmark/examples/createPerson.py
    erp5/trunk/utils/erp5.utils.test_browser/examples/testAddPerson.py

Modified: erp5/trunk/utils/erp5.utils.benchmark/examples/createPerson.py
URL: http://svn.erp5.org/erp5/trunk/utils/erp5.utils.benchmark/examples/createPerson.py?rev=46004&r1=46003&r2=46004&view=diff
==============================================================================
--- erp5/trunk/utils/erp5.utils.benchmark/examples/createPerson.py [utf8] (original)
+++ erp5/trunk/utils/erp5.utils.benchmark/examples/createPerson.py [utf8] Mon Aug 29 09:58:20 2011
@@ -47,9 +47,13 @@ def createPerson(result, browser):
   # Check whether the changes have been successfully updated
   assert browser.getTransitionMessage() == 'Data updated.'
 
-  # Validate it after going back to the Person page
+  # Go back to the Person page before validating
   browser.open(person_url)
 
-  result('Validate', browser.mainForm.submitSelectWorkflow(value='validate_action'))
+  # Validate it (as the workflow action may not be available yet, try 5 times
+  # and sleep 5s between each attempts before failing)
+  result('Validate', browser.mainForm.submitSelectWorkflow(value='validate_action',
+                                                           maximum_attempt_number=5,
+                                                           sleep_between_attempt=5))
   result('Validated', browser.mainForm.submitDialogConfirm())
   assert browser.getTransitionMessage() == 'Status changed.'

Modified: erp5/trunk/utils/erp5.utils.test_browser/examples/testAddPerson.py
URL: http://svn.erp5.org/erp5/trunk/utils/erp5.utils.test_browser/examples/testAddPerson.py?rev=46004&r1=46003&r2=46004&view=diff
==============================================================================
--- erp5/trunk/utils/erp5.utils.test_browser/examples/testAddPerson.py [utf8] (original)
+++ erp5/trunk/utils/erp5.utils.test_browser/examples/testAddPerson.py [utf8] Mon Aug 29 09:58:20 2011
@@ -40,8 +40,12 @@ def benchmarkAddPerson(iteration_counter
   # Check whether the changes have been successfully updated
   assert browser.getTransitionMessage() == 'Data updated.'
 
-  # Validate the person and record confirmation
-  browser.mainForm.submitSelectWorkflow(value='validate_action')
+  # Validate the person (as the workflow action may not be available yet, try
+  # 5 times and sleep 5s between each attempts before failing) and record
+  # time spent on confirmation
+  browser.mainForm.submitSelectWorkflow(value='validate_action',
+                                        maximum_attempt_number=5,
+                                        sleep_between_attempt=5)
   result_dict.setdefault('Validate', []).append(
     browser.mainForm.submitDialogConfirm())
 



More information about the Erp5-report mailing list