From 6c5cf4f542db4c8ffd4ac28bdc5de5d998450536 Mon Sep 17 00:00:00 2001 From: tellthemachines Date: Thu, 25 Mar 2021 16:49:59 +1100 Subject: [PATCH] Replace timeout with puppeteer function. --- tests/visual-regression/specs/visual-snapshots.test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/visual-regression/specs/visual-snapshots.test.js b/tests/visual-regression/specs/visual-snapshots.test.js index ebed041e65f2f..458c40f86e0b7 100644 --- a/tests/visual-regression/specs/visual-snapshots.test.js +++ b/tests/visual-regression/specs/visual-snapshots.test.js @@ -14,7 +14,7 @@ async function hideElementVisibility( elements ) { } ); } } - await new Promise( ( resolve ) => setTimeout( resolve, 1000 ) ); + await page.waitFor( 1000 ); } async function removeElementFromLayout( elements ) { @@ -26,7 +26,7 @@ async function removeElementFromLayout( elements ) { } ); } } - await new Promise( ( resolve ) => setTimeout( resolve, 1000 ) ); + await page.waitFor( 1000 ); } const elementsToHide = [ '#footer-upgrade', '#wp-admin-bar-root-default' ];