/** * BackstopJS onBefore hook * Executes before each scenario capture */ module.exports = async (page, scenario, vp) => { console.log('BackstopJS: onBefore hook - ' + scenario.label); // Navigate to the scenario URL await page.goto(scenario.url, { waitUntil: 'networkidle2' }); // Set viewport dimensions await page.setViewport({ width: vp.width, height: vp.height }); // Wait for any animations to complete await page.waitForTimeout(500); };