Skip to content

Commit

Permalink
Wait condition for totp login
Browse files Browse the repository at this point in the history
  • Loading branch information
sunetfreitag committed Jun 25, 2024
1 parent d16781d commit dd08a44
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test_login_selenium_totp.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,17 +203,17 @@ def test_node_login(self):
currentUrl = driver.current_url
# self.assertEqual(dashboardUrl, currentUrl)

totpRetry = 1
totpRetry = 0
while totpRetry <= 3:
try:
try:
self.logger.info(f'Waiting for files app button')
totpRetry += 1
self.logger.info(f'Try {totpRetry} waiting for files app button')
wait.until(EC.presence_of_element_located((By.XPATH, '//a[@href="'+ '/index.php/apps/files/' +'"]')))
files = driver.find_element(By.XPATH, '//a[@href="'+ '/index.php/apps/files/' +'"]')
files.click()
except:
self.logger.warning(f'TOTP {totpRetry} failed, trying again')
totpRetry += 1
except:
self.logger.error(f'TOTP failed {totpRetry} times')
screenshot = pyautogui.screenshot()
Expand Down

0 comments on commit dd08a44

Please sign in to comment.