playwright icon indicating copy to clipboard operation
playwright copied to clipboard

docs: add migration from Puppeteer guide

Open jfgreffier opened this issue 3 years ago • 1 comments

Migration guide from Puppeteer.

The cheat sheet is partially built on https://github.com/checkly/checklyhq.com/blob/main/site/content/guides/puppeteer-to-playwright.md from checkly (MIT license)

Example is my own, tested and both are functionals.

I tried to fit with the style and level of details of the other migrations docs.

Fixes #13646

jfgreffier avatar Aug 08 '22 16:08 jfgreffier

Requesting review from either @dgozman or @aslushnikov since they know the puppeteer internals quite well! 😄

rwoll avatar Aug 09 '22 21:08 rwoll

When we simply migrate users from one syntax to another, we don't really add much value. With Playwright, you are not supposed to use any of the suggested methods, you aren't even supposed to use page.click(), should rather use the strict page.locator.click() instead, should only use web-first assertions for content verification, etc. Would you be interested in putting that together?

pavelfeldman avatar Aug 15 '22 16:08 pavelfeldman

Thanks for the feedback @pavelfeldman

Sure, I'll update the PR.

jfgreffier avatar Aug 16 '22 09:08 jfgreffier

I've updated the cheat sheet section and put more emphasis on Locators in the migration principles. @pavelfeldman let me know what do you think

jfgreffier avatar Aug 18 '22 12:08 jfgreffier