From d2a73059b5e0b11ccbb273742a0445fcede48fa0 Mon Sep 17 00:00:00 2001 From: Simon Lecoq <22963968+lowlighter@users.noreply.github.com> Date: Thu, 24 Aug 2023 23:37:29 -0400 Subject: [PATCH] fix(ci): markdown screenshot example --- .github/scripts/markdown_example.mjs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/scripts/markdown_example.mjs b/.github/scripts/markdown_example.mjs index 2859015b..d1301b13 100644 --- a/.github/scripts/markdown_example.mjs +++ b/.github/scripts/markdown_example.mjs @@ -13,8 +13,10 @@ const page = await browser.newPage() //Select markdown example and take screenshot await page.setViewport({width: 600, height: 600}) await page.goto("https://github.com/lowlighter/metrics/blob/examples/metrics.markdown.md") +await page.waitForSelector("article.markdown-body") +await new Promise(solve => setTimeout(solve, 4000)) const clip = await page.evaluate(() => { - const {x, y, width, height} = document.querySelector("#readme").getBoundingClientRect() + const {x, y, width, height} = document.querySelector("article.markdown-body").getBoundingClientRect() return {x, y, width, height} }) await page.screenshot({type: "png", path: "/tmp/metrics.markdown.png", clip, omitBackground: true})