From 8f417b9d4aee0b7c0d8bcccecd2d31a6df4e1ef4 Mon Sep 17 00:00:00 2001 From: cesar991 Date: Mon, 11 Jul 2016 13:13:37 +0200 Subject: [PATCH] Add reports_functions.py --- tests/console/include/reports_functions.py | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 tests/console/include/reports_functions.py diff --git a/tests/console/include/reports_functions.py b/tests/console/include/reports_functions.py new file mode 100644 index 0000000000..9fa188fbbc --- /dev/null +++ b/tests/console/include/reports_functions.py @@ -0,0 +1,26 @@ + +def create_report(driver,nombre,group_name,description=None): + click_menu_element(driver,"Custom reporting") + driver.find_element_by_id("submit-create").click() + driver.find_element_by_id("text-name").clear() + driver.find_element_by_id("text-name").send_keys(nombre) + if group_name == "All": + Select(driver.find_element_by_id("id_group")).select_by_visible_text(group_name) + else: + #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) + + 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): + click_menu_element(driver,"Custom reporting") + driver.find_element_by_id('text-search').clear() + driver.find_element_by_id('text-search').send_keys(report_name) + driver.find_element_by_id('submit-search_submit').click() + driver.find_element_by_id('image-delete2').click() + alert = driver.switch_to_alert() + alert.accept()