← All Tools Free Browser Sandbox · Pro ZIP + Offline CLI ($7.00) Read Guide
Buy on Polar ($7.00)
100% Offline · Zero External LLM Calls · JS/TS + Python

Playwright Flaky Selector Auditor & Auto-Heal CLI Kit

Inspect brittle CSS/XPath selectors and waitForTimeout calls in this free single-snippet browser sandbox. Upgrade to the $7.00 Pro CLI Kit on Polar.sh for recursive repo scanning (JS/TS + Playwright Python), SARIF 2.1.0 GitHub Code Scanning, two-stage DOM healing, and safe --apply patching with .bak backups.

pw_audit.pyMulti-file JS/TS + Python CLI
trace_diff.pyExact + Fuzzy DOM Healing
SARIF 2.1.0 + CIGitHub Actions workflow
capture_dom_on_fail.tsAuto-dump DOM on test fail

1. Paste Single Playwright Snippet (JS / TS)

2. Paste Target DOM Snapshot (page.content())

Analyzed snippet: 6 finding(s), 3 unique DOM heal(s).
Total Findings6
High Severity2
DOM-Verified Heals3
Flakiness Score84 / 100

Audit Findings & DOM Uniqueness Check

Rule Line Issue Recommended Replacement
PW003 4 div.actions > button:nth-child(2) page.getByTestId('complete-checkout') (unique: 1 match)
PW004 8 button.css-1x2y3z page.frameLocator('#pay').getByTestId('complete-checkout') (unique: 1 match)
PW006 9 #customer-email page.getByTestId('email-input') (unique: 1 match)
PW006 10 button page.getByRole('button', { name: 'Save', exact: true }) (ambiguous: 2 matches)
PW005 10 Chained .nth() Filter by accessible name or .filter({ hasText: '...' }) (positional chain)
PW001 11 Hardcoded .waitForTimeout() await expect(locator).toBeVisible() (auto-retry assertion)

Suggested Patch Diff & Export Output

--- a/snippet.spec.ts
+++ b/snippet.spec.ts
-  page.locator( 'div.actions > button:nth-child(2)' )
+  page.getByTestId('complete-checkout')
-  page.frameLocator('#pay').locator('button.css-1x2y3z')
+  page.frameLocator('#pay').getByTestId('complete-checkout')
-  page.locator('#customer-email')
+  page.getByTestId('email-input')

Pro CLI Pack ($7.00 Private Polar.sh Bundle)

Full bundle adds recursive repository scanning, Playwright-Python support (get_by_role), SARIF 2.1.0 GitHub Code Scanning, capture_dom_on_fail.ts, and safe --apply patching:

python pw_audit.py tests/ --dom test-results/dom-snapshots/checkout.html --format sarif --out playwright-audit.sarif
python trace_diff.py --dom sample_dom.html --selector "button.btn-legacy-checkout-hash" --hint "Complete Order"
Playwright Flaky Selector Auditor & Auto-Heal CLI Kit
Full Bundle / Pro ($7.00) — Offline CLI, source & assets (.zip) · Instant checkout via Polar
Buy on Polar