Fixed PAN4 indentation and optimized is_element_present function

This commit is contained in:
axl89 2016-06-20 18:36:48 +02:00
parent b0700e82dd
commit a690e70cdb
2 changed files with 50 additions and 44 deletions

View File

@ -19,7 +19,7 @@ class PAN4(PandoraWebDriverTestCase):
def test_pan4(self):
driver = self.driver
login(driver)
login(driver,user="admin",passwd="pandora",pandora_url=self.base_url)
detect_and_pass_all_wizards(driver)
#Creates a user with Chief Operator - Applications profile
@ -35,7 +35,7 @@ def test_pan4(self):
logout(driver,self.base_url)
#Login
login(driver,user='PAN_4',passwd='PAN_4')
login(driver,user='PAN_4',passwd='PAN_4',pandora_url=self.base_url)
detect_and_pass_all_wizards(driver)
#Check that the report is visible
@ -56,7 +56,7 @@ def test_pan4(self):
#Delete reports
logout(driver,self.base_url)
login(driver)
login(driver,user="admin",passwd="pandora",pandora_url=self.base_url)
delete_report(driver,"PAN_4_Servers")
delete_report(driver,"PAN_4_Applications")

View File

@ -126,8 +126,14 @@ def search_user(driver,user_name):
def is_element_present(driver, how, what):
from selenium.common.exceptions import NoSuchElementException
try: driver.find_element(by=how, value=what)
except NoSuchElementException: return False
try:
driver.implicitly_wait(5)
driver.find_element(by=how, value=what)
except NoSuchElementException:
driver.implicitly_wait(5)
return False
driver.implicitly_wait(30)
return True
def detect_and_pass_pandorin(driver):