Add Users.py and Bulk_operations.py

This commit is contained in:
cesar991 2016-08-18 11:33:30 +02:00
parent d1794b8385
commit f85f6b82e8
2 changed files with 30 additions and 24 deletions

View File

@ -8,17 +8,26 @@ 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'
class Bulk_operations(PandoraWebDriverTestCase):
test_name = u'Bulk_operation'
test_description = u'Creation two agents and delete this agents using bulk operation'
tickets_associated = [3831]
tickets_associated = []
def test_pan2(self):
def test_A_delete_agent_bulk_operations(self):
u"""
Creation two agents and delete this agents using bulk operation'
Ticket Associated = 3831
"""
driver = self.driver
self.login()
detect_and_pass_all_wizards
create_agent(driver,"prueba masivas 1")
driver.find_element_by_css_selector("b").click()
@ -33,11 +42,11 @@ class PAN2(PandoraWebDriverTestCase):
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()
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))
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)")
self.verificationErrors.append(str(e))
if __name__ == "__main__":
unittest.main()

View File

@ -8,16 +8,21 @@ from selenium.webdriver.support.ui import Select
from selenium.common.exceptions import NoSuchElementException
from selenium.common.exceptions import NoAlertPresentException
from selenium.webdriver.remote.webelement import WebElement
import unittest, time, re
class PAN7(PandoraWebDriverTestCase):
class Users(PandoraWebDriverTestCase):
test_name = u'PAN_7'
test_description = u'Modify home screen, and check that change is correct. Return this change'
test_name = u'Users'
test_description = u'Users tests'
tickets_associated = []
def test_pan7(self):
def test_A_home_screen(self):
u"""
Modify home screen, and check that change is correct. Return this change
"""
driver = self.driver
self.login()
detect_and_pass_all_wizards(driver)
@ -27,17 +32,9 @@ class PAN7(PandoraWebDriverTestCase):
self.logout()
self.login()
element = driver.find_element_by_xpath('//a[contains(.,"Event control filter")]')
self.assertIsInstance(element,WebElement)
try:
element = driver.find_element_by_xpath('//a[contains(.,"Event control filter")]')
self.assertIsInstance(element,WebElement)
except AssertionError as e:
self.verificationErrors.append(str(e))
except NoSuchElementException as e:
self.verificationErrors.append(str(e))
#Return this change
activate_home_screen(driver,"Default")