teampoltergeist / poltergeist

A PhantomJS driver for Capybara
MIT License
2.5k stars 415 forks source link

Future of Poltergeist #906

Closed twalpole closed 6 years ago

twalpole commented 7 years ago

@teampoltergeist Due to the abandonment of PhantomJS I've been working on rewriting Poltergeist to use https://github.com/GoogleChrome/puppeteer instead. My original thought was that it would make a good Poltergeist 2.0. However, the more I work on it the more I think it may be better to just spin off a puppeteer driven version into its own new project/driver in order to separate issues and potential API changes that are necessary. If anyone have any problems/issues with me doing that please let me know.

route commented 7 years ago

@twalpole that all sounds good to me I myself on my spare time try to implement cdp in plain ruby, cause if I'm not mistaken puppeteer requires nodejs right?

twalpole commented 7 years ago

@route - Yes it does require nodejs. Using it was my first step because it allows for replacing PhantomJS relatively easily, second step would be to implement the required cdp stuff in plain ruby and remove the need for puppeteer (but that is a bigger project)

route commented 7 years ago

@twalpole overall I agree on a new project, let's create one. I'll try to help and meanwhile will continue working on cdp

tetron commented 7 years ago

Is there a link to the new project?

twalpole commented 7 years ago

@tetron Not yet, I need to get windows & frames working properly first -- probably early next week

krow-ten commented 7 years ago

Would js_errors option still work with headless Chrome? A very useful feature of running Capybara tests in Phantom is that they fail if there are any uncaught errors. Does Chrome expose this?

oelmekki commented 7 years ago

Hi guys,

Maybe it's worth mentioning it, there's already a go implementation to use chrome headless without using puppeteer : https://github.com/raff/godet

I'm not suggesting to avoid depending on node just to depend on go :) But the whole implementation holds in a single file, godet.go, so I guess it could help reading it to write implementation for other languages without having to understand the whole puppeteer codebase and until there's a proper documentation for the protocol.

AntiFish03 commented 6 years ago

@twalpole I don't want to be bothersome but is there a puppeteer project yet?

twalpole commented 6 years ago

@AntiFish03 After having flakiness with puppeteer I moved to just talking directly to chrome using the chrome debugger protocol. It currently passes most of the expected tests (except around multiple windows and frames) but life has got in the way and I haven't had time to clean it up for release.

AntiFish03 commented 6 years ago

@twalpole Thanks for the update!

Aesthetikx commented 6 years ago

@twalpole Do you have an preliminary performance results? I recently played with switching a large test suite from poltergeist to headless chrome via selenium and the tests went from around 4 to 8 minutes. I am not sure if that is due to selenium webdriver's protocol or chrome's performance however.

twalpole commented 6 years ago

@Aesthetikx It'll probably be closer in speed to selenium than poltergeist. It's the price that's paid for having full support of current web technologies.

swrobel commented 6 years ago

@twalpole not sure if this is still WiP but if you're working directly w/ the CDP, this is an issue I've been trying to get Selenium to resolve (showing sourcemap location rather than bundled source location in js console logs)

The Chromium team's suggested solution: https://bugs.chromium.org/p/chromium/issues/detail?id=812153#c9

route commented 6 years ago

@teampoltergeist I started this project recently https://github.com/machinio/cuprite it's still in its early stage but since my company supports and needs it for our own purpose I will work full time on that.