chore: auto release commit (2026-09-15 01:27:04)
Some checks failed
技能自动化发布 / release (push) Failing after 4s

This commit is contained in:
2026-09-15 01:27:05 +08:00
parent 430274dbf9
commit ebea77b5f2
5 changed files with 176 additions and 27 deletions

View File

@@ -1408,6 +1408,10 @@ class _FakeLocator:
def click(self) -> None:
self._click_log.append(self._value or "clicked")
def fill(self, value: str) -> None:
"""v1.1.27:fill 后 value 立即更新。"""
self._value = value
class _FakeLocatorRouter:
"""根据 selector 返回对应 _FakeLocator 的路由器。
@@ -1588,6 +1592,61 @@ def test_wait_for_login_inputs_filled_auto_click_v1_26() -> tuple[bool, str]:
pc.HUMAN_PROMPT_INTERVAL = orig_prompt
def test_fill_demo_on_spa_login_basic_v1_27() -> tuple[bool, str]:
"""v1.1.27:`_fill_demo_on_spa_login` ——SPA 二级登录页 input 默认不预填,
必须主动 fill demo/123456 再点登录按钮。
"""
click_log: list[str] = []
page = _FakePlaywrightPage(
url="https://sandbox.jc2009.com/industries/campus/smartcampus/login",
selectors={
"#jc-user": _FakeLocator(count=1, value=""), # 空 → 要 fill
"#jc-pass": _FakeLocator(count=1, value=""),
"button:has-text('Sign in')": _FakeLocator(count=1, click_log=click_log),
},
)
from service.platform_collector import _fill_demo_on_spa_login
if not _fill_demo_on_spa_login(page):
return False, "SPA login fill demo 应成功"
if not click_log:
return False, f"应点 Sign in,但 click_log={click_log}"
return True, f"SPA 二级登录页 demo/123456 自动 fill+点 OK(click_log={click_log})"
def test_fill_demo_on_spa_login_chinese_button_v1_27() -> tuple[bool, str]:
"""v1.1.27:中文「登录」按钮(用户截图版本)也能 fill demo/123456 并点。"""
click_log: list[str] = []
page = _FakePlaywrightPage(
url="https://sandbox.jc2009.com/industries/campus/smartcampus/login",
selectors={
"input[type='tel']": _FakeLocator(count=1, value=""),
"input[type='password']": _FakeLocator(count=1, value=""),
"button:has-text('登录')": _FakeLocator(count=1, click_log=click_log),
},
)
from service.platform_collector import _fill_demo_on_spa_login
if not _fill_demo_on_spa_login(page):
return False, "SPA login 中文按钮 fill demo 应成功"
if not click_log:
return False, f"应点 登录,但 click_log={click_log}"
return True, f"SPA 二级登录页中文「登录」按钮 OK(click_log={click_log})"
def test_fill_demo_on_spa_login_no_input_returns_false_v1_27() -> tuple[bool, str]:
"""v1.1.27:找不到 user input(页面不是 login 页)→ 返回 False。"""
page = _FakePlaywrightPage(
url="https://sandbox.jc2009.com/industries/campus/smartcampus/app/home",
selectors={},
)
from service.platform_collector import _fill_demo_on_spa_login
if _fill_demo_on_spa_login(page):
return False, "无 login input 应返回 False"
return True, "无 login input 返回 False OK"
# ---------- v1.1.18: show-config / logs-list ----------
@@ -1866,6 +1925,9 @@ def main() -> int:
_run("login_flow/auto_sign_in_no_input_returns_false", test_try_auto_sign_in_no_input_returns_false)
_run("login_flow/auto_sign_in_selector_timeout_returns_false", test_try_auto_sign_in_selector_timeout_returns_false)
_run("login_flow/wait_login_inputs_filled_auto_click_v1_26", test_wait_for_login_inputs_filled_auto_click_v1_26)
_run("login_flow/fill_demo_on_spa_login_basic_v1_27", test_fill_demo_on_spa_login_basic_v1_27)
_run("login_flow/fill_demo_on_spa_login_chinese_button_v1_27", test_fill_demo_on_spa_login_chinese_button_v1_27)
_run("login_flow/fill_demo_on_spa_login_no_input_returns_false_v1_27", test_fill_demo_on_spa_login_no_input_returns_false_v1_27)
_run("show_config/masks_tokens", test_show_config_masks_tokens)
_run("show_config/skips_empty", test_show_config_skips_empty)
_run("show_config/skips_comments", test_show_config_skips_comments)