diff --git a/tests/console/PAN8.py b/tests/console/PAN8.py index 751bf23d16..55043fb1fd 100644 --- a/tests/console/PAN8.py +++ b/tests/console/PAN8.py @@ -26,37 +26,37 @@ class PAN8(PandoraWebDriverTestCase): create_agent(driver,"PAN_8",group="Applications",ip="192.168.50.50") - #Creamos modulo without tag + #We create a module without a tag create_network_server_module(driver,"PAN_8",module_name="Without tag",component_group="Network Management",network_component="Host Alive",ip="192.168.50.50") - #Module Host Alive with Tag + #We now create a modulo with tag "critical" create_network_server_module(driver,"PAN_8",module_name="With tag",component_group="Network Management",network_component="Host Alive",ip="192.168.50.50",tag_name="critical") l = [("Operator (Read)","All",["critical"])] - create_user(driver,"prueba ACL","pandora",profile_list=l) + create_user(driver,"PAN8_user","pandora",profile_list=l) logout(driver,self.base_url) - login(driver,user="prueba ACL") + login(driver,user="PAN8_user") detect_and_pass_all_wizards(driver) - #Función comprobar que existe un módulo: - search_agent(driver,"PAN_8") - - try: + + try: + #The user should be able to see the module with Tag self.assertEqual("With tag" in driver.page_source,True) except AssertionError as e: self.verificationErrors.append(str(e)) try: - self.assertEqual("Without tag" in driver.page_source,False) - except AssertionError as e: - self.verificationErrors.append(str(e)) + #The user should NOT be able to see the module without tag + self.assertEqual("Without tag" in driver.page_source,False) + except AssertionError as e: + self.verificationErrors.append(str(e)) if __name__ == "__main__": unittest.main() diff --git a/tests/console/include/user_functions.py b/tests/console/include/user_functions.py index a0008b2156..d9b54a31d3 100644 --- a/tests/console/include/user_functions.py +++ b/tests/console/include/user_functions.py @@ -18,20 +18,19 @@ def add_user_profile(driver,user_name,profile,group,tags=[]): driver.find_element_by_xpath('//*[@id="table3-0-6"]/a[2]').click() Select(driver.find_element_by_id("assign_profile")).select_by_visible_text(profile) + if group == "All": Select(driver.find_element_by_id("assign_group")).select_by_visible_text(group) else: #TODO This will not work when choosing a group within a group within another group Select(driver.find_element_by_id("assign_group")).select_by_visible_text(" "+group) - #driver.find_element_by_id("image-add2").click() + for tag in tags: + Select(driver.find_element_by_id("assign_tags")).select_by_visible_text(tag) - for tag in tags: - Select(driver.find_element_by_id("assign_tags")).select_by_visible_text(tag) - - #If we do not provide tags, we NEED to leave "Any" selected, otherwise we need to deselect it. - if tags != []: - Select(driver.find_element_by_id("assign_tags")).deselect_by_visible_text("Any") + #If we do not provide tags, we NEED to leave "Any" selected, otherwise we need to deselect it. + if tags != []: + Select(driver.find_element_by_id("assign_tags")).deselect_by_visible_text("Any") driver.find_element_by_xpath('//*[@name="add"]').click()