ci(mac): make Playwright screenshots best-effort + 90s timeout

Run 25494399543 / job 74810247593 progressed past the change-password
flow + composer-mount + default_models[0] check (so commits d35bf6a
and fdf7f94's Chromium fixes are working) but then crashed on
`shoot('03b-default-model-button')` with:

  playwright._impl._errors.TimeoutError:
    Page.screenshot: Timeout 30000ms exceeded.
  Call log:
    - taking page screenshot
    - waiting for fonts to load...
    - fonts loaded

Page.screenshot waits for the page's webfonts to be resolved before
snapshotting. On macos-14 free runners under --single-process
Chromium, font loading for the Studio chat page (Inter / Geist Mono)
crowds the 30s default. Two changes:

1. Bump screenshot timeout to 90_000ms.
2. Wrap shoot() in try/except. Screenshots are diagnostic artifacts
   uploaded for human triage; a failure to capture one should never
   fail the test. The actual UI assertions live in step()/info()/
   wait_for() calls, which are unaffected.

Adds animations='disabled' for deterministic captures (frozen CSS
transitions). Both playwright_chat_ui.py and playwright_extra_ui.py
get the same treatment.
This commit is contained in:
Daniel Han 2026-05-07 12:10:21 +00:00
parent a65b7300d3
commit 1b92a8bb72
2 changed files with 30 additions and 8 deletions

View file

@ -220,11 +220,25 @@ with sync_playwright() as p:
)
def shoot(name):
# Screenshots are diagnostic artifacts only -- never fail the
# test on a screenshot timeout. Page.screenshot waits for
# webfonts to fully load before snapshotting; on macos-14 free
# runners with --single-process Chromium, font loading on the
# Studio chat page (Inter / Geist Mono) regularly crowds the
# 30s default and crashes Page.screenshot. Bump the timeout
# AND wrap in try/except so the test progresses even if the
# screenshot can't be captured. animations='disabled' freezes
# any in-flight CSS transitions for a deterministic snap.
_n[0] += 1
page.screenshot(
path = str(ART / f"{_n[0]:02d}-{name}.png"),
full_page = True,
)
try:
page.screenshot(
path = str(ART / f"{_n[0]:02d}-{name}.png"),
full_page = True,
timeout = 90_000,
animations = "disabled",
)
except Exception as _shoot_err:
info(f"WARN: screenshot {name} failed: {_shoot_err}")
# ─────────────────────────────────────────────────────
# 1. Change-password through the UI ("Setup your account").

View file

@ -159,11 +159,19 @@ with sync_playwright() as p:
page.on("pageerror", _on_pageerror)
def shoot(name: str) -> None:
# See playwright_chat_ui.py:shoot -- screenshots are diagnostic,
# never fail the test on a font-load timeout under
# --single-process Chromium on macos-14 free runners.
_n[0] += 1
page.screenshot(
path = str(ART / f"{_n[0]:02d}-{name}.png"),
full_page = True,
)
try:
page.screenshot(
path = str(ART / f"{_n[0]:02d}-{name}.png"),
full_page = True,
timeout = 90_000,
animations = "disabled",
)
except Exception as _shoot_err:
info(f"WARN: screenshot {name} failed: {_shoot_err}")
# ─────────────────────────────────────────────────────
# Setup: change-password through the UI + model load.