Commit d147965d authored by Roque Porchetto's avatar Roque Porchetto

scalaiblity_test: refactoring createSaleOrder test

parent 4df9bee2
......@@ -36,6 +36,30 @@ def addOrderLine(browser, my_title, result) :
"portal_selections/viewSearchRelatedDocumentDialog0:method", 1,
"AddOrderLine", TMIN_SLEEP, TMAX_SLEEP)
def generateString(size) :
"""
Function to generate a string randomly (a-z)
@param size: Size of the string
@type size: int
"""
new_string = random.choice(string.ascii_uppercase)
new_string = new_string + ''.join(random.choice(string.ascii_lowercase) for x in range(size))
return new_string
def selectRandomOption(browser, select_name):
"""
Function to select randomly an option
@param browser: Browser
@type browser: Browser
@param select_name: Name of the input
@type select_name: string
"""
# Get the option values
options = browser.mainForm.getControl(name=select_name).options[1:]
if len(options) > 0:
# Select randomly one value
browser.mainForm.getControl(name=select_name).value = [random.choice(options)]
def createSaleOrder(result, browser):
"""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment