diff --git a/tests/console/ACL.py b/tests/console/ACL.py index db4189b914..c9f42bba9b 100644 --- a/tests/console/ACL.py +++ b/tests/console/ACL.py @@ -13,6 +13,7 @@ from selenium.common.exceptions import NoSuchElementException from selenium.common.exceptions import NoAlertPresentException from selenium.webdriver.remote.webelement import WebElement import unittest2, time, re +import logging class ACLPropagation(PandoraWebDriverTestCase): @@ -26,6 +27,9 @@ class ACLPropagation(PandoraWebDriverTestCase): ACL Propagation test: Creates one group "A" with ACL propagation, then a group "B" son of "A" with no ACL propagation, and finally group "C". The test asserts if a user with privileges to "A" can see the agent of "B" but no agents of "C". """ + + logging.basicConfig(filename="ACL.log", level=logging.INFO, filemode='w') + group_name_A = gen_random_string(6) group_name_B = gen_random_string(6) group_name_C = gen_random_string(6) @@ -69,6 +73,8 @@ class ACLPropagation(PandoraWebDriverTestCase): search_agent(driver,agent_name_B,go_to_agent=False) element = driver.find_elements_by_xpath('//a[contains(.,"'+agent_name_B+'")]') self.assertEqual(element,[]) + + logging.info("test_ACL_propagation is correct") class ACLReports(PandoraWebDriverTestCase): @@ -124,6 +130,8 @@ class ACLReports(PandoraWebDriverTestCase): element = driver.find_element_by_xpath('//td[contains(.,"No data found.")]') self.assertIsInstance(element,WebElement) + logging.info("test_ACL_reports is correct") + class ACLTags(PandoraWebDriverTestCase): test_name = u'ACL tag test' @@ -175,6 +183,8 @@ class ACLTags(PandoraWebDriverTestCase): #The user should NOT be able to see the module without tag #modules = driver.find_elements_by_xpath('//td[contains(.,"'+module_name_A+'")]') #self.assertEqual(modules,[]) + + #logging.info("test_ACL_tag is correct") if __name__ == "__main__": unittest2.main() diff --git a/tests/console/Alerts.py b/tests/console/Alerts.py index f86a29cfee..5898f8d234 100644 --- a/tests/console/Alerts.py +++ b/tests/console/Alerts.py @@ -10,6 +10,7 @@ from selenium.common.exceptions import StaleElementReferenceException, NoSuchEle from selenium.common.exceptions import NoAlertPresentException from selenium.webdriver.remote.webelement import WebElement import unittest2, time, re +import logging class Alerts (PandoraWebDriverTestCase): @@ -21,7 +22,9 @@ class Alerts (PandoraWebDriverTestCase): u""" Create a new alert action using eMail command and check that create ok """ - + + logging.basicConfig(filename="Alerts.log", level=logging.INFO, filemode='w') + action_name = gen_random_string(6) driver = self.driver @@ -38,6 +41,8 @@ class Alerts (PandoraWebDriverTestCase): element = driver.find_element_by_xpath('//a[contains(.,"'+action_name+'")]') self.assertIsInstance(element,WebElement) + logging.info("test_A_create_new_email_action is correct") + def test_B_create_new_action_command(self): u""" @@ -67,6 +72,8 @@ class Alerts (PandoraWebDriverTestCase): element = driver.find_element_by_xpath('//a[contains(.,"'+action_name+'")]') self.assertIsInstance(element,WebElement) + logging.info("test_B_create_new_action_command") + def test_C_create_new_template(self): u""" @@ -93,6 +100,8 @@ class Alerts (PandoraWebDriverTestCase): element = driver.find_element_by_xpath('//a[contains(.,"'+template_name+'")]') self.assertIsInstance(element,WebElement) + logging.info("test_C_create_new_template is correct") + def test_D_edit_template_created(self): u""" @@ -138,6 +147,8 @@ class Alerts (PandoraWebDriverTestCase): self.assertEqual("_agentdescription_" in driver.page_source,True) + logging.info("test_D_edit_template_created is correct") + if __name__ == "__main__": unittest2.main()