Fixed PAN4 indentation and optimized is_element_present function
This commit is contained in:
parent
b0700e82dd
commit
a690e70cdb
|
@ -19,7 +19,7 @@ class PAN4(PandoraWebDriverTestCase):
|
||||||
|
|
||||||
def test_pan4(self):
|
def test_pan4(self):
|
||||||
driver = self.driver
|
driver = self.driver
|
||||||
login(driver)
|
login(driver,user="admin",passwd="pandora",pandora_url=self.base_url)
|
||||||
detect_and_pass_all_wizards(driver)
|
detect_and_pass_all_wizards(driver)
|
||||||
|
|
||||||
#Creates a user with Chief Operator - Applications profile
|
#Creates a user with Chief Operator - Applications profile
|
||||||
|
@ -35,7 +35,7 @@ def test_pan4(self):
|
||||||
logout(driver,self.base_url)
|
logout(driver,self.base_url)
|
||||||
|
|
||||||
#Login
|
#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)
|
detect_and_pass_all_wizards(driver)
|
||||||
|
|
||||||
#Check that the report is visible
|
#Check that the report is visible
|
||||||
|
@ -56,7 +56,7 @@ def test_pan4(self):
|
||||||
|
|
||||||
#Delete reports
|
#Delete reports
|
||||||
logout(driver,self.base_url)
|
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_Servers")
|
||||||
delete_report(driver,"PAN_4_Applications")
|
delete_report(driver,"PAN_4_Applications")
|
||||||
|
|
|
@ -126,8 +126,14 @@ def search_user(driver,user_name):
|
||||||
|
|
||||||
def is_element_present(driver, how, what):
|
def is_element_present(driver, how, what):
|
||||||
from selenium.common.exceptions import NoSuchElementException
|
from selenium.common.exceptions import NoSuchElementException
|
||||||
try: driver.find_element(by=how, value=what)
|
try:
|
||||||
except NoSuchElementException: return False
|
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
|
return True
|
||||||
|
|
||||||
def detect_and_pass_pandorin(driver):
|
def detect_and_pass_pandorin(driver):
|
||||||
|
|
Loading…
Reference in New Issue