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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alecs_myu
erp5
Commits
378193e4
Commit
378193e4
authored
Jul 23, 2013
by
Benjamin Blanc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
benchmark: createSaleOrder: Improve script and fix bugs
parent
f4ff715a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
11 deletions
+6
-11
erp5/util/benchmark/examples/createSaleOrder.py
erp5/util/benchmark/examples/createSaleOrder.py
+6
-11
No files found.
erp5/util/benchmark/examples/createSaleOrder.py
View file @
378193e4
...
@@ -4,17 +4,12 @@ import datetime
...
@@ -4,17 +4,12 @@ import datetime
import
random
import
random
import
time
import
time
import
string
import
string
import
genericToolToFillForm
from
utils
import
*
from
utils
import
*
if
False
:
TMIN_SLEEP
=
2
TMIN_SLEEP
=
0
TMAX_SLEEP
=
6
TMAX_SLEEP
=
0
else
:
TMIN_SLEEP
=
2
TMAX_SLEEP
=
6
SALE_TRADE_CONDITION_NAME
=
"Sale Trade Condition"
SALE_TRADE_CONDITION_NAME
=
"S
calability S
ale Trade Condition"
PREFIX_TITLE
=
""
PREFIX_TITLE
=
""
MAX_PRODUCT
=
5
MAX_PRODUCT
=
5
...
@@ -38,7 +33,7 @@ def addOrderLine(browser, my_title, result) :
...
@@ -38,7 +33,7 @@ def addOrderLine(browser, my_title, result) :
sleep
=
(
TMIN_SLEEP
,
TMAX_SLEEP
)))
sleep
=
(
TMIN_SLEEP
,
TMAX_SLEEP
)))
## Choose the product randomly
## Choose the product randomly
fill
_related_o
bjects
(
browser
,
result
,
fill
RelatedO
bjects
(
browser
,
result
,
"portal_selections/viewSearchRelatedDocumentDialog0:method"
,
1
,
"portal_selections/viewSearchRelatedDocumentDialog0:method"
,
1
,
"AddOrderLine"
,
TMIN_SLEEP
,
TMAX_SLEEP
)
"AddOrderLine"
,
TMIN_SLEEP
,
TMAX_SLEEP
)
...
@@ -78,7 +73,7 @@ def createSaleOrder(result, browser):
...
@@ -78,7 +73,7 @@ def createSaleOrder(result, browser):
my_order_sale_url
=
browser
.
url
.
split
(
"?"
)[
0
]
my_order_sale_url
=
browser
.
url
.
split
(
"?"
)[
0
]
# Fill the title
# Fill the title
my_title
=
PREFIX_TITLE
+
gen
_s
tring
(
6
)
my_title
=
PREFIX_TITLE
+
gen
erateS
tring
(
6
)
browser
.
mainForm
.
getControl
(
name
=
'field_my_title'
).
value
=
my_title
browser
.
mainForm
.
getControl
(
name
=
'field_my_title'
).
value
=
my_title
# Set some random informations
# Set some random informations
...
@@ -87,7 +82,7 @@ def createSaleOrder(result, browser):
...
@@ -87,7 +82,7 @@ def createSaleOrder(result, browser):
browser
.
mainForm
.
getControl
(
name
=
'field_my_description'
).
value
=
my_str
browser
.
mainForm
.
getControl
(
name
=
'field_my_description'
).
value
=
my_str
# Select some options randomly
# Select some options randomly
select
_random_o
ption
(
browser
,
"field_my_order"
)
select
RandomO
ption
(
browser
,
"field_my_order"
)
# Set dates
# Set dates
date
=
datetime
.
datetime
.
now
()
date
=
datetime
.
datetime
.
now
()
...
...
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