in pages/desktop/base.py [0:0]
def click_logout(self):
user = WebDriverWait(
self.driver, 30, ignored_exceptions=StaleElementReferenceException
).until(
EC.element_to_be_clickable(
(
By.CSS_SELECTOR,
".Header-authenticate-button",
)
)
)
action = ActionChains(self.driver)
action.move_to_element(user)
action.pause(3)
action.perform()
# assigning the webelement to a variable before initializing the action chains can lead
# to stale element errors since the dropdown state changes when we hover over it
logout = WebDriverWait(
self.driver, 20, ignored_exceptions=StaleElementReferenceException
).until(EC.element_to_be_clickable(self._logout_locator))
action.move_to_element(logout)
action.pause(3)
action.click()
action.pause(3)
action.perform()
self.wait.until(
lambda s: self.is_element_displayed(*self._login_locator),
message="The login button was not displayed after logout",
)