OnetapInc / chromy

Chromy is a library for operating headless chrome. 🍺🍺🍺
MIT License
605 stars 41 forks source link

Rendering broken when using non-headless mode {visible: true} #53

Closed laubsauger closed 6 years ago

laubsauger commented 6 years ago

Hi @dotneet,

i think this is on chromy but i can't be entirely sure:

Reduced testcase:

const Chromy = require('chromy');

// not headless
let chromy = new Chromy({ visible: true });
//headless
// let chromy = new Chromy();

chromy.chain()
    .goto('http://github.com/')
    .sleep(500)
    .end()
    .then(() => chromy.close());

This is how it looks: image

Environment:

Chrome 60 Chromy 0.4.7 Centos 7 Node 8

I think the problem occured first after updating from chrome59 to chrome60 but i can't be sure. Headless Mode still works. But having the window visible helps a lot when working on complex test cases. If i manually start chrome via google-chrome --remote-debugging-port=9222 and then run a chrome-remote-interface script against it, everything works and the rendering seems fine.

Reference: https://github.com/garris/BackstopJS/issues/479

dotneet commented 6 years ago

Hi @laubsauger,

I've tried to reproduce this problem with same environment but I could not reproduce.

Environment:

Do you have any thoughts of another reason?

garris commented 6 years ago

@laubsauger I am not able to produce this either.

Maybe related... I found using --ignore-certificate-errors flag did sometimes cause a screenshot issue -- because of an onscreen notification. I switched to chromyChain.ignoreCertificateErrors() method and have not had an issue since.

laubsauger commented 6 years ago

Thanks for trying to reproduce. Unfortunately i have no other idea what could be causing this. I've bumped node to 8.3.1 and reinstalled chrome (still same version) via yum but i get the same result. Even rebooted my vm :neutral_face: I'm not using the --ignore-certificate-errors switch in this minimal testcase.

dotneet commented 6 years ago

disable-gpu flag affects a result?

new Chrome({
  visible: true,
  chromeFlags: {
    '--disable-gpu'
  }
})
laubsauger commented 6 years ago

I just installed google-chrome-unstable@62.0.3178.0 and the problem is gone.

@dotneet I will test your suggestion anyway.

update: Yes. When i pass --disable-gpu it will work with google-chrome-stable@60.0.3112.90-1.

Thanks guys :+1: