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
@@ -18,9 +18,9 @@ class LoginPage(BasePage):
def __init__(self, page: Page):
super().__init__(page)
# ── 定位器声明 ──
self.username_input = page.getByPlaceholder("请输入用户名")
self.password_input = page.getByPlaceholder("请输入密码")
self.login_btn = page.getByRole("button", name="登录")
self.username_input = page.get_by_placeholder("请输入用户名")
self.password_input = page.get_by_placeholder("请输入密码")
self.login_btn = page.get_by_role("button", name="登录")
self.error_tip = page.locator(".ant-form-item-explain-error")
def login(self, phone: str, password: str, expect_success: bool = True) -> None: