devopsgroup-io / siteshooter

:camera: Automate full website screenshots and PDF generation with multiple viewport support.
https://devopsgroup.io
Mozilla Public License 2.0
67 stars 13 forks source link

Set delay #66

Closed gautamBellare closed 7 years ago

gautamBellare commented 7 years ago

Hi, First and foremost, amazing work guys. My query is - I need to add some delay before the screenshot is taken. I have some external font that loads on my site and I need the screenshot process to wait for sometime giving the app to load.

stevebritton commented 7 years ago

Hi @gautamBellare,

Thank you for the kind words - we appreciate it.

Regarding the delay option, we actually had that as a configuration option, but removed it in the hopes that the PhantomJS onLoadFinished callback would account for async loading; however, that does not seem to be the case. As such, we'll be adding the delay option back into siteshooter - someone from the team will confirm once the new npm version has been released.

-Steve

stevebritton commented 7 years ago

Hi @gautamBellare,

This was a fairly straightforward feature to add back in, so you're all set to update to Siteshooter version 1.6.0.

Let us know how you make out.

-Steve

gautamBellare commented 7 years ago

Hi @stevebritton, Thanks for reverting back so quickly. How do i go about enabling this feature? Is this feature turned on by default or do i need to add it to the yml template file?

stevebritton commented 7 years ago

Hey @gautamBellare,

The default delay setting is 2000(2 seconds); however, you can override the setting by adding lines 14 and 15 (https://github.com/devopsgroup-io/siteshooter/blob/master/siteshooter.yml#L14) into your siteshooter.yml file and adjusting the delay setting as needed. Let me know how you make out.

-Steve

gautamBellare commented 7 years ago

Hi @stevebritton, Even after I add the delay setting, not sure why i don't see any change. I wish to know if the delay is applied after the page is loaded and before the screenshot is taken or does the tool run after the delay? Hope I am making sense here. Let me know if you need more details on what exactly i wish to convey.

stevebritton commented 7 years ago

HI @gautamBellare,

I included some additional checks and am now listening for the document ready state to report as complete prior to taking a screenshot. As such, please update your siteshooter version to the latest version and give it another try.

-Steve