Add create_agent_group function in agent_functions.py

This commit is contained in:
cesar991 2016-07-14 13:25:14 +02:00
parent 4cf0693cfd
commit e8880389d1
1 changed files with 28 additions and 0 deletions

View File

@ -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() 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()