Laravel Dusk (Chrome Selenium) - take full page screenshot (while preserving viewport height styling)

278 Views Asked by At

With Laravel Dusk (Chrome Selenium driver) normal screenshot covers just the size of the window. All other issues specify taking a full-height screenshot by making the window size match the size of all the content (body element). However, when there are elements that are styled using viewport height unit, extending the window height doesn't help and still doesn't show all of the page.

Is there a way to take a full-page screenshot in this case? Perhaps it's possible to extend the window height while "freezing" the CSS rendering/updating, or take a screenshot of the whole page without changing the window height?

Thanks!

1

There are 1 best solutions below

0
oelimoe On

i don't believe this is possible will advise you to when it fails to than edit the test to perform an scrollIntoView($selector) or an mouseOver($selector) and after that use the screenshot method