From f85f6b82e8339837c23a880e852293a24cb7d04e Mon Sep 17 00:00:00 2001 From: cesar991 Date: Thu, 18 Aug 2016 11:33:30 +0200 Subject: [PATCH] Add Users.py and Bulk_operations.py --- tests/console/{PAN2.py => Bulk_operations.py} | 29 ++++++++++++------- tests/console/{PAN7.py => Users.py} | 25 +++++++--------- 2 files changed, 30 insertions(+), 24 deletions(-) rename tests/console/{PAN2.py => Bulk_operations.py} (70%) rename tests/console/{PAN7.py => Users.py} (65%) diff --git a/tests/console/PAN2.py b/tests/console/Bulk_operations.py similarity index 70% rename from tests/console/PAN2.py rename to tests/console/Bulk_operations.py index e60eb73644..2d779332dc 100644 --- a/tests/console/PAN2.py +++ b/tests/console/Bulk_operations.py @@ -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() diff --git a/tests/console/PAN7.py b/tests/console/Users.py similarity index 65% rename from tests/console/PAN7.py rename to tests/console/Users.py index fd6f095d5f..067da3bfdf 100644 --- a/tests/console/PAN7.py +++ b/tests/console/Users.py @@ -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")