Fixed logout

(cherry picked from commit 30e6d0f00d)
This commit is contained in:
cesar991 2016-06-17 13:47:03 +02:00 committed by axl89
parent 9c95212851
commit ae4beb12da
2 changed files with 8 additions and 2 deletions

View File

@ -50,7 +50,7 @@ class PandoraWebDriverTestCase(TestCase):
self.sauce_labs_job_id = self.driver.session_id # We store this information to update the job info when the tests are done self.sauce_labs_job_id = self.driver.session_id # We store this information to update the job info when the tests are done
self.driver.implicitly_wait(30) self.driver.implicitly_wait(30)
self.base_url = "http://localhost/" self.base_url = "http://127.0.0.1/"
self.verificationErrors = [] self.verificationErrors = []
self.accept_next_alert = True self.accept_next_alert = True
super(PandoraWebDriverTestCase, self).setUp() super(PandoraWebDriverTestCase, self).setUp()

View File

@ -44,7 +44,13 @@ def refresh_N_times_until_find_element(driver,n,element_text,how=By.ID,refresh_t
raise TimeoutException("Element %s not found" % (element_text)) raise TimeoutException("Element %s not found" % (element_text))
def logout(driver,url): def logout(driver,url):
driver.get(url+'/pandora_console/index.php?bye=bye') if url[-1] != '/':
driver.find_element_by_xpath('//div[@id="container"]//a[@href="'+url+'/pandora_console/index.php?bye=bye"]').click()
else:
driver.find_element_by_xpath('//div[@id="container"]//a[@href="'+url+'pandora_console/index.php?bye=bye"]').click()
driver.get(url+"/pandora_console/index.php")
refresh_N_times_until_find_element(driver,2,"nick")
def create_report(driver,nombre,group_name): def create_report(driver,nombre,group_name):
click_menu_element(driver,"Custom reporting") click_menu_element(driver,"Custom reporting")