Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: support for Chrome headless #521

Open
lordgordon opened this issue Apr 16, 2017 · 11 comments
Open

Feature request: support for Chrome headless #521

lordgordon opened this issue Apr 16, 2017 · 11 comments

Comments

@lordgordon
Copy link

Hi,

There is any plan to add Chrome headless [1] support? Having a real headless browser like Chrome could help a lot to keep our wraith tests up-to-date with new HTML\JS\CSS features.

Also consider that PhantomJS developer stepped down [2]. This could stall PhantomJS development.

Thanks,

Nicholas

References:
[1] https://www.chromestatus.com/features/5678767817097216
[2] https://groups.google.com/forum/#!topic/phantomjs/9aI5d-LDuNE

@lordgordon
Copy link
Author

Very useful tutorial with example on how to capture screenshots with Chrome headless: https://developers.google.com/web/updates/2017/04/headless-chrome

Also useful: https://medium.com/@dschnr/using-headless-chrome-as-an-automated-screenshot-tool-4b07dffba79a

@fisherman90
Copy link

+1 For this, I'm considering using wraith but am unsure about the future-proofness if it's not compatible with headless chrome.

@lounikffm
Copy link

+1 Really looking forward to a headless Chrome Integration

@ihorzenich
Copy link

+1 Please add headless Chrome Integration, because current PhantomJS had very outdated CSS support! Thanks!

@saulirajala
Copy link

Hi!

I managed to add partial and straightforward support for headless Chrome. Please go ahead and test my solution: saulirajala@988b705

Some notices about my solution:

  • Same config-file works as with PhantomJS. Just change the browser to chrome
  • Executing JavaScript-files before capture is not supported, so remember to disable all before_capture hooks.
  • Supports history-mode and both options for resize_or_reload-setting
  • Works only with Mac
  • Assumes that you have Chrome 59 with build-in support for headless execution and the path of the Chrome is /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome

You can test the solution by overwriting the files of your Wraith. In my computer they are located in /usr/local/lib/ruby/gems/2.3.0/gems/wraith-4.0.1

@shmargum
Copy link
Contributor

shmargum commented Sep 20, 2017

Hey there, I was having some issues integrating the posted solution on OS X and I also wanted to run this as part of our CI

I made a patch here with Chrome support which has JS before capture support, and works with Chrome on any OS. It has capabilities of full screen screenshots as well as selector only screenshots.

GitHub Fork & Branch: https://github.com/shmargum/wraith/tree/chromedriver

This relies on Chrome, which you already probably have installed if you are reading this.

@shmargum
Copy link
Contributor

shmargum commented Mar 2, 2018

This issue can be closed since the Chrome support has been merged.

@kud
Copy link
Contributor

kud commented Jun 14, 2018

Chrome support seems to work by using browser: "chrome". However, aborting wraith during processing isn't as smooth as it is with phantomjs. Lots of errors coming from this trigger.

@lubosjerabek
Copy link

@saulirajala @shmargum Guys how did you approach logging in scripts? I'm blocked as the before_capture hooks do not work for me. This is what I use:

document.getElementById('Email').value = 'example@domain.com';
document.getElementById('Next').click();

I'm getting an error that the document unloaded when waiting for the click() function result. Any ideas how to do this? I might be able to force an auth cookie to the session but unsure how?

@tobq
Copy link

tobq commented Apr 4, 2019

@saulirajala @shmargum Guys how did you approach logging in scripts? I'm blocked as the before_capture hooks do not work for me. This is what I use:

document.getElementById('Email').value = 'example@domain.com';
document.getElementById('Next').click();

I'm getting an error that the document unloaded when waiting for the click() function result. Any ideas how to do this? I might be able to force an auth cookie to the session but unsure how?

Still an issue

@mpdude
Copy link

mpdude commented Sep 20, 2019

Is the original request still an issue, or can this be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants