Modified tests to use refactorized function

This commit is contained in:
axl89 2016-07-15 14:33:19 +02:00
parent 2b81c0bd6c
commit b2e767dd95
4 changed files with 12 additions and 28 deletions

View File

@ -7,6 +7,7 @@ from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Select
from selenium.common.exceptions import StaleElementReferenceException
from include.module_functions import *
import unittest, time, re
@ -20,19 +21,10 @@ class PAN3(PandoraWebDriverTestCase):
driver = self.driver
login(driver)
detect_and_pass_all_wizards(driver)
create_agent(driver,"localhost icmp test",ip="127.0.0.1")
driver.find_element_by_css_selector("li.nomn.tab_godmode > a > img.forced_title").click()
driver.find_element_by_id("moduletype").click()
Select(driver.find_element_by_id("moduletype")).select_by_visible_text("Create a new network server module")
driver.find_element_by_name("updbutton").click() #Alternative XPATH: //*[@class="datos"]/input
driver.find_element_by_name("updbutton").click() #IMPORTANT! It's needed to click TWICE! One for leave the combo, and other for clicking the button
driver.find_element_by_id("id_module_type").click()
combo = driver.find_element_by_id("id_module_type")
Select(combo).select_by_visible_text("Remote ICMP network agent, boolean data")
combo.click()
driver.find_element_by_id("text-name").clear()
driver.find_element_by_id("text-name").send_keys("ping test")
driver.find_element_by_id("submit-crtbutton").click()
create_agent(driver,"PAN3_agent",ip="127.0.0.1")
create_module("network_server",driver,agent_name="PAN3_agent",module_name="PAN3_module",component_group="Network Management",network_component="Host Alive",ip="127.0.0.1")
driver.find_element_by_xpath('//*[@id="menu_tab"]//a[contains(@href,"ver_agente")]').click()
max_retries = 3

View File

@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-
from include.common_classes_60 import PandoraWebDriverTestCase
from include.common_functions_60 import login, click_menu_element, refresh_N_times_until_find_element, detect_and_pass_all_wizards, is_element_present, logout

View File

@ -5,6 +5,7 @@ from include.common_functions_60 import login, click_menu_element, refresh_N_tim
from include.reports_functions import create_report, delete_report
from include.user_functions import create_user
from include.agent_functions import create_agent
from include.module_functions import create_module
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
@ -26,16 +27,8 @@ class PAN5(PandoraWebDriverTestCase):
create_agent(driver,u"次のライセンスに基づいていま")
#Create module
driver.find_element_by_xpath('//ul[@class="mn"]/li/a/img[@data-title="Modules"]').click()
Select(driver.find_element_by_id("moduletype")).select_by_visible_text("Create a new network server module")
driver.find_element_by_name("updbutton").click()
Select(driver.find_element_by_id("network_component_group")).select_by_visible_text("Network Management")
Select(driver.find_element_by_id("network_component")).select_by_visible_text("Host Alive")
time.sleep(3)
driver.find_element_by_id("text-name").clear()
driver.find_element_by_id("text-name").send_keys(u"管理者ガイド")
driver.find_element_by_id("submit-crtbutton").click()
create_module("network_server",driver,agent_name=u"次のライセンスに基づいていま",module_name=u"管理者ガイド",component_group="Network Management",network_component="Host Alive",ip="192.168.50.50")
#Create alert
driver.find_element_by_xpath('//ul[@class="mn"]/li/a/img[@data-title="Alerts"]').click()
Select(driver.find_element_by_id("id_agent_module")).select_by_visible_text(u"管理者ガイド")

View File

@ -3,7 +3,7 @@ from include.common_classes_60 import PandoraWebDriverTestCase
from include.common_functions_60 import login, click_menu_element, detect_and_pass_all_wizards, logout
from include.agent_functions import create_agent, search_agent
from include.user_functions import create_user
from include.module_functions import create_network_server_module
from include.module_functions import *
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
@ -28,11 +28,12 @@ class PAN8(PandoraWebDriverTestCase):
#We create a module without a tag
create_network_server_module(driver,"PAN_8",module_name="Without tag",component_group="Network Management",network_component="Host Alive",ip="192.168.50.50")
create_module("network_server",driver,agent_name="PAN_8",module_name="Without tag",component_group="Network Management",network_component="Host Alive",ip="192.168.50.50")
#We now create a modulo with tag "critical"
create_network_server_module(driver,"PAN_8",module_name="With tag",component_group="Network Management",network_component="Host Alive",ip="192.168.50.50",tag_name="critical")
create_module("network_server",driver,agent_name="PAN_8",module_name="With tag",component_group="Network Management",network_component="Host Alive",ip="192.168.50.50",tag_name="critical")
l = [("Operator (Read)","All",["critical"])]