INNER CODE UNIT · Python

is_unexpected_console_error

yaojingang/GEOFlow · scripts/audit-admin-ui-v3-flicker.py:87

def is_unexpected_console_error(message: str) -> bool:
    return not any(diagnostic in message for diagnostic in EXPECTED_BROWSER_DIAGNOSTICS)


def audit_url(base_url: str, recorded_url: str) -> str:
    base = urlparse(base_url)
    recorded = urlparse(recorded_url)

    return urlunparse((base.scheme, base.netloc, recorded.path, '', recorded.query, ''))


def page_result(page, row: dict[str, str], viewport_name: str) -> dict:
    audit = page.evaluate("window.__gfFlickerAudit") or {"shifts": [], "frames": []}
    frames = [frame for frame in audit.get("frames", []) if frame.get("sidebar") and frame.get("shellBody")]
    first = frames[0] if frames else {}
    final = frames[-1] if frames else {}
    cls = round(sum(float(entry.get("value", 0)) for entry in audit.get("shifts", [])), 6)
    sidebar_width_delta = delta(first.get("sidebar"), final.get("sidebar"), "width")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…