-
Notifications
You must be signed in to change notification settings - Fork 31
Add dynamic wait to allow page content to render #331
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #331 +/- ##
============================================
+ Coverage 64.04% 64.14% +0.10%
Complexity 291 291
============================================
Files 100 100
Lines 4066 4078 +12
Branches 619 622 +3
============================================
+ Hits 2604 2616 +12
Misses 1302 1302
Partials 160 160
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We try to avoid hardcode as mush as possible. Could you think of using any puppeteer APIs that doesn't require a interval as input? Something like waitUntil(), waitForNavigation. May need to look up their API doc as well
I had looked at those originally, but could not see any able to take in to account scripts still modifying html after page load (at least not without adding a waitForSelector). |
@zhongnansu I have tested the other options and they all result in the blank plugin |
@itbm Hi, I found someting on the internet which could be a possible generic solution for waiting for client side JS scripts to complete. |
I think this kind of idea is probably ok for most use cases and adds some flexibility to extend the wait vs a simple
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the fix
Issue #, if available:
Fixes #330
Description of changes:
Add wait before screenshot to allow content to render
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or
(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or
(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.
(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.