#!/usr/bin/env python3
"""最小连通性测试:CDP 连接 + 打开页面"""
from playwright.sync_api import sync_playwright
with sync_playwright() as pw:
    b = pw.chromium.connect_over_cdp("http://127.0.0.1:9222", timeout=15000)
    print("connected", b.version)
    ctx = b.new_context(viewport={"width": 390, "height": 844}, device_scale_factor=1)
    p = ctx.new_page()
    p.goto("http://127.0.0.1:8123/index.html", wait_until="domcontentloaded", timeout=15000)
    print("title:", p.title())
    ctx.close()
print("MINI-OK")
