I am using puppeteer to make e2e tests. It seems that headless chrome doesn't support the @media (hover: hover) media query (see this issue on puppeteer github).
It seems likely that Chrome assumes the default input method for headless doesn't support hovering.
Does anyone know of a Chrome launch flag or some Javascript to get around this, please?
It seems that for now the only way to get the @media (hover: hover) media query in puppeteer is to run it with headless : false.
However you can emulate headless mode with Xvfb. There are a couple on examples of how to do that in the Puppeteer-with-xvfb repository.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With