Skip to content

Commit

Permalink
Cleaned up XPath
Browse files Browse the repository at this point in the history
Signed-off-by: LuXeZs <49080760+LuXeZs@users.noreply.github.com>
  • Loading branch information
Luminaex authored Nov 22, 2023
1 parent 17e8507 commit be3f670
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ def bootstrap_login_page(
login_fields['TOTP'] = driver.find_element(by=By.XPATH, value="//input[@placeholder='6-digit authentication code']")

case 'backup':
driver.find_element(By.XPATH, "//*[@id='app-mount']/div[2]/div[1]/div[1]/div/div/div/section/div[2]/div/div/form/div[3]/button[1]").click() # These will need to be cleaned up at some point but they work
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, "//*[@id='app-mount']/div[2]/div[1]/div[1]/div/div/div/section/div[2]/div/div/div[2]/div[2]"))) # Waits until element is clickable
driver.find_element(By.XPATH, "//*[@id='app-mount']/div[2]/div[1]/div[1]/div/div/div/section/div[2]/div/div/div[2]/div[2]").click() # These will need to be cleaned up at some point but they work
driver.find_element(By.XPATH, "//*[contains(text(), 'Verify with something else')]").click()
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, "//*[contains(text(), 'Use a backup code')]"))) # Waits until element is clickable
driver.find_element(By.XPATH, "//*[contains(text(), 'Use a backup code')]").click()
driver.implicitly_wait(1)
login_fields['TOTP'] = driver.find_element(by=By.XPATH, value="//input[@placeholder='8-digit backup code']")
driver.implicitly_wait(1)
Expand Down

0 comments on commit be3f670

Please sign in to comment.