--- title: From Puppeteer description: Convert Puppeteer browser scripts into Smoketest tests. --- # Migrate from Puppeteer Puppeteer is useful for low-level browser scripting. Smoketest is better for product journeys that a human user should be able to complete. When migrating, treat Puppeteer code as source material. Convert the intent behind `page.goto`, `page.click`, `page.type`, and assertions into a short test. ## Translate the concepts | Puppeteer | Smoketest | |---|---| | Browser script or Jest test | One test | | `page.goto()` | Start URL or navigation step | | `page.click()` / `page.type()` | Action step in words | | `$eval`, `page.content()`, or Jest assertion | Verification step in words | | Cookie injection or login helper | Persona-backed login steps or a Shared Step | | Manual screenshots | Automatic run screenshots and recording | | Custom launch options | Project/run configuration where applicable | ## What to migrate Migrate scripts that test a customer-facing workflow: signup, login, search, checkout, dashboard navigation, settings, or billing. Keep Puppeteer for scraping, PDF generation, browser-performance probes, and CDP-level browser experiments. Those are automation jobs, not Smoketest tests. ## Quick migration prompt ```text Use $smoketest-explore to migrate this repository's Puppeteer user-test tests to Smoketest. 1. Check Smoketest CLI install and auth first. 2. Find files that import puppeteer or puppeteer-core, plus related Jest setup. 3. Identify base URLs from config, env vars, and page.goto calls. 4. Convert only end-to-end user journeys into .smoketest/explore test drafts. 5. Translate page.goto/click/type/select actions into steps written in words. 6. Translate assertions on visible page state into final verification steps. 7. Skip scraping, PDF generation, request interception, and CDP-only scripts. 8. Validate and dry-run the manifest, then ask before applying. ``` ## Example test ```markdown ## Search returns product results - Open the product search page. - Search for `wireless keyboard`. - Verify the results page shows matching products and a way to refine the search. ``` ## After migration - Compare the original script list with the created test list. - Run migrated tests against staging or a preview URL. - Use the recording to confirm the test is checking the same user outcome. - Delete or archive Puppeteer scripts only after the Smoketest runs are stable.