pandorafms/tests/console/PAN2.py

44 lines
1.8 KiB
Python
Raw Normal View History

2016-05-24 19:19:20 +02:00
# -*- coding: utf-8 -*-
from include.common_classes_60 import PandoraWebDriverTestCase
2016-06-14 18:37:09 +02:00
from include.common_functions_60 import login, click_menu_element, detect_and_pass_all_wizards
from include.agent_functions import create_agent
2016-05-24 19:19:20 +02:00
from selenium import webdriver
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 NoSuchElementException
from selenium.common.exceptions import NoAlertPresentException
import unittest, time, re
class PAN2(PandoraWebDriverTestCase):
test_name = u'PAN_2'
test_description = u'Creation two agents and delete this agents using bulk operation'
2016-06-15 11:08:34 +02:00
tickets_associated = [3831]
2016-05-24 19:19:20 +02:00
def test_pan2(self):
driver = self.driver
self.login()
create_agent(driver,"prueba masivas 1")
2016-05-24 19:19:20 +02:00
driver.find_element_by_css_selector("b").click()
create_agent(driver,"prueba masivas 2")
2016-05-24 19:19:20 +02:00
driver.find_element_by_css_selector("b").click()
driver.find_element_by_css_selector("b").click()
click_menu_element(driver,"Agents operations")
2016-05-24 19:19:20 +02:00
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")
driver.find_element_by_id("submit-go").click()
2016-05-27 01:54:21 +02:00
try:
self.assertRegexpMatches(self.close_alert_and_get_its_text(), r"^Are you sure[\s\S]$")
self.assertEqual(self.driver.find_element_by_xpath('//div[@id="main"]//td[contains(.,"Successfully deleted (2)")]').text,"Successfully deleted (2)")
except AssertionError as e:
self.verificationErrors.append(str(e))
2016-05-24 19:19:20 +02:00
if __name__ == "__main__":
unittest.main()