3 ms·
What are reasons to prefer puppeteer to playwright which supports many browsers? > Cross-browser. Playwright supports all modern rendering engines including Ch
by e12e 2y ago
What are reasons to prefer puppeteer to playwright which supports many browsers?
> Cross-browser. Playwright supports all modern rendering engines including Chromium, WebKit, and Firefox.
https://playwright.dev/ https://playwright.dev/
- Vinnl 2y agoI said this in a subthread: > I think Playwright depends on forking the browsers to support the features they need, so that may be less stable than using a standard explicitly supported by the browsers, and/or more representative of realistic browser use. (And for Safari/WebKit to support it as well, but I'm not holding my breath for that one.) Though I hope Playwright will adopt BiDi at some point as well, as its testing features and API are really nice.
- creesch 2y agoGood question, even more so considering they were made by the same people. After the creators of puppeteers moved to Microsoft and started work on Playwright, I got the impression that puppeteer was pretty much abandoned. Certainly in the automation circles I find myself in I barely see anyone using or talking puppeteer unless it is a bit of legacy project.
- irjustin 2y agoI also wonder the same. Playwright is so good. I simply don't have flaky tests even when dealing with features that are playwrights' fault. I used to have so many issues with Selenium and so only used it in must have situations defaulting to capybara to run out specs.
- dataviz1000 2y agoIf you open up the code Playwright codebase you will discover that it is literally Puppeteer with the copyright message header in the base files belonging to Google. It is a fork.
- creesch 2y agoThat is a huge oversimplification, if I ever saw one. If you look at the early commits, you can see that it isn't just a simple fork. For starters, the initial commit[1] is already using Typescript. As far as I am aware puppeteer is not and is written in vanilla JavaScript. The license notice you mention is indeed there [2], but also isn't surprising they wouldn't reinvent the wheel for those things they wrote earlier and that simply work. Even if they didn't directly use code, Microsoft would be silly to not add it given their previous involvement with puppeteer. Even if it was originally a fork, they are such different products at this point that at best you could say that playwright started out as a fork (Which, again, it did not as far as I can tell). [1] https://github.com/microsoft/playwright/commit/9ba375c06344835d783fe60bf33f857f9bc208a4 https://github.com/microsoft/playwright/commit/9ba375c063448... [2] https://github.com/microsoft/playwright/blob/3d2b5e680147577ecbf347fb47c771e48d790e06/NOTICE#L3 https://github.com/microsoft/playwright/blob/3d2b5e680147577...
- dataviz1000 2y agoI'm not convinced. It looks like v0.10.0 contains ~half of Google's Puppeteer code and even in the latest release[0]the core package references Google's copyright several hundred times. Conceptually, the core, the bridge between a node server and the injected Chrome DevTools Protocol scripts are the same. Looks like Playwright started as a fork and evolved as a wrapper that eventually included APIs for Python and Java around Puppeteer. At the core there is a ton of code still used from Puppeteer. [0] https://github.com/microsoft/playwright/tree/48627ad4840558324c17a9b651a0aabf880608c5/packages/playwright-core https://github.com/microsoft/playwright/tree/48627ad48405583...
- creesch 2y agoAs I said, even if playwright started out a fork, classifying it as just that these days is a pretty big oversimplification. It isn't just a "wrapper around puppeteer" either but a complete test automation framework bringing you the whole set of runner, assertion library and a bunch of supporting tools in the surrounding ecosystem. Where puppeteer still mainly is a library and just that. With which there in principle is nothing wrong, but at this stage of development does make them distinctly different products.
- bdcravens 2y agoAdditionally, Playwright has some nice ergonomics in the API, though Puppeteer has since implemented a lot of it as well. Downloads and video capturing in Playwright is nicer.
- natorion 2y agoPlaywright is shipping patched browsers. They take the open source version of the browser and patch in e.g. CDP support or other things that make automation "better. Playwright does not work with a "normal" Safari for example.