chore: import 3d-drawing history from local Code/3d-drawing (subfolder, history preserved)
This commit is contained in:
commit
7b754e810b
51 files changed
+20300
No files matched your search
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Headless browser check of the 3D viewer (Task 6, V11).
|
||||
Needs Playwright + Chromium and the viewer/model served over HTTP, e.g.
|
||||
python3 -m http.server 8765 (from Code/3d-drawing)
|
||||
python3 verify_viewer_headless.py http://127.0.0.1:8765/viewer/index.html <chromium_path>
|
||||
Checks: page loads without page errors, canvas exists, meta text is shown,
|
||||
and a click on the lining (other layers hidden) returns station and pattern.
|
||||
"""
|
||||
import sys
|
||||
from playwright.sync_api import sync_playwright
|
||||
|
||||
URL, CHROME = sys.argv[1], sys.argv[2]
|
||||
with sync_playwright() as p:
|
||||
b = p.chromium.launch(executable_path=CHROME, args=["--use-gl=swiftshader", "--enable-webgl", "--ignore-gpu-blocklist", "--no-sandbox"])
|
||||
pg = b.new_page(viewport={"width": 1280, "height": 800})
|
||||
errors = []
|
||||
pg.on("pageerror", lambda e: errors.append(str(e)))
|
||||
pg.goto(URL, wait_until="networkidle", timeout=90000)
|
||||
pg.wait_for_timeout(6000)
|
||||
canvas = pg.evaluate("() => !!document.querySelector('canvas')")
|
||||
body = pg.evaluate("() => document.body.innerText")
|
||||
print("page errors:", errors)
|
||||
print("canvas present:", canvas, "| meta shown:", "패턴:" in body and "범위:" in body)
|
||||
for label in ["excavation_R7402", "road_surface", "ground_GL"]:
|
||||
pg.locator("label", has_text=label).locator("input").uncheck()
|
||||
pg.wait_for_timeout(500)
|
||||
readout = None
|
||||
for fx in [0.5, 0.45, 0.55, 0.4, 0.6, 0.35, 0.65]:
|
||||
for fy in [0.5, 0.45, 0.55, 0.4, 0.6]:
|
||||
pg.mouse.click(1280 * fx, 800 * fy)
|
||||
pg.wait_for_timeout(200)
|
||||
t = pg.evaluate("() => { const els=[...document.querySelectorAll('div,pre,p')]; return els.map(e=>e.innerText).filter(s=>s && s.includes('교차점')).pop()||null }")
|
||||
if t and "측점" in t:
|
||||
readout = t
|
||||
break
|
||||
if readout:
|
||||
break
|
||||
print("lining readout:", (readout or "NO LINING HIT").replace("\n", " | ")[:700])
|
||||
b.close()
|
||||
Reference in new issue
Block a user