From 487d36936e807369f1cd589c6441d1aeaa0227fa Mon Sep 17 00:00:00 2001 From: cesar991 Date: Tue, 5 Jul 2016 10:55:56 +0200 Subject: [PATCH] Complete function create_agent --- tests/console/include/common_functions_60.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/tests/console/include/common_functions_60.py b/tests/console/include/common_functions_60.py index 09a2177334..b51ad4611f 100644 --- a/tests/console/include/common_functions_60.py +++ b/tests/console/include/common_functions_60.py @@ -183,10 +183,22 @@ def search_agent(driver,agent_name): driver.find_element_by_id("submit-srcbutton").click() driver.find_element_by_css_selector("b").click() -def create_agent(driver,agent_name): +def create_agent(driver,agent_name,ip=None,description=None,group=None,os_id=None): + click_menu_element(driver,"Agent detail") driver.find_element_by_id("submit-crt").click() - driver.find_element_by_id("text-agente").click() - driver.find_element_by_id("text-agente").clear() driver.find_element_by_id("text-agente").send_keys(agent_name) - driver.find_element_by_id("submit-crtbutton").click() + + if ip != None: + driver.find_element_by_id("text-direccion").clear() + driver.find_element_by_id("text-direccion").send_keys(ip) + + if description != None: + driver.find_element_by_id("text-comentarios").clear() + driver.find_element_by_id("text-comentarios").send_keys(description) + + if group != None: + Select(driver.find_element_by_id("grupo")).select_by_visible_text(group) + + if os_id !=None: + Select(driver.find_element_by_id("id_os")).select_by_visible_text(os_id)