- 354-1 자기 판 · 머리줄(f79a33ef3) · 367-2 접음 높이 0 · 367-6 범례 비킴을 손으로 되돌림(이력 그대로)
- 판 끌기 = 종단 · 유토 · 표 세 영역 같은 비율 · 놓을 때 유토 · 표 높이 확정
- 유토 손잡이 = 판 위 경계 밖 · 표 손잡이와 ±44 px 나란히 · 접기 = 숨김 · 표 판 = 열린 유토 위 쌓임
- 남김 = 유토 · 배수 [창 분할](유토는 판 좌상단 = 펼친 때만) · 367-1 늘 전체 맞춤 · 367-5 · 354-3 · 325-2
- 시험 test_354_1 다시 씀(세 영역 비례 · 손잡이 자리) · test_367_6 다시 씀(손잡이 = 판 밖 · 나란히) · 224_1b · 224_1c · 230_2 · 367_5 맞춤
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Se7ytqbohmBQnfYpwYFnYf
65 lines
3.4 KiB
Python
65 lines
3.4 KiB
Python
"""367-6 → 392-2 유토곡선 손잡이 · 범례 안 겹침 — 실제 브라우저(서버 없이 · 진짜 CSS).
|
|
|
|
10-14 판(392-2) — 유토 손잡이는 판 위 경계 **밖**(bottom = 판 높이 · JS 가 넣음)이라 판 안
|
|
범례(오른쪽 붙임)와 안 겹침 · 접힌 표 손잡이(바닥 간격 = 유토 높이)와 ±44 px 나란히.
|
|
판 폭마다 범례 단추 셋 · 두 손잡이 가운데 elementFromPoint = 그 단추.
|
|
"""
|
|
|
|
from pathlib import Path
|
|
|
|
ROOT = Path(__file__).resolve().parents[2]
|
|
CSS = [
|
|
"ui_template/ui_template_theme.css",
|
|
"ui_template/ui_template_overlay.css",
|
|
"common_util/common_util_mass_haul.css",
|
|
"B05_Profile/B05_Profile_UI_Style_MassHaul.css",
|
|
]
|
|
BUTTONS = ["도형 위치 초기화", "횡단 기준", "토량 분배"]
|
|
HANDLE = """<div class="b05-profile__{k}-handle" style="bottom:280px">
|
|
<button class="ui-workflow-overlay__handle ui-workflow-overlay__handle--bottom is-labeled">
|
|
<span class="ui-workflow-overlay__handle-icon"></span>
|
|
<span class="ui-workflow-overlay__handle-label">{label}</span></button></div>"""
|
|
HTML = (
|
|
"""
|
|
<div class="b05-route-profile__body-wrap" style="display:flex;width:{w}px;height:520px">
|
|
<div class="b05-profile__masshaul-overlay">
|
|
<div class="b05-profile__masshaul-scroll"></div>
|
|
<div class="b05-profile__masshaul-legend"><div class="b06-masshaul__legend">
|
|
<button class="b06-masshaul__legend-item b06-masshaul__legend-item--reset">도형 위치 초기화</button>
|
|
<button class="b06-masshaul__legend-item"><span class="b06-masshaul__legend-swatch"></span><span>횡단 기준</span></button>
|
|
<button class="b06-masshaul__legend-item"><span class="b06-masshaul__legend-swatch"></span><span>토량 분배</span></button>
|
|
</div></div>
|
|
</div>
|
|
"""
|
|
+ HANDLE.replace("{k}", "masshaul").replace("{label}", "유토곡선")
|
|
+ HANDLE.replace("{k}", "table").replace("{label}", "테이블")
|
|
+ "\n</div>"
|
|
)
|
|
PROBE = """() => [...document.querySelectorAll('button')].map((b) => {
|
|
const r = b.getBoundingClientRect();
|
|
const hit = document.elementFromPoint(r.left + r.width / 2, r.top + r.height / 2);
|
|
return [b.textContent.trim(), b === hit || b.contains(hit), Math.round(r.top),
|
|
Math.round(r.left + r.width / 2), Math.round(b.parentElement.getBoundingClientRect().bottom)];
|
|
})"""
|
|
TOP = "Math.round(document.querySelector('.b05-profile__masshaul-overlay').getBoundingClientRect().top)"
|
|
|
|
|
|
def test_legend_buttons_clear_of_handle():
|
|
from playwright.sync_api import sync_playwright
|
|
|
|
css = "\n".join((ROOT / p).read_text(encoding="utf-8") for p in CSS)
|
|
with sync_playwright() as p:
|
|
browser = p.chromium.launch(channel="msedge", headless=True)
|
|
page = browser.new_page(viewport={"width": 1300, "height": 600})
|
|
for width in (360, 434, 700, 1162):
|
|
page.set_content(f"<style>body{{margin:0}}{css}</style>{HTML.format(w=width)}")
|
|
rows = page.evaluate(PROBE)
|
|
assert [r[0] for r in rows] == [*BUTTONS, "유토곡선", "테이블"]
|
|
assert all(r[1] for r in rows), (width, rows)
|
|
mass, table = rows[3], rows[4]
|
|
# 손잡이 = 판 위 경계 밖(손잡이 바닥 = 판 위) · 두 손잡이 한 줄 · 가운데 ±44
|
|
assert mass[4] == page.evaluate(TOP), (width, rows)
|
|
assert mass[2] == table[2]
|
|
assert mass[3] - table[3] == 88
|
|
browser.close()
|