Revert "Add functions for delete reports"

This reverts commit 20849ff0ff.
This commit is contained in:
cesar991 2016-06-20 17:05:14 +02:00
parent 51bfd8df56
commit 7b0cf4c585
1 changed files with 51 additions and 42 deletions

View File

@ -1,48 +1,57 @@
# -*- coding: utf-8 -*-
def test_pan4(self): from include.common_classes_60 import PandoraWebDriverTestCase
driver = self.driver from include.common_functions_60 import login, click_menu_element, refresh_N_times_until_find_element, detect_and_pass_all_wizards, create_user, is_element_present, create_report, logout
login(driver,"admin","pandora",self.base_url) from selenium import webdriver
detect_and_pass_all_wizards(driver) from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
#Creates a user with Chief Operator - Applications profile from selenium.webdriver.support.ui import Select
profile_list = [] from selenium.common.exceptions import StaleElementReferenceException
profile_list.append(("Chief Operator","Applications")) import unittest, time, re
create_user(driver,'PAN_4','PAN_4',email='pan_4@pandorafms.com',profile_list=profile_list)
#Creates report
create_report(driver,"PAN_4_Applications","Applications")
create_report(driver,"PAN_4_Servers","Servers")
#Logout
logout(driver,'http://127.0.0.1:85')
#Login
login(driver,user='PAN_4',passwd='PAN_4',self.base_url)
detect_and_pass_all_wizards(driver)
#Check that the report is visible
click_menu_element(driver,"Custom reporting")
driver.find_element_by_id('text-search').clear()
driver.find_element_by_id('text-search').send_keys("PAN_4_Applications")
driver.find_element_by_id('submit-search_submit').click()
self.assertEqual(is_element_present(driver, By.ID, 'report_list-0'),True)
#Check that the report is not visible class PAN4(PandoraWebDriverTestCase):
click_menu_element(driver,"Custom reporting")
driver.find_element_by_id('text-search').clear()
driver.find_element_by_id('text-search').send_keys("PAN_4_Servers")
driver.find_element_by_id('submit-search_submit').click()
self.assertEqual("No data found." in driver.page_source,True)
#Delete reports
logout(driver,self.base_url)
login(driver,self.base_url)
delete_report(driver,"PAN_4_Servers") test_name = u'PAN_4'
delete_report(driver,"PAN_4_Applications") test_description = u'Creates a user with Chief Operator permissions over the Applications group. Then creates two reports: one in the Applications group and other in the Servers group. Then, it checks that the given user can only see the Application report'
tickets_associated = []
def test_pan4(self):
driver = self.driver
login(driver,"admin","pandora")
detect_and_pass_all_wizards(driver)
#Creates a user with Chief Operator - Applications profile
profile_list = []
profile_list.append(("Chief Operator","Applications"))
create_user(driver,'PAN_4','PAN_4',email='pan_4@pandorafms.com',profile_list=profile_list)
#Creates report
create_report(driver,"PAN_4_Applications","Applications")
create_report(driver,"PAN_4_Servers","Servers")
#Logout
logout(driver,self.base_url)
#Login
login(driver,user='PAN_4',passwd='PAN_4')
detect_and_pass_all_wizards(driver)
#Check that the report is visible
click_menu_element(driver,"Custom reporting")
driver.find_element_by_id('text-search').clear()
driver.find_element_by_id('text-search').send_keys("PAN_4_Applications")
driver.find_element_by_id('submit-search_submit').click()
self.assertEqual(is_element_present(driver, By.ID, 'report_list-0'),True)
#Check that the report is not visible
click_menu_element(driver,"Custom reporting")
driver.find_element_by_id('text-search').clear()
driver.find_element_by_id('text-search').send_keys("PAN_4_Servers")
driver.find_element_by_id('submit-search_submit').click()
# ESTE NO ESTARÁ driver.find_element_by_id('report_list-0')
self.assertEqual("No data found." in driver.page_source,True)
if __name__ == "__main__": if __name__ == "__main__":
unittest.main() unittest.main()