diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-22 14:23:34 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-22 14:23:34 -0500 |
| commit | 2e9d5b0acb5e6fd13020519e1807d804d5ab8a80 (patch) | |
| tree | b6648f3d8c912ea9b1b1c7911fb4d7bac9a6c0f7 /playwright-py | |
| parent | 6d08ddfed52428b7ccffc78dc45e36009bdeb841 (diff) | |
| download | rulesets-2e9d5b0acb5e6fd13020519e1807d804d5ab8a80.tar.gz rulesets-2e9d5b0acb5e6fd13020519e1807d804d5ab8a80.zip | |
docs(skills): document headed vs headless choice in playwright skills
playwright-js defaulted headed, playwright-py headless, with no explanation, so an agent could flip modes by habit. I added a matching purpose-based decision table to each (headed for interactive debugging, headless for CI/pytest), and made each skill name its own default and point at the other. I also softened the absolutist "always headless" comment in the py example.
Diffstat (limited to 'playwright-py')
| -rw-r--r-- | playwright-py/SKILL.md | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/playwright-py/SKILL.md b/playwright-py/SKILL.md index 1dee60e..0ed912b 100644 --- a/playwright-py/SKILL.md +++ b/playwright-py/SKILL.md @@ -54,7 +54,7 @@ To create an automation script, include only Playwright logic (servers are manag from playwright.sync_api import sync_playwright with sync_playwright() as p: - browser = p.chromium.launch(headless=True) # Always launch chromium in headless mode + browser = p.chromium.launch(headless=True) # headless for CI/pytest; headless=False for interactive debugging page = browser.new_page() page.goto('http://localhost:5173') # Server already running and ready page.wait_for_load_state('networkidle') # CRITICAL: Wait for JS to execute @@ -87,6 +87,12 @@ with sync_playwright() as p: - Always close the browser when done - Use descriptive selectors: `text=`, `role=`, CSS selectors, or IDs - Add appropriate waits: `page.wait_for_selector()` or `page.wait_for_timeout()` +- **Choose headed vs headless by purpose, not habit.** This skill defaults to *headless* (`headless=True`) because it targets CI and pytest. The companion `/playwright-js` defaults to *headed* for interactive visual debugging. Pick by what you're doing, and only override when the purpose flips: + + | Purpose | Mode | + |---|---| + | CI, pytest, smoke tests, unattended runs | headless (`headless=True`) | + | Interactive debugging, watching a flow | headed (`headless=False`) | ## Reference Files |
