aboutsummaryrefslogtreecommitdiff
path: root/playwright-py/examples
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-22 15:48:48 -0500
committerCraig Jennings <c@cjennings.net>2026-05-22 15:48:48 -0500
commit8c291b81cd7fb10479a55fb47e9a9cebcfc1b9b8 (patch)
tree9f4d2fc7d3dff7f5404576759fee9d4a44f74b73 /playwright-py/examples
parente6f8db82fb3e97ebf11866de2166ff4505871c21 (diff)
downloadrulesets-8c291b81cd7fb10479a55fb47e9a9cebcfc1b9b8.tar.gz
rulesets-8c291b81cd7fb10479a55fb47e9a9cebcfc1b9b8.zip
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.
Diffstat (limited to 'playwright-py/examples')
-rw-r--r--playwright-py/examples/broken_links.py6
-rw-r--r--playwright-py/examples/login_flow.py2
-rw-r--r--playwright-py/examples/responsive_sweep.py2
3 files changed, 5 insertions, 5 deletions
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