[Erp5-report] r45998 arnaud.fontaine - /erp5/trunk/utils/erp5.utils.benchmark/examples/

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Aug 26 05:15:13 CEST 2011


Author: arnaud.fontaine
Date: Fri Aug 26 05:15:13 2011
New Revision: 45998

URL: http://svn.erp5.org?rev=45998&view=rev
Log:
Add an example explaining how to use erp5.utils.benchmark

Added:
    erp5/trunk/utils/erp5.utils.benchmark/examples/
    erp5/trunk/utils/erp5.utils.benchmark/examples/createPerson.py
    erp5/trunk/utils/erp5.utils.benchmark/examples/userInfo.py

Added: erp5/trunk/utils/erp5.utils.benchmark/examples/createPerson.py
URL: http://svn.erp5.org/erp5/trunk/utils/erp5.utils.benchmark/examples/createPerson.py?rev=45998&view=auto
==============================================================================
--- erp5/trunk/utils/erp5.utils.benchmark/examples/createPerson.py (added)
+++ erp5/trunk/utils/erp5.utils.benchmark/examples/createPerson.py [utf8] Fri Aug 26 05:15:13 2011
@@ -0,0 +1,47 @@
+# -*- coding: utf-8 -*-
+
+def createPerson(result, browser):
+  """
+  Create a Person and add a  telephone number.  It can be ran infinitely (e.g.
+  until it  is interrupted by  the end user)  with 1 concurrent  user, through
+  performance_tester_erp5 with the following command:
+
+  performance_tester_erp5 http://foo.bar:4242/erp5/ 1 createPerson
+
+  Please note that  you must run this command from the  same directory of this
+  script  and userInfo.py.  Further information  about performance_tester_erp5
+  options and arguments are available by specifying ``--help''.
+  """
+  # Go to Persons module (person_module)
+  result('Go to person module',
+         browser.mainForm.timeSubmitSelectModuleInSecond(value='/person_module'))
+
+  # Create a new person and record the time elapsed in seconds
+  result('Add Person', browser.mainForm.timeSubmitNewInSecond())
+
+  # Check whether it has been successfully created
+  assert browser.getTransitionMessage() == 'Object created.'
+
+  # Fill the first and last name of the newly created person
+  browser.mainForm.getControl(name='field_my_first_name').value = 'Foo'
+  browser.mainForm.getControl(name='field_my_last_name').value = 'Bar'
+
+  # Submit the changes, record the time elapsed in seconds
+  result('Save', browser.mainForm.timeSubmitSaveInSecond())
+
+  # Check whether the changes have been successfully updated
+  assert browser.getTransitionMessage() == 'Data updated.'
+
+  # Add phone number
+  result('Add telephone',
+         browser.mainForm.timeSubmitSelectActionInSecond(value='add Telephone'))
+
+  # Fill telephone title and number
+  browser.mainForm.getControl(name='field_my_title'). value = 'Personal'
+  browser.mainForm.getControl(name='field_my_telephone_number').value = '0123456789'
+
+  # Submit the changes, record the time elapsed in seconds
+  result('Save', browser.mainForm.timeSubmitSaveInSecond())
+
+  # Check whether the changes have been successfully updated
+  assert browser.getTransitionMessage() == 'Data updated.'

Added: erp5/trunk/utils/erp5.utils.benchmark/examples/userInfo.py
URL: http://svn.erp5.org/erp5/trunk/utils/erp5.utils.benchmark/examples/userInfo.py?rev=45998&view=auto
==============================================================================
--- erp5/trunk/utils/erp5.utils.benchmark/examples/userInfo.py (added)
+++ erp5/trunk/utils/erp5.utils.benchmark/examples/userInfo.py [utf8] Fri Aug 26 05:15:13 2011
@@ -0,0 +1,2 @@
+# Specify user login/password used to run the tests
+user_tuple = (('zope', 'zope'),)



More information about the Erp5-report mailing list