diff --git a/tests/console/Bulk_operations.py b/tests/console/Bulk_operations.py index 47fc1afcd1..d582d1dcea 100644 --- a/tests/console/Bulk_operations.py +++ b/tests/console/Bulk_operations.py @@ -51,7 +51,6 @@ class Bulk_operations(PandoraWebDriverTestCase): 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)") - def test_B_edit_agents_group_bulk_operations(self): @@ -85,6 +84,37 @@ class Bulk_operations(PandoraWebDriverTestCase): 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(.,"Agents updated successfully(2)")]').text,"Agents updated successfully(2)") + def test_C_edit_agent_description_bulk_operation(self): + + u""" + Create two agents and edit description with bulk operation + """ + + agent_name_1 = gen_random_string(6) + agent_name_2 = gen_random_string(6) + + driver = self.driver + + activate_api(driver,"1234") + + params = [agent_name_1,"127.0.0.1","0","4","0","300","2","pandorafms","2","0","0","pruebas"] + create_agent_api(driver,params,user="admin",pwd="pandora") + + params = [agent_name_2,"127.0.0.1","0","4","0","300","2","pandorafms","2","0","0","pruebas"] + create_agent_api(driver,params,user="admin",pwd="pandora") + + lista = driver.current_url.split('/') + + url = lista[0]+'//'+lista[2]+'/pandora_console' + + driver.get(url) + + agent_names_list = [agent_name_1,agent_name_2] + + edit_agents_in_bulk(driver,agent_names_list,new_description="test C edit description bulk operation") + 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(.,"Agents updated successfully(2)")]').text,"Agents updated successfully(2)") + if __name__ == "__main__": unittest.main() diff --git a/tests/console/include/bulk_operations.py b/tests/console/include/bulk_operations.py index 7e6193750b..d13895c20e 100644 --- a/tests/console/include/bulk_operations.py +++ b/tests/console/include/bulk_operations.py @@ -33,7 +33,7 @@ def edit_agents_in_bulk(driver,agent_names_list,new_group=None,new_description=N time.sleep(3) if new_group != None: - #driver.find_element_by_id("group").click() + Select(driver.find_element_by_id("group")).select_by_visible_text(new_group) if new_description != None: