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' ];