Hello there, Thanks for making this awesome CodeceptJS project!
I recently noticed that the ChromeDev Team released their own version of automation driver called Puppeteer: https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#puppeteer
Is there any way this can be integrated into CodeceptJS as a Helper?
@mrvicadai Yes, it can be integrated to CodeceptJS. But it will take some time. I can't give you any estimates, but I can propose you to add it by yourself and contribute it to framework! If you will start a work for this and you will have any questions, we will be glad to help you!
Hey!
I'm using codecept more and more in production finally at work and would love to see this implemented. I can try to work on this over September, but would need some guidance how to start.
@DavertMik @APshenkin could you point me how to start with this best way? I suppose I would highly inspire myself with Nightmare integration and then fit it to puppeteer? Not promising anything yet, but looks like a lot of fun task to do, would love to pick it :)
I have only one concern here, I noticed that there's more and more backend integrations in codecept, maybe it would be worth doing those as plugins instead of keeping everything in one repository? I saw Appium integration, there's still Nightmare, probably more will come. What do you think on this?
@APshenkin Thanks! I'll most likely start working on a POC of this according to your suggestion.
Thanks @mrvicadai and @jploskonka
I think we can start the branch so you could work on this integration. Yeah, Puppeteer looks so nice and so powerful. However, it's not built around webdriver protocol so I suspect it will require lots of durty hooks to make it fit our current API. For instance, its API doesn't locate elements by XPath which we highly use.
However, there is no problem to it. Look into Nightmare helper and lib/clientscripts/nightmare.js. I think you can try to reuse those to locate elements.
So you can start a plain new Helper, use Puppetteer API, and implement _locate method which can take CSS, XPath, or strict locators. Once you know how to locate elements, everything else should be pretty simple!
Hey,
@mrvicadai have you started anything yet? I will have some free time next week and would like to start on that, let me please know if do something so we don't do the same things twice :)
Just created branch https://github.com/Codeception/CodeceptJS/tree/puppeteer
You can start work and send PR into it
@jploskonka ah not yet; was focusing on using puppeteer directly these days, and familiarizing myself with the internals of CodeceptJS. thanks for the branch @DavertMik !
@mrvicadai any updates? :) Puppeteer is still the thing, you know :)
I started doing something with it, so far I was able to implement amOnPage method and open page :D I'm not too familiar with codecept internals yet so it's taking a lot of time, but hopefully I should be able to post some PR next week.
I started it too :) LOL

Most helpful comment
Hey!
I'm using codecept more and more in production finally at work and would love to see this implemented. I can try to work on this over September, but would need some guidance how to start.
@DavertMik @APshenkin could you point me how to start with this best way? I suppose I would highly inspire myself with Nightmare integration and then fit it to puppeteer? Not promising anything yet, but looks like a lot of fun task to do, would love to pick it :)
I have only one concern here, I noticed that there's more and more backend integrations in codecept, maybe it would be worth doing those as plugins instead of keeping everything in one repository? I saw Appium integration, there's still Nightmare, probably more will come. What do you think on this?