feat(A05 가이드 캡처): 걸음 mouse_click(좌표 · sel 기준 · 오른쪽 · 더블) · optional(요소 없으면 건너뜀) · 검사 부분 짝 파일로 분리 · 시험 덧

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-26 09:56:57 +09:00
co-authored by Claude Sonnet 5.5
parent 434cbcceb1
commit e3e3531647
3 changed files with 384 additions and 204 deletions
@@ -266,3 +266,59 @@ def test_list_shows_account(capsys):
d = _folder([_scene(account="user")])
assert G.main(["--page", "B05", "--out", str(d), "--list"]) == 0
assert "user" in capsys.readouterr().out
# --- 359-6 걸음 둘 덧: mouse_click · optional ---
@pytest.mark.parametrize(
"step",
[
{"mouse_click": [10, 20]},
{"mouse_click": [10.5, 20], "sel": ".canvas", "button": "right", "double": True},
{"mouse_click": [0, 0], "sel": "text=닫기", "optional": True, "frame": "iframe"},
{"click": ".card", "optional": True},
{"contextmenu": ".n", "optional": True},
{"hover": ".n", "optional": True},
{"wait": ".n", "optional": True},
{"press": "Escape", "sel": ".n", "optional": True},
],
)
def test_new_steps_pass(step):
assert G.check_scene(_scene(before=[step]), "B05") == []
@pytest.mark.parametrize(
"step",
[
{"mouse_click": [1]},
{"mouse_click": "1,2"},
{"mouse_click": [True, 2]},
{"mouse_click": [1, "2"]},
{"mouse_click": [1, 2], "button": "middle"},
{"mouse_click": [1, 2], "double": "yes"},
{"mouse_click": [1, 2], "sel": ""},
{"mouse_click": [1, 2], "sel": "text=저장"},
{"mouse_click": [1, 2], "confirm": True},
{"mouse_click": [1, 2], "optional": True}, # 요소 없는 단계
{"press": "Escape", "optional": True},
{"wait_ms": 100, "optional": True},
{"eval": "1", "optional": True},
{"click": ".a", "optional": "yes"},
{"click": ".a", "button": "right"},
{"click": ".a", "double": True},
{"mouse_click": [1, 2], "click": ".a"},
],
)
def test_new_steps_rejected(step):
assert G.check_scene(_scene(before=[step]), "B05")
def test_step_target():
assert G.step_target({"click": ".a"}) == ".a"
assert G.step_target({"press": "Enter", "sel": ".b"}) == ".b"
assert G.step_target({"mouse_click": [1, 2], "sel": ".c"}) == ".c"
assert G.step_target({"mouse_click": [1, 2]}) is None
assert G.step_target({"press": "Enter"}) is None
assert G.step_target({"wait_ms": 5}) is None
assert G.step_target({"eval": "1"}) is None