Skip to content

Commit

Permalink
Wait for images to load before screenshotting
Browse files Browse the repository at this point in the history
Signed-off-by: David Beckley <[email protected]>
  • Loading branch information
cassiebeckley committed Apr 17, 2018
1 parent 38e5822 commit 990b61f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/gatsby-transformer-screenshot/lambda/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ exports.run = async (browser, url, width, height) => {

await page.setViewport({ width, height })
await page.goto(url, { waitUntil: [`load`, `networkidle0`] })
// wait for full-size images to fade in
await page.waitFor(1000);

const screenshot = await page.screenshot()
const up = await s3PutObject(key, screenshot)
Expand Down

0 comments on commit 990b61f

Please sign in to comment.