diff --git a/tests/console/Bulk_operations.py b/tests/console/Bulk_operations.py index 3c4a3f52bd..ca1f1237e0 100644 --- a/tests/console/Bulk_operations.py +++ b/tests/console/Bulk_operations.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- from include.common_classes_60 import PandoraWebDriverTestCase -from include.common_functions_60 import login, click_menu_element, detect_and_pass_all_wizards +from include.common_functions_60 import login, click_menu_element, detect_and_pass_all_wizards, gen_random_string from include.agent_functions import create_agent +from include.api_functions import * from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys @@ -23,24 +24,35 @@ class Bulk_operations(PandoraWebDriverTestCase): Creation two agents and delete this agents using bulk operation' Ticket Associated = 3831 """ - + + agent_name_1 = gen_random_string(6) + agent_name_2 = gen_random_string(6) + driver = self.driver self.login() detect_and_pass_all_wizards - - create_agent(driver,"prueba masivas 1") - driver.find_element_by_css_selector("b").click() + activate_api(driver,"1234") + + params = [agent_name_1,"127.0.0.1","0","4","0","300","2","pandorafms","2","0","0","pruebas"] + create_agent_api(driver,params,user="admin",pwd="pandora") + + params = [agent_name_2,"127.0.0.1","0","4","0","300","2","pandorafms","2","0","0","pruebas"] + create_agent_api(driver,params,user="admin",pwd="pandora") + + lista = driver.current_url.split('/') + + url = lista[0]+'//'+lista[2]+'/pandora_console' + + driver.get(url) - create_agent(driver,"prueba masivas 2") - driver.find_element_by_css_selector("b").click() driver.find_element_by_css_selector("b").click() click_menu_element(driver,"Agents operations") driver.find_element_by_id("option").click() Select(driver.find_element_by_id("option")).select_by_visible_text("Bulk agent delete") - Select(driver.find_element_by_id("id_agents")).select_by_visible_text("prueba masivas 1") - Select(driver.find_element_by_id("id_agents")).select_by_visible_text("prueba masivas 2") + Select(driver.find_element_by_id("id_agents")).select_by_visible_text(agent_name_1) + Select(driver.find_element_by_id("id_agents")).select_by_visible_text(agent_name_2) driver.find_element_by_id("submit-go").click() self.assertRegexpMatches(self.close_alert_and_get_its_text(), r"^Are you sure[\s\S]$") diff --git a/tests/console/Services.py b/tests/console/Services.py index 1a9fedc35a..e6db79182c 100644 --- a/tests/console/Services.py +++ b/tests/console/Services.py @@ -179,6 +179,7 @@ class ManualService(PandoraWebDriverTestCase): module_warning_1_name = gen_random_string(6) module_critical_1_name = gen_random_string(6) + @is_enterprise def test_A_manual_service_ok(self): u""" @@ -224,7 +225,7 @@ class ManualService(PandoraWebDriverTestCase): element = driver.find_element_by_xpath('//td/img[@data-title="Ok"]') self.assertIsInstance(element,WebElement) - + @is_enterprise def test_B_auto_service_critical(self): u""" @@ -248,7 +249,7 @@ class ManualService(PandoraWebDriverTestCase): element = driver.find_element_by_xpath('//td/img[@data-title="Critical"]') self.assertIsInstance(element,WebElement) - + @is_enterprise def test_C_auto_service_warning(self): u"""