From eef9711ec16216d7d75f5a14f669d71ae6e9973a Mon Sep 17 00:00:00 2001 From: Kelly Joseph Price Date: Thu, 7 Mar 2024 11:41:48 -0800 Subject: [PATCH] test: preload?? --- __tests__/browser/markdown.test.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/__tests__/browser/markdown.test.js b/__tests__/browser/markdown.test.js index b896f2a90..c725c1cbc 100644 --- a/__tests__/browser/markdown.test.js +++ b/__tests__/browser/markdown.test.js @@ -5,6 +5,15 @@ const sleep = ms => new Promise(resolve => setTimeout(resolve, ms)); describe('visual regression tests', () => { describe('rdmd syntax', () => { + beforeAll(async () => { + // @xxx: preload slow page???? + const uri = 'http://localhost:9966/?ci=true#features'; + await page.goto(uri, { waitUntil: 'networkidle0' }); + await page.evaluate(() => { + window.scrollTo(0, window.document.body.scrollHeight); + }); + }); + beforeEach(async () => { // The ToC disappears somewhere below 1200, 1175-ish? await page.setViewport({ width: 1400, height: 800 });