From e8880389d176ad5a837d72e5c83f61fd730f03e7 Mon Sep 17 00:00:00 2001 From: cesar991 Date: Thu, 14 Jul 2016 13:25:14 +0200 Subject: [PATCH] Add create_agent_group function in agent_functions.py --- tests/console/include/agent_functions.py | 28 ++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tests/console/include/agent_functions.py b/tests/console/include/agent_functions.py index 204c7f5a31..8048f7061b 100644 --- a/tests/console/include/agent_functions.py +++ b/tests/console/include/agent_functions.py @@ -50,3 +50,31 @@ def create_agent(driver,agent_name,ip=None,description=None,group=None,os_id=Non driver.find_element_by_id("submit-crtbutton").click() + +def create_agent_group(driver,group_name,parent_group="All",alerts=True,propagate_acl=False,description=None): + + # parent_group by defect is All. + # Alerts by default is activate. + + click_menu_element(driver,"Manage agents groups") + driver.find_element_by_id("submit-crt").click() + + driver.find_element_by_id("text-name").send_keys(group_name) + + if parent_group != "All": + + driver.find_element_by_xpath('//option[contains(.,"'+parent_group+'")]').click() + + if alerts == False: + + driver.find_element_by_id("checkbox-alerts_enabled").click() + + if propagate_acl == True: + + driver.find_element_by_id("checkbox-propagate").click() + + if description!= None: + + driver.find_element_by_id("text-description").send_keys(description) + + driver.find_element_by_id("submit-crtbutton").click()