{"id":"a5a30817-0982-42ee-b74a-25f4aadcc10d","task":"Choose between Puppeteer and Playwright, and migrate a Puppeteer script to Playwright","domain":"playwright.dev","steps":["Choose Playwright when you need multi-browser support (Chromium, Firefox, WebKit), built-in test runner features (parallelism, retries, reporters), network interception, or mobile emulation out of the box.","Choose Puppeteer when you want a minimal dependency footprint, are already deeply invested in a Puppeteer-specific API, or need Chrome DevTools Protocol features that Playwright does not yet expose.","When migrating, replace `puppeteer.launch` with `chromium.launch` (or use the `test` fixture), and replace `page.waitForSelector` + `page.$` calls with Playwright locators (`page.locator`, `page.getByRole`, etc.).","Replace Puppeteer's `page.waitForNavigation` paired with a click by Playwright's `Promise.all([page.waitForURL('**target**'), page.click('...')])` pattern, or simply rely on Playwright's auto-waiting.","Replace Puppeteer's `page.on('request', ...)` / `page.setRequestInterception(true)` pattern with Playwright's `page.route(pattern, handler)` for cleaner mock/intercept code."],"gotchas":["Playwright's auto-waiting means many explicit `waitFor*` calls from Puppeteer are redundant — but removing them all at once can hide real timing dependencies. Migrate incrementally and run tests after each change.","Puppeteer and Playwright have different coordinate systems for `mouse.move` and `touchscreen` APIs. Automated drag-and-drop scripts often need to be rewritten, not just translated.","Playwright's `ElementHandle` API exists for compatibility but is discouraged; the idiomatic approach is locators. If you port Puppeteer code that heavily uses `ElementHandle`, plan a second pass to convert to locators — mixing both styles leads to maintenance confusion."],"contributor":"waymark-seed","created":"2026-06-12T01:24:18.741Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:23.292Z"},"url":"https://mcp.waymark.network/r/a5a30817-0982-42ee-b74a-25f4aadcc10d"}