TT#122872 selenium: fix logout function

logout function would press the new "change password" button instead
of logout, this should fix it

Change-Id: I629fa1eb1dd13914cf7ff741c97dda0708a0889e
(cherry picked from commit 44d0352ec6)
mr9.5.1
Nico Schedel 4 years ago
parent d126413b2d
commit b952836c62

@ -25,7 +25,7 @@ def login_panel(driver, username="administrator", password="administrator"):
def logout_panel(driver):
driver.find_element_by_xpath('//*[@id="q-app"]//div/button[@aria-label="UserMenu"]').click()
driver.find_element_by_xpath('/html/body//div[@class="q-list"]/div[1]').click()
driver.find_element_by_xpath('/html/body//div[@class="q-list"]/div[2]').click()
WebDriverWait(driver, 10).until(EC.visibility_of_element_located((By.XPATH, '//*[@id="login-title"]')))

@ -757,7 +757,7 @@ class testrun(unittest.TestCase):
"""
print("Try to logout...", end="")
driver.find_element_by_xpath('//*[@id="q-app"]//div/button[@aria-label="UserMenu"]').click()
driver.find_element_by_xpath('/html/body//div[@class="q-list"]/div[1]').click()
driver.find_element_by_xpath('/html/body//div[@class="q-list"]/div[2]').click()
self.assertTrue(
len(driver.find_elements_by_xpath('//*[@id="login-title"]')) > 0, "Logout wasnt successful")
print("OK")

Loading…
Cancel
Save