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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user