Live data from Hacker News

Puppeteer: Headless Chrome Node API

github.com

1–10 of 105 posts

Re: Puppeteer: Headless Chrome Node API

#4
The API looks nice and clean, but I'm puzzled by this from the FAQ:

> Puppeteer works only with Chrome. However, many teams only run unit tests with a single browser (e.g. PhantomJS).

Is this true? Do teams write unit tests but only test them in a single browser? With test runners like Karma and Testem, running tests concurrently in multiple browsers is easy. You'd be throwing away huge value if for some reason you only decided to test in one vendor's browser.

Re: Puppeteer: Headless Chrome Node API

#5
post #2

I think simple-headless-chrome is more far along https://github.com/LucianoGanga/simple-headless-chrome

We're fans of LucianoGanga's project (and of Chromeless, Doffy, Chrominator, Chromy, Navalia). I can tell you from personal experience that dealing with the raw DevTools Protocol isn't ideal for a developer writing an automation script, so it's clear there's demand for libraries with this higher-level API.

Would love to know if there's a feature parity concern you have or what you'd like to see from puppeteer (or any of these projects). (My personal feature unicorn: generate not a static screenshot but a proper video of a page session)

Re: Puppeteer: Headless Chrome Node API

#7
post #4

The API looks nice and clean, but I'm puzzled by this from the FAQ: > Puppeteer works only with Chrome. However, many teams only run unit tests with a single browser (e.g. PhantomJS). Is this true? Do teams write unit tests but only test them in a single browser? With test runners like Karma and Testem, running tests concurrently in multiple browsers is easy. You'd be throwing away huge value if for some reason you o…

For unit tests, yes. (In fact, we use Jest which uses JSDom and Node). For integration or end-to-end automation, we normally run them in a wider suite of browsers.

Re: Puppeteer: Headless Chrome Node API

#8
post #4

The API looks nice and clean, but I'm puzzled by this from the FAQ: > Puppeteer works only with Chrome. However, many teams only run unit tests with a single browser (e.g. PhantomJS). Is this true? Do teams write unit tests but only test them in a single browser? With test runners like Karma and Testem, running tests concurrently in multiple browsers is easy. You'd be throwing away huge value if for some reason you o…

From my experience most teams only test against a single browser, yes. It's however nice to have the option to switch to another browser when debugging a browser-specific bug.

From what I've seen in practice, for a lot of teams and projects, running tests concurrently across multiple browsers isn't easy as you claim. Once you have a database involved and not a perfectly clean setup, concurrent testing can become a hassle and is rarely worth the effort of fixing.

Re: Puppeteer: Headless Chrome Node API

#9
So first there was Selenium's JSON Wire protocol, then came the W3C WebDriver spec and now we're back to browser-specific implementations? As someone who's tried/is trying to automate Firefox/Chrome/Safari/IE in a consistent fashion, my only question is: WHY?

Re: Puppeteer: Headless Chrome Node API

#10
post #9

So first there was Selenium's JSON Wire protocol, then came the W3C WebDriver spec and now we're back to browser-specific implementations? As someone who's tried/is trying to automate Firefox/Chrome/Safari/IE in a consistent fashion, my only question is: WHY?

Because WebDriver just doesn't do.

For an example of an impossible task, try to retrieve request headers using Selenium. Browser automation getting more and more complicated the more cases you're trying to cover and in my impression WebDriver is definitely not enough. Who knows, perhaps some new version of WebDriver that I never heard of it will catch up once the functionality gets properly defined.

Post reply on HN