Change create_agent in Bulk_operation.py and add is_enterprise in Services.py

(cherry picked from commit 928cc0dee4)
This commit is contained in:
cesar991 2016-08-31 15:29:51 +02:00
parent a0753238f7
commit f2e73fe7f4
2 changed files with 24 additions and 11 deletions

View File

@ -1,7 +1,8 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from include.common_classes_60 import PandoraWebDriverTestCase 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.agent_functions import create_agent
from include.api_functions import *
from selenium import webdriver from selenium import webdriver
from selenium.webdriver.common.by import By from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys 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' Creation two agents and delete this agents using bulk operation'
Ticket Associated = 3831 Ticket Associated = 3831
""" """
agent_name_1 = gen_random_string(6)
agent_name_2 = gen_random_string(6)
driver = self.driver driver = self.driver
self.login() self.login()
detect_and_pass_all_wizards 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()
driver.find_element_by_css_selector("b").click() driver.find_element_by_css_selector("b").click()
click_menu_element(driver,"Agents operations") click_menu_element(driver,"Agents operations")
driver.find_element_by_id("option").click() 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("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(agent_name_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_2)
driver.find_element_by_id("submit-go").click() driver.find_element_by_id("submit-go").click()
self.assertRegexpMatches(self.close_alert_and_get_its_text(), r"^Are you sure[\s\S]$") self.assertRegexpMatches(self.close_alert_and_get_its_text(), r"^Are you sure[\s\S]$")

View File

@ -179,6 +179,7 @@ class ManualService(PandoraWebDriverTestCase):
module_warning_1_name = gen_random_string(6) module_warning_1_name = gen_random_string(6)
module_critical_1_name = gen_random_string(6) module_critical_1_name = gen_random_string(6)
@is_enterprise
def test_A_manual_service_ok(self): def test_A_manual_service_ok(self):
u""" u"""
@ -224,7 +225,7 @@ class ManualService(PandoraWebDriverTestCase):
element = driver.find_element_by_xpath('//td/img[@data-title="Ok"]') element = driver.find_element_by_xpath('//td/img[@data-title="Ok"]')
self.assertIsInstance(element,WebElement) self.assertIsInstance(element,WebElement)
@is_enterprise
def test_B_auto_service_critical(self): def test_B_auto_service_critical(self):
u""" u"""
@ -248,7 +249,7 @@ class ManualService(PandoraWebDriverTestCase):
element = driver.find_element_by_xpath('//td/img[@data-title="Critical"]') element = driver.find_element_by_xpath('//td/img[@data-title="Critical"]')
self.assertIsInstance(element,WebElement) self.assertIsInstance(element,WebElement)
@is_enterprise
def test_C_auto_service_warning(self): def test_C_auto_service_warning(self):
u""" u"""