Skip to content

Commit

Permalink
Wait for css name instead of xpath for totp input field
Browse files Browse the repository at this point in the history
  • Loading branch information
sunetfreitag committed Oct 15, 2024
1 parent 717fb8e commit ea9c7a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mfazones-docker/test_mfazones_dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ def nodelogin(nextcloudnode='localhost:8443',user='selenium'):
nodetotpsecret = g_envConfig[f'MFA_NEXTCLOUD_{user.upper()}_SECRET']
nodeapppwd = g_envConfig[f'MFA_NEXTCLOUD_{user.upper()}_APP_PASSWORD']

g_isLoggedIn = True
g_loggedInNodes[nextcloudnode] = True

g_driver.maximize_window()
Expand All @@ -118,7 +117,8 @@ def nodelogin(nextcloudnode='localhost:8443',user='selenium'):
time.sleep(3)
currentOtp = totp.now()
g_logger.info(f'Send OTP: {currentOtp}')
g_wait.until(EC.presence_of_element_located((By.XPATH, '//*[@id="body-login"]/div[1]/div/main/div/form/input'))).send_keys(currentOtp + Keys.ENTER)
g_wait.until(EC.presence_of_element_located((By.NAME, 'challenge'))).send_keys(currentOtp + Keys.ENTER)

time.sleep(1)
currentUrl = g_driver.current_url
if '/challenge/totp' in currentUrl:
Expand Down

0 comments on commit ea9c7a0

Please sign in to comment.