Expand function create_report

This commit is contained in:
cesar991 2016-07-07 11:08:53 +02:00
parent 2bf68398e9
commit 24d0c2806b
1 changed files with 9 additions and 5 deletions

View File

@ -54,7 +54,7 @@ def logout(driver,url):
#Report #Report
def create_report(driver,nombre,group_name): def create_report(driver,nombre,group_name,description=None):
click_menu_element(driver,"Custom reporting") click_menu_element(driver,"Custom reporting")
driver.find_element_by_id("submit-create").click() driver.find_element_by_id("submit-create").click()
driver.find_element_by_id("text-name").clear() driver.find_element_by_id("text-name").clear()
@ -64,8 +64,12 @@ def create_report(driver,nombre,group_name):
else: else:
#TODO This will not work when choosing a group within a group within another group #TODO This will not work when choosing a group within a group within another group
Select(driver.find_element_by_id("id_group")).select_by_visible_text(" "+group_name) Select(driver.find_element_by_id("id_group")).select_by_visible_text(" "+group_name)
driver.find_element_by_id("submit-add").click()
if description != None:
driver.find_element_by_id("textarea_description").clear()
driver.find_element_by_id("textarea_description").send_keys(description)
driver.find_element_by_id("submit-add").click()
def delete_report(driver,report_name): def delete_report(driver,report_name):
click_menu_element(driver,"Custom reporting") click_menu_element(driver,"Custom reporting")