增加m登录成功的选择器

This commit is contained in:
he
2025-06-26 21:46:36 +08:00
parent 0733b31594
commit c9d4052296

View File

@@ -1385,9 +1385,10 @@ def playwright_m_login(username, password, code_2fa=None):
success_login_selector1 = 'span:has-text("Check your notifications on another device")' success_login_selector1 = 'span:has-text("Check your notifications on another device")'
success_login_selector2 = 'span:has-text("Go to your authentication app")' success_login_selector2 = 'span:has-text("Go to your authentication app")'
success_login_selector3 = 'span:has-text("Check your email")'
failed_login_selector = 'div[data-bloks-name="bk.components.dialog.Dialog"] > div[aria-label="Wrong Credentials"] > div:nth-child(1)' failed_login_selector = 'div[data-bloks-name="bk.components.dialog.Dialog"] > div[aria-label="Wrong Credentials"] > div:nth-child(1)'
# 等成功或失败两个选择的其中一个 # 等成功或失败
page.wait_for_selector(f'{success_login_selector1},{success_login_selector2}, {failed_login_selector}', page.wait_for_selector(f'{success_login_selector1},{success_login_selector2}, {success_login_selector3},{failed_login_selector}',
timeout=60000) timeout=60000)
# 判断是否失败 # 判断是否失败