Add Users.py and Bulk_operations.py
This commit is contained in:
parent
d1794b8385
commit
f85f6b82e8
|
@ -8,17 +8,26 @@ from selenium.webdriver.common.keys import Keys
|
||||||
from selenium.webdriver.support.ui import Select
|
from selenium.webdriver.support.ui import Select
|
||||||
from selenium.common.exceptions import NoSuchElementException
|
from selenium.common.exceptions import NoSuchElementException
|
||||||
from selenium.common.exceptions import NoAlertPresentException
|
from selenium.common.exceptions import NoAlertPresentException
|
||||||
|
|
||||||
import unittest, time, re
|
import unittest, time, re
|
||||||
|
|
||||||
class PAN2(PandoraWebDriverTestCase):
|
class Bulk_operations(PandoraWebDriverTestCase):
|
||||||
test_name = u'PAN_2'
|
|
||||||
|
test_name = u'Bulk_operation'
|
||||||
test_description = u'Creation two agents and delete this agents using 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
|
driver = self.driver
|
||||||
self.login()
|
self.login()
|
||||||
|
detect_and_pass_all_wizards
|
||||||
|
|
||||||
create_agent(driver,"prueba masivas 1")
|
create_agent(driver,"prueba masivas 1")
|
||||||
|
|
||||||
driver.find_element_by_css_selector("b").click()
|
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 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("prueba masivas 2")
|
||||||
driver.find_element_by_id("submit-go").click()
|
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.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.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.verificationErrors.append(str(e))
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
unittest.main()
|
unittest.main()
|
|
@ -8,16 +8,21 @@ from selenium.webdriver.support.ui import Select
|
||||||
from selenium.common.exceptions import NoSuchElementException
|
from selenium.common.exceptions import NoSuchElementException
|
||||||
from selenium.common.exceptions import NoAlertPresentException
|
from selenium.common.exceptions import NoAlertPresentException
|
||||||
from selenium.webdriver.remote.webelement import WebElement
|
from selenium.webdriver.remote.webelement import WebElement
|
||||||
|
|
||||||
import unittest, time, re
|
import unittest, time, re
|
||||||
|
|
||||||
class PAN7(PandoraWebDriverTestCase):
|
class Users(PandoraWebDriverTestCase):
|
||||||
|
|
||||||
test_name = u'PAN_7'
|
test_name = u'Users'
|
||||||
test_description = u'Modify home screen, and check that change is correct. Return this change'
|
test_description = u'Users tests'
|
||||||
tickets_associated = []
|
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
|
driver = self.driver
|
||||||
self.login()
|
self.login()
|
||||||
detect_and_pass_all_wizards(driver)
|
detect_and_pass_all_wizards(driver)
|
||||||
|
@ -27,17 +32,9 @@ class PAN7(PandoraWebDriverTestCase):
|
||||||
self.logout()
|
self.logout()
|
||||||
self.login()
|
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
|
#Return this change
|
||||||
|
|
||||||
activate_home_screen(driver,"Default")
|
activate_home_screen(driver,"Default")
|
Loading…
Reference in New Issue