Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xueyun Qian
erp5
Commits
bfcd55ae
Commit
bfcd55ae
authored
Oct 14, 2011
by
Arnaud Fontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify benchmark suite examples by using sleep parameter.
parent
f11025a4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
45 deletions
+38
-45
erp5/util/benchmark/examples/createPerson.py
erp5/util/benchmark/examples/createPerson.py
+12
-15
erp5/util/benchmark/examples/createSPL.py
erp5/util/benchmark/examples/createSPL.py
+15
-19
erp5/util/benchmark/examples/createWebPage.py
erp5/util/benchmark/examples/createWebPage.py
+11
-11
No files found.
erp5/util/benchmark/examples/createPerson.py
View file @
bfcd55ae
...
@@ -21,15 +21,16 @@ def createPerson(result, browser):
...
@@ -21,15 +21,16 @@ def createPerson(result, browser):
instance).
instance).
"""
"""
# Open ERP5 homepage
# Open ERP5 homepage
browser
.
open
()
browser
.
open
(
sleep
=
(
2
,
6
)
)
# Log in unless already logged in by a previous test suite
# Log in unless already logged in by a previous test suite
browser
.
mainForm
.
submitLogin
()
browser
.
mainForm
.
submitLogin
(
sleep
=
(
2
,
6
)
)
browser
.
randomSleep
(
2
,
6
)
# Go to Persons module (person_module)
# Go to Persons module (person_module)
result
(
'Go to person module'
,
result
(
'Go to person module'
,
browser
.
mainForm
.
submitSelectModule
(
value
=
'/person_module'
))
browser
.
mainForm
.
submitSelectModule
(
value
=
'/person_module'
,
browser
.
randomSleep
(
2
,
6
)
sleep
=
(
2
,
6
)))
# Create a new person and record the time elapsed in seconds
# Create a new person and record the time elapsed in seconds
result
(
'Add Person'
,
browser
.
mainForm
.
submitNew
())
result
(
'Add Person'
,
browser
.
mainForm
.
submitNew
())
...
@@ -41,29 +42,25 @@ def createPerson(result, browser):
...
@@ -41,29 +42,25 @@ def createPerson(result, browser):
browser
.
mainForm
.
getControl
(
name
=
'field_my_last_name'
).
value
=
'Person'
browser
.
mainForm
.
getControl
(
name
=
'field_my_last_name'
).
value
=
'Person'
# Link to organisation, this will add subobjects
# Link to organisation, this will add subobjects
browser
.
mainForm
.
getControl
(
name
=
'field_my_career_subordination_title'
).
value
=
'Supplier'
browser
.
mainForm
.
getControl
(
name
=
'field_my_career_subordination_title'
).
value
=
'Supplier'
browser
.
randomSleep
(
5
,
15
)
# Submit the changes, record the time elapsed in seconds
# Submit the changes, record the time elapsed in seconds
result
(
'Save'
,
browser
.
mainForm
.
submitSave
())
result
(
'Save'
,
browser
.
mainForm
.
submitSave
(
sleep
=
(
5
,
15
)
))
# Check whether the changes have been successfully updated
# Check whether the changes have been successfully updated
assert
browser
.
getTransitionMessage
()
==
'Data updated.'
assert
browser
.
getTransitionMessage
()
==
'Data updated.'
person_url
=
browser
.
url
person_url
=
browser
.
url
# Add phone number
# Add phone number
browser
.
randomSleep
(
2
,
6
)
result
(
'Add telephone'
,
result
(
'Add telephone'
,
browser
.
mainForm
.
submitSelectAction
(
value
=
'add Telephone'
))
browser
.
mainForm
.
submitSelectAction
(
value
=
'add Telephone'
,
sleep
=
(
2
,
6
)))
# Fill telephone title and number
# Fill telephone title and number
browser
.
mainForm
.
getControl
(
name
=
'field_my_title'
).
value
=
'Personal'
browser
.
mainForm
.
getControl
(
name
=
'field_my_title'
).
value
=
'Personal'
browser
.
mainForm
.
getControl
(
name
=
'field_my_telephone_number'
).
value
=
'0123456789'
browser
.
mainForm
.
getControl
(
name
=
'field_my_telephone_number'
).
value
=
'0123456789'
# Submit the changes, record the time elapsed in seconds
# Submit the changes, record the time elapsed in seconds
browser
.
randomSleep
(
3
,
9
)
result
(
'Save'
,
browser
.
mainForm
.
submitSave
(
sleep
=
(
3
,
9
)))
result
(
'Save'
,
browser
.
mainForm
.
submitSave
())
# Check whether the changes have been successfully updated
# Check whether the changes have been successfully updated
assert
browser
.
getTransitionMessage
()
==
'Data updated.'
assert
browser
.
getTransitionMessage
()
==
'Data updated.'
...
@@ -73,11 +70,11 @@ def createPerson(result, browser):
...
@@ -73,11 +70,11 @@ def createPerson(result, browser):
# Validate it (as the workflow action may not be available yet, try 5 times
# Validate it (as the workflow action may not be available yet, try 5 times
# and sleep 5s between each attempts before failing)
# and sleep 5s between each attempts before failing)
browser
.
randomSleep
(
2
,
6
)
show_validate_time
,
waiting_for_validate_action
=
\
show_validate_time
,
waiting_for_validate_action
=
\
browser
.
mainForm
.
submitSelectWorkflow
(
value
=
'validate_action'
,
browser
.
mainForm
.
submitSelectWorkflow
(
value
=
'validate_action'
,
maximum_attempt_number
=
5
,
maximum_attempt_number
=
5
,
sleep_between_attempt
=
5
)
sleep_between_attempt
=
5
,
sleep
=
(
2
,
6
))
result
(
'Waiting for validate_action'
,
waiting_for_validate_action
)
result
(
'Waiting for validate_action'
,
waiting_for_validate_action
)
result
(
'Show validate'
,
show_validate_time
)
result
(
'Show validate'
,
show_validate_time
)
...
...
erp5/util/benchmark/examples/createSPL.py
View file @
bfcd55ae
...
@@ -6,16 +6,16 @@ def createSPL(result, browser):
...
@@ -6,16 +6,16 @@ def createSPL(result, browser):
to be installed & configured
to be installed & configured
"""
"""
# Open ERP5 homepage
# Open ERP5 homepage
browser
.
open
()
browser
.
open
(
sleep
=
(
2
,
6
)
)
# Log in unless already logged in by a previous test suite
# Log in unless already logged in by a previous test suite
browser
.
mainForm
.
submitLogin
()
browser
.
mainForm
.
submitLogin
(
sleep
=
(
2
,
6
))
browser
.
randomSleep
(
2
,
6
)
# Go to SPL module (person_module)
# Go to SPL module (person_module)
result
(
'Go to spl module'
,
result
(
'Go to spl module'
,
browser
.
mainForm
.
submitSelectModule
(
value
=
'/sale_packing_list_module'
))
browser
.
mainForm
.
submitSelectModule
(
value
=
'/sale_packing_list_module'
,
browser
.
randomSleep
(
2
,
6
)
sleep
=
(
2
,
6
)))
# Create a new person and record the time elapsed in seconds
# Create a new person and record the time elapsed in seconds
result
(
'Add SPL'
,
browser
.
mainForm
.
submitNew
())
result
(
'Add SPL'
,
browser
.
mainForm
.
submitNew
())
...
@@ -34,10 +34,8 @@ def createSPL(result, browser):
...
@@ -34,10 +34,8 @@ def createSPL(result, browser):
browser
.
mainForm
.
getControl
(
name
=
'field_my_destination_administration_title'
).
value
=
"Recipient 2"
browser
.
mainForm
.
getControl
(
name
=
'field_my_destination_administration_title'
).
value
=
"Recipient 2"
browser
.
mainForm
.
getControl
(
name
=
'field_my_comment'
).
value
=
"Benchmark test"
browser
.
mainForm
.
getControl
(
name
=
'field_my_comment'
).
value
=
"Benchmark test"
browser
.
randomSleep
(
5
,
15
)
# Submit the changes, record the time elapsed in seconds
# Submit the changes, record the time elapsed in seconds
result
(
'Save'
,
browser
.
mainForm
.
submitSave
())
result
(
'Save'
,
browser
.
mainForm
.
submitSave
(
sleep
=
(
5
,
15
)
))
# Check whether the changes have been successfully updated
# Check whether the changes have been successfully updated
assert
browser
.
getTransitionMessage
()
==
'Data updated.'
assert
browser
.
getTransitionMessage
()
==
'Data updated.'
...
@@ -49,10 +47,8 @@ def createSPL(result, browser):
...
@@ -49,10 +47,8 @@ def createSPL(result, browser):
for
i
in
xrange
(
1
,
10
):
for
i
in
xrange
(
1
,
10
):
browser
.
mainForm
.
getControl
(
name
=
'field_listbox_title_new_%s'
%
(
i
,)).
value
=
'Luxury %s'
%
(
i
,)
browser
.
mainForm
.
getControl
(
name
=
'field_listbox_title_new_%s'
%
(
i
,)).
value
=
'Luxury %s'
%
(
i
,)
browser
.
mainForm
.
getControl
(
name
=
'field_listbox_quantity_new_%s'
%
(
i
,)).
value
=
'%s'
%
(
i
,)
browser
.
mainForm
.
getControl
(
name
=
'field_listbox_quantity_new_%s'
%
(
i
,)).
value
=
'%s'
%
(
i
,)
browser
.
randomSleep
(
10
,
30
)
result
(
"Update fast input"
,
browser
.
mainForm
.
submitDialogUpdate
(
sleep
=
(
10
,
30
)))
result
(
"Update fast input"
,
browser
.
mainForm
.
submitDialogUpdate
())
result
(
"Save fast input"
,
browser
.
mainForm
.
submitDialogConfirm
(
sleep
=
(
3
,
9
)))
browser
.
randomSleep
(
3
,
9
)
result
(
"Save fast input"
,
browser
.
mainForm
.
submitDialogConfirm
())
assert
browser
.
getTransitionMessage
()
==
"Sale Packing List Line Created."
assert
browser
.
getTransitionMessage
()
==
"Sale Packing List Line Created."
# Go back to the SPL page before validating
# Go back to the SPL page before validating
...
@@ -60,11 +56,11 @@ def createSPL(result, browser):
...
@@ -60,11 +56,11 @@ def createSPL(result, browser):
# Confirm it (as the workflow action may not be available yet, try 5 times
# Confirm it (as the workflow action may not be available yet, try 5 times
# and sleep 5s between each attempts before failing)
# and sleep 5s between each attempts before failing)
browser
.
randomSleep
(
2
,
6
)
show_confirm_time
,
waiting_for_confirm_action
=
\
show_confirm_time
,
waiting_for_confirm_action
=
\
browser
.
mainForm
.
submitSelectWorkflow
(
value
=
'confirm_action'
,
browser
.
mainForm
.
submitSelectWorkflow
(
value
=
'confirm_action'
,
maximum_attempt_number
=
5
,
maximum_attempt_number
=
5
,
sleep_between_attempt
=
5
)
sleep_between_attempt
=
5
,
sleep
=
(
2
,
6
))
result
(
'Waiting for confirm_action'
,
waiting_for_confirm_action
)
result
(
'Waiting for confirm_action'
,
waiting_for_confirm_action
)
result
(
'Show confirm'
,
show_confirm_time
)
result
(
'Show confirm'
,
show_confirm_time
)
...
@@ -72,11 +68,11 @@ def createSPL(result, browser):
...
@@ -72,11 +68,11 @@ def createSPL(result, browser):
assert
browser
.
getTransitionMessage
()
==
'Status changed.'
assert
browser
.
getTransitionMessage
()
==
'Status changed.'
# Ship it
# Ship it
browser
.
randomSleep
(
2
,
6
)
show_start_time
,
waiting_for_start_action
=
\
show_start_time
,
waiting_for_start_action
=
\
browser
.
mainForm
.
submitSelectWorkflow
(
value
=
'start_action'
,
browser
.
mainForm
.
submitSelectWorkflow
(
value
=
'start_action'
,
maximum_attempt_number
=
5
,
maximum_attempt_number
=
5
,
sleep_between_attempt
=
5
)
sleep_between_attempt
=
5
,
sleep
=
(
2
,
6
))
result
(
'Waiting for start_action'
,
waiting_for_start_action
)
result
(
'Waiting for start_action'
,
waiting_for_start_action
)
result
(
'Show start'
,
show_start_time
)
result
(
'Show start'
,
show_start_time
)
...
@@ -85,11 +81,11 @@ def createSPL(result, browser):
...
@@ -85,11 +81,11 @@ def createSPL(result, browser):
assert
browser
.
getTransitionMessage
()
==
'Status changed.'
assert
browser
.
getTransitionMessage
()
==
'Status changed.'
# Receive it
# Receive it
browser
.
randomSleep
(
2
,
6
)
show_stop_time
,
waiting_for_stop_action
=
\
show_stop_time
,
waiting_for_stop_action
=
\
browser
.
mainForm
.
submitSelectWorkflow
(
value
=
'stop_action'
,
browser
.
mainForm
.
submitSelectWorkflow
(
value
=
'stop_action'
,
maximum_attempt_number
=
5
,
maximum_attempt_number
=
5
,
sleep_between_attempt
=
5
)
sleep_between_attempt
=
5
,
sleep
=
(
2
,
6
))
result
(
'Waiting for stop_action'
,
waiting_for_stop_action
)
result
(
'Waiting for stop_action'
,
waiting_for_stop_action
)
result
(
'Show stop'
,
show_stop_time
)
result
(
'Show stop'
,
show_stop_time
)
...
...
erp5/util/benchmark/examples/createWebPage.py
View file @
bfcd55ae
...
@@ -6,15 +6,16 @@ def createWebPage(result, browser):
...
@@ -6,15 +6,16 @@ def createWebPage(result, browser):
Note : you need your user to have Assignor role to do workflow transition
Note : you need your user to have Assignor role to do workflow transition
"""
"""
# Open ERP5 homepage
# Open ERP5 homepage
browser
.
open
()
browser
.
open
(
sleep
=
(
2
,
6
)
)
# Log in unless already logged in by a previous test suite
# Log in unless already logged in by a previous test suite
browser
.
mainForm
.
submitLogin
()
browser
.
mainForm
.
submitLogin
(
sleep
=
(
2
,
6
)
)
browser
.
randomSleep
(
2
,
6
)
# Go to WebPage module (person_module)
# Go to WebPage module (person_module)
result
(
'Go to Web Page module'
,
result
(
'Go to Web Page module'
,
browser
.
mainForm
.
submitSelectModule
(
value
=
'/web_page_module'
))
browser
.
mainForm
.
submitSelectModule
(
value
=
'/web_page_module'
,
browser
.
randomSleep
(
2
,
6
)
sleep
=
(
2
,
6
)))
# Create a new person and record the time elapsed in seconds
# Create a new person and record the time elapsed in seconds
result
(
'Add Web Page'
,
browser
.
mainForm
.
submitNew
())
result
(
'Add Web Page'
,
browser
.
mainForm
.
submitNew
())
...
@@ -29,9 +30,9 @@ def createWebPage(result, browser):
...
@@ -29,9 +30,9 @@ def createWebPage(result, browser):
browser
.
mainForm
.
getControl
(
name
=
'field_my_language'
).
value
=
'en'
browser
.
mainForm
.
getControl
(
name
=
'field_my_language'
).
value
=
'en'
browser
.
mainForm
.
getControl
(
name
=
'field_my_int_index'
).
value
=
'10'
browser
.
mainForm
.
getControl
(
name
=
'field_my_int_index'
).
value
=
'10'
browser
.
mainForm
.
getControl
(
name
=
'field_my_description'
).
value
=
'Benchmark test'
browser
.
mainForm
.
getControl
(
name
=
'field_my_description'
).
value
=
'Benchmark test'
browser
.
randomSleep
(
5
,
15
)
# Submit the changes, record the time elapsed in seconds
# Submit the changes, record the time elapsed in seconds
result
(
'Save'
,
browser
.
mainForm
.
submitSave
())
result
(
'Save'
,
browser
.
mainForm
.
submitSave
(
sleep
=
(
5
,
15
)
))
# Check whether the changes have been successfully updated
# Check whether the changes have been successfully updated
assert
browser
.
getTransitionMessage
()
==
'Data updated.'
assert
browser
.
getTransitionMessage
()
==
'Data updated.'
...
@@ -42,18 +43,17 @@ def createWebPage(result, browser):
...
@@ -42,18 +43,17 @@ def createWebPage(result, browser):
browser
.
open
(
WebPage_url
+
"/WebPage_viewEditor"
)
browser
.
open
(
WebPage_url
+
"/WebPage_viewEditor"
)
browser
.
mainForm
.
getControl
(
name
=
'field_my_text_content'
).
value
=
'<html><body><h1>Test</h1><p>Content if test</p></body></html>'
browser
.
mainForm
.
getControl
(
name
=
'field_my_text_content'
).
value
=
'<html><body><h1>Test</h1><p>Content if test</p></body></html>'
# Submit the changes, record the time elapsed in seconds
# Submit the changes, record the time elapsed in seconds
browser
.
randomSleep
(
10
,
30
)
result
(
'Save'
,
browser
.
mainForm
.
submitSave
(
sleep
=
(
10
,
30
)))
result
(
'Save'
,
browser
.
mainForm
.
submitSave
())
# Check whether the changes have been successfully updated
# Check whether the changes have been successfully updated
assert
browser
.
getTransitionMessage
()
==
'Data updated.'
assert
browser
.
getTransitionMessage
()
==
'Data updated.'
# Publish it
# Publish it
browser
.
randomSleep
(
2
,
6
)
show_publish_time
,
waiting_for_publish_action
=
\
show_publish_time
,
waiting_for_publish_action
=
\
browser
.
mainForm
.
submitSelectWorkflow
(
value
=
'publish_action'
,
browser
.
mainForm
.
submitSelectWorkflow
(
value
=
'publish_action'
,
maximum_attempt_number
=
5
,
maximum_attempt_number
=
5
,
sleep_between_attempt
=
5
)
sleep_between_attempt
=
5
,
sleep
=
(
2
,
6
))
result
(
'Waiting for publish_action'
,
waiting_for_publish_action
)
result
(
'Waiting for publish_action'
,
waiting_for_publish_action
)
result
(
'Show publish'
,
show_publish_time
)
result
(
'Show publish'
,
show_publish_time
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment