fix: Playwright API camelCase → snake_case (Python 版)

- getByPlaceholder → get_by_placeholder
- getByRole → get_by_role
- getByText → get_by_text
- getByTestId → get_by_test_id
This commit is contained in:
xst
2026-07-15 10:52:16 +08:00
parent 7b4a54f1ce
commit 7c5a4c5de7
6 changed files with 18 additions and 18 deletions
+3 -3
View File
@@ -138,9 +138,9 @@ def ensure_login(web_config, page, config):
# ── skip_login: false,执行 UI 登录(可能有验证码,会失败) ──
page.goto(f"{base_url}/login")
page.getByPlaceholder("请输入用户名").fill(account["phone"])
page.getByPlaceholder("请输入密码").fill(account["password"])
page.getByRole("button", name="登录").click()
page.get_by_placeholder("请输入用户名").fill(account["phone"])
page.get_by_placeholder("请输入密码").fill(account["password"])
page.get_by_role("button", name="登录").click()
# 如果有图形验证码,这里会超时
try: