From 8c291b81cd7fb10479a55fb47e9a9cebcfc1b9b8 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Fri, 22 May 2026 15:48:48 -0500 Subject: refactor(skills): locator-first playwright guidance, drop emoji markers Two cleanups to the playwright skills, landed together since they overlap the same files. The skills taught networkidle as the readiness check and leaned on raw page.click/fill/waitForSelector. Playwright discourages networkidle for readiness, so the guidance in both SKILL.md files now waits for a visible app landmark via a web assertion or locator, the login and form examples use getByLabel/getByRole plus expect, the API reference leads with that pattern, and lib/helpers.js defaults waitForPageReady to load (preferring a caller-supplied landmark) and races the success indicator in authenticate instead of waiting on networkidle. The second cleanup strips emoji console markers across run.js, helpers.js, both SKILL.md files, and the py examples, replacing each with a plain ASCII tag like [ok], [error], or [scan]. node --check and py_compile pass, and an emoji grep comes back clean. --- playwright-py/examples/broken_links.py | 6 +++--- playwright-py/examples/login_flow.py | 2 +- playwright-py/examples/responsive_sweep.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'playwright-py/examples') diff --git a/playwright-py/examples/broken_links.py b/playwright-py/examples/broken_links.py index c78520f..a292f74 100644 --- a/playwright-py/examples/broken_links.py +++ b/playwright-py/examples/broken_links.py @@ -41,13 +41,13 @@ def main() -> int: status = resp.status if status < 400: ok += 1 - print(f"✓ {status} {url}") + print(f"[ok] {status} {url}") else: bad += 1 - print(f"✗ {status} {url}") + print(f"[fail] {status} {url}") except Exception as ex: err += 1 - print(f"✗ ERR {url} ({type(ex).__name__}: {ex})") + print(f"[fail] ERR {url} ({type(ex).__name__}: {ex})") print(f"\n{ok} ok, {bad} broken, {err} errored out of {len(urls)} total") browser.close() diff --git a/playwright-py/examples/login_flow.py b/playwright-py/examples/login_flow.py index d114ac6..6d2fa45 100644 --- a/playwright-py/examples/login_flow.py +++ b/playwright-py/examples/login_flow.py @@ -45,7 +45,7 @@ def main() -> int: safe_click(page, 'button[type="submit"]') page.wait_for_url("**/dashboard", timeout=5000) - print(f"✓ Logged in; redirected to {page.url}") + print(f"[ok] Logged in; redirected to {page.url}") browser.close() return 0 diff --git a/playwright-py/examples/responsive_sweep.py b/playwright-py/examples/responsive_sweep.py index d890d5b..eb6e216 100644 --- a/playwright-py/examples/responsive_sweep.py +++ b/playwright-py/examples/responsive_sweep.py @@ -41,7 +41,7 @@ def main() -> int: page.wait_for_load_state("networkidle") path = OUTPUT_DIR / f"responsive-{name}.png" page.screenshot(path=str(path), full_page=True) - print(f"✓ {name:<8} ({width:>4}x{height:<4}) → {path}") + print(f"[ok] {name:<8} ({width:>4}x{height:<4}) -> {path}") context.close() browser.close() return 0 -- cgit v1.2.3