fix(3d): unified conveyorNetwork, physical B receiver, C/D containment, belt sync, real STL
This commit is contained in:
62
scripts/qa_after.py
Normal file
62
scripts/qa_after.py
Normal file
@@ -0,0 +1,62 @@
|
||||
import time
|
||||
from pathlib import Path
|
||||
from playwright.sync_api import sync_playwright
|
||||
|
||||
out = Path('docs/final_physics_fix_screenshots/after')
|
||||
out.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
# (absolute_ms_from_play, filename)
|
||||
TARGETS = [
|
||||
(1300, '02_belt_sync_t0.png'),
|
||||
(2300, '03_belt_sync_t1_delta_1m.png'),
|
||||
(2600, '01_stl_box_on_belt.png'),
|
||||
(3800, '10_no_overlay_overlap.png'),
|
||||
(9500, '04_b_receiver_item_settled.png'),
|
||||
(10500, '09_all_zones_physical.png'),
|
||||
(26800, '05_chute_c_motion.png'),
|
||||
(28900, '06_item_inside_c_cage.png'),
|
||||
(46400, '07_chute_d_motion.png'),
|
||||
(48500, '08_item_inside_d_cage.png'),
|
||||
]
|
||||
|
||||
errs = []
|
||||
with sync_playwright() as p:
|
||||
browser = p.chromium.launch(headless=True)
|
||||
page = browser.new_page(viewport={"width": 1440, "height": 900})
|
||||
page.on('console', lambda m: errs.append(f"{m.type}: {m.text}") if m.type == 'error' else None)
|
||||
page.on('pageerror', lambda e: errs.append(f"pageerror: {e}"))
|
||||
page.goto('https://arhipovdan.ru/?qa=after', wait_until='networkidle')
|
||||
page.wait_for_timeout(1500)
|
||||
page.get_by_label('Play demo').click()
|
||||
t0 = time.monotonic()
|
||||
for abs_ms, name in TARGETS:
|
||||
target_s = abs_ms / 1000.0
|
||||
while True:
|
||||
elapsed = time.monotonic() - t0
|
||||
if elapsed >= target_s:
|
||||
break
|
||||
page.wait_for_timeout(int(min(200, (target_s - elapsed) * 1000)))
|
||||
page.screenshot(path=str(out / name))
|
||||
print(f"captured {name} at ~{int((time.monotonic()-t0)*1000)}ms")
|
||||
browser.close()
|
||||
|
||||
# Mobile + details in a fresh context
|
||||
with sync_playwright() as p:
|
||||
browser = p.chromium.launch(headless=True)
|
||||
m = browser.new_page(viewport={"width": 390, "height": 844})
|
||||
m.on('console', lambda msg: errs.append(f"mobile {msg.type}: {msg.text}") if msg.type == 'error' else None)
|
||||
m.goto('https://arhipovdan.ru/', wait_until='networkidle')
|
||||
m.wait_for_timeout(2500)
|
||||
m.screenshot(path=str(out / '11_mobile.png'), full_page=True)
|
||||
scroll_w = m.evaluate("document.documentElement.scrollWidth")
|
||||
client_w = m.evaluate("document.documentElement.clientWidth")
|
||||
print(f"MOBILE scrollWidth={scroll_w} clientWidth={client_w} horizontal_scroll={scroll_w > client_w}")
|
||||
|
||||
d = browser.new_page(viewport={"width": 1440, "height": 900})
|
||||
d.on('console', lambda msg: errs.append(f"details {msg.type}: {msg.text}") if msg.type == 'error' else None)
|
||||
d.goto('https://arhipovdan.ru/details', wait_until='networkidle')
|
||||
d.wait_for_timeout(2000)
|
||||
d.screenshot(path=str(out / '12_details.png'), full_page=False)
|
||||
browser.close()
|
||||
|
||||
print("CONSOLE_ERRORS:" + ("\n".join(errs) if errs else "NONE"))
|
||||
19
scripts/qa_before.py
Normal file
19
scripts/qa_before.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from pathlib import Path
|
||||
from playwright.sync_api import sync_playwright
|
||||
out = Path('docs/final_physics_fix_screenshots/before')
|
||||
out.mkdir(parents=True, exist_ok=True)
|
||||
with sync_playwright() as p:
|
||||
browser = p.chromium.launch(headless=True)
|
||||
page = browser.new_page(viewport={"width":1440,"height":900})
|
||||
errs=[]
|
||||
page.on('console', lambda m: errs.append(f"{m.type}: {m.text}") if m.type=='error' else None)
|
||||
page.on('pageerror', lambda e: errs.append(f"pageerror: {e}"))
|
||||
page.goto('https://arhipovdan.ru/?qa=before', wait_until='networkidle')
|
||||
page.wait_for_timeout(2000)
|
||||
page.screenshot(path=str(out/'before_idle.png'), full_page=True)
|
||||
page.get_by_label('Play demo').click()
|
||||
for i in range(12):
|
||||
page.wait_for_timeout(1500)
|
||||
page.screenshot(path=str(out/f'before_t{i:02d}.png'), full_page=True)
|
||||
print("ERRORS:" + "\n".join(errs) if errs else "NO_CONSOLE_ERRORS")
|
||||
browser.close()
|
||||
93
scripts/qa_screenshots.py
Normal file
93
scripts/qa_screenshots.py
Normal file
@@ -0,0 +1,93 @@
|
||||
import time
|
||||
from pathlib import Path
|
||||
from playwright.sync_api import sync_playwright
|
||||
|
||||
out = Path('docs/final_physical_acceptance_screenshots')
|
||||
out.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
with sync_playwright() as p:
|
||||
browser = p.chromium.launch(headless=True)
|
||||
page = browser.new_page(viewport={"width": 1440, "height": 900}, device_scale_factor=1)
|
||||
errors = []
|
||||
page.on('console', lambda msg: errors.append(f"console.{msg.type}: {msg.text}") if msg.type == 'error' else None)
|
||||
page.on('pageerror', lambda exc: errors.append(f"pageerror: {exc}"))
|
||||
|
||||
page.goto('https://arhipovdan.ru/?qa=final', wait_until='networkidle')
|
||||
page.wait_for_timeout(2000)
|
||||
page.screenshot(path=str(out / '01_home_idle.png'), full_page=True)
|
||||
|
||||
page.get_by_label('Play demo').click()
|
||||
|
||||
def wait_for_hud(text, timeout=20000):
|
||||
try:
|
||||
page.wait_for_selector(f".main-hud:has-text('{text}')", timeout=timeout)
|
||||
except Exception as e:
|
||||
errors.append(f"Timeout waiting for HUD text: {text} - {e}")
|
||||
|
||||
# Case 1: box_b -> B
|
||||
wait_for_hud('1/8')
|
||||
wait_for_hud('CV Detection')
|
||||
page.screenshot(path=str(out / '02_stl_item_on_belt.png'), full_page=True)
|
||||
|
||||
wait_for_hud('Routing to zone')
|
||||
page.screenshot(path=str(out / '03_belt_sync_t0.png'), full_page=True)
|
||||
page.wait_for_timeout(1000)
|
||||
page.screenshot(path=str(out / '04_belt_sync_t1.png'), full_page=True)
|
||||
|
||||
# Wait for Exit to zone for Case 1 (route to B)
|
||||
wait_for_hud('Exit to zone')
|
||||
page.screenshot(path=str(out / '05_route_to_b.png'), full_page=True)
|
||||
|
||||
# Case 3: oversized_box_c -> C
|
||||
wait_for_hud('3/8')
|
||||
wait_for_hud('Routing to zone', timeout=30000)
|
||||
page.screenshot(path=str(out / '06_route_to_c_chute.png'), full_page=True)
|
||||
|
||||
wait_for_hud('4/8', timeout=20000) # Case 3 is settled
|
||||
page.wait_for_timeout(500)
|
||||
page.screenshot(path=str(out / '07_settled_in_c_cage.png'), full_page=True)
|
||||
|
||||
# Case 5: plate_d -> D
|
||||
wait_for_hud('5/8', timeout=30000)
|
||||
wait_for_hud('Routing to zone', timeout=20000)
|
||||
page.screenshot(path=str(out / '08_route_to_d_chute.png'), full_page=True)
|
||||
|
||||
wait_for_hud('6/8', timeout=20000) # Case 5 is settled
|
||||
page.wait_for_timeout(500)
|
||||
page.screenshot(path=str(out / '09_settled_in_d_cage.png'), full_page=True)
|
||||
|
||||
# Case 7: c_priority -> C
|
||||
wait_for_hud('7/8', timeout=30000)
|
||||
wait_for_hud('Routing to zone', timeout=20000)
|
||||
page.screenshot(path=str(out / '10_c_priority_to_c.png'), full_page=True)
|
||||
|
||||
# Case 8: low_confidence -> warning
|
||||
wait_for_hud('8/8', timeout=30000)
|
||||
wait_for_hud('⚠', timeout=20000) # Wait for warning
|
||||
page.screenshot(path=str(out / '11_low_confidence_warning.png'), full_page=True)
|
||||
|
||||
# Wait for demo complete
|
||||
try:
|
||||
page.wait_for_selector('text=All 8 cases demonstrated successfully', timeout=60000)
|
||||
page.screenshot(path=str(out / '12_demo_complete.png'), full_page=True)
|
||||
except Exception as e:
|
||||
errors.append(f"Timeout waiting for Demo Complete: {e}")
|
||||
|
||||
# Mobile
|
||||
page.set_viewport_size({"width": 390, "height": 844})
|
||||
page.wait_for_timeout(1000)
|
||||
page.screenshot(path=str(out / '13_mobile.png'), full_page=True)
|
||||
|
||||
# Details
|
||||
page.goto('https://arhipovdan.ru/details?qa=final', wait_until='networkidle')
|
||||
page.wait_for_timeout(1000)
|
||||
page.screenshot(path=str(out / '14_details.png'), full_page=True)
|
||||
|
||||
browser.close()
|
||||
|
||||
if errors:
|
||||
print("ERRORS:")
|
||||
for e in errors:
|
||||
print(e)
|
||||
else:
|
||||
print("NO_CONSOLE_ERRORS")
|
||||
Reference in New Issue
Block a user