Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin
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
Ekaterina
wendelin
Commits
98d77b78
Commit
98d77b78
authored
Sep 20, 2019
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extend test to cover data upload.
Upload 1Mb of data.
parent
96868dd4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
scalability_test/example/createDataStream.py
scalability_test/example/createDataStream.py
+9
-6
No files found.
scalability_test/example/createDataStream.py
View file @
98d77b78
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
import
io
import
datetime
import
datetime
import
random
import
random
import
time
import
time
...
@@ -29,7 +29,7 @@ def createDataStream(result, browser):
...
@@ -29,7 +29,7 @@ def createDataStream(result, browser):
browser
.
mainForm
.
submitSelectModule
(
value
=
'/data_stream_module'
,
browser
.
mainForm
.
submitSelectModule
(
value
=
'/data_stream_module'
,
sleep
=
(
TMIN_SLEEP
,
TMAX_SLEEP
)))
sleep
=
(
TMIN_SLEEP
,
TMAX_SLEEP
)))
# Create a newData Stream
(XXX: this will create Data Stream Bucket!)
# Create a newData Stream
result
(
'Create'
,
result
(
'Create'
,
browser
.
mainForm
.
submitNew
(
sleep
=
(
TMIN_SLEEP
,
TMAX_SLEEP
)))
browser
.
mainForm
.
submitNew
(
sleep
=
(
TMIN_SLEEP
,
TMAX_SLEEP
)))
...
@@ -40,12 +40,15 @@ def createDataStream(result, browser):
...
@@ -40,12 +40,15 @@ def createDataStream(result, browser):
# Fill the title
# Fill the title
my_title
=
PREFIX_TITLE
+
generateString
(
6
)
my_title
=
PREFIX_TITLE
+
generateString
(
6
)
browser
.
mainForm
.
getControl
(
name
=
'field_my_title'
).
value
=
my_title
browser
.
mainForm
.
getControl
(
name
=
'field_my_title'
).
value
=
my_title
browser
.
mainForm
.
getControl
(
name
=
'field_my_reference'
).
value
=
generateString
(
6
)
# Set some random informations
my_str
=
generateString
(
random
.
randint
(
1
,
100
))
my_str
=
generateString
(
random
.
randint
(
1
,
100
))
browser
.
mainForm
.
getControl
(
name
=
'field_my_description'
).
value
=
my_str
browser
.
mainForm
.
getControl
(
name
=
'field_my_description'
).
value
=
my_str
result
(
'Save'
,
browser
.
mainForm
.
submitSave
(
sleep
=
(
TMIN_SLEEP
,
TMAX_SLEEP
)))
# XXX: how to upload data?
# tests upload data from file of 1Mb size
ctrl
=
browser
.
mainForm
.
getControl
(
name
=
'field_my_file'
)
ctrl
.
add_file
(
io
.
BytesIO
(
generateString
(
1024
)
*
1024
),
'text/plain'
,
'test.txt'
)
# Submit the changes, record the time elapsed in seconds
# Submit the changes, record the time elapsed in seconds
result
(
'Save'
,
result
(
'Save'
,
...
@@ -53,10 +56,10 @@ def createDataStream(result, browser):
...
@@ -53,10 +56,10 @@ def createDataStream(result, browser):
# 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.'
sale_order_url
=
my_order_sale_url
# Validate the Data Stream
# Validate the Data Stream
#browser.mainForm.submitSelectWorkflow(value='validate_action')
#browser.mainForm.submitSelectWorkflow(value='validate_action')
#result('Validate',
#result('Validate',
# browser.mainForm.submitDialogConfirm(sleep=(TMIN_SLEEP, TMAX_SLEEP)))
# browser.mainForm.submitDialogConfirm(sleep=(TMIN_SLEEP, TMAX_SLEEP)))
#assert browser.getTransitionMessage() == 'Status changed.'
#assert browser.getTransitionMessage() == 'Status changed.'
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