1function waitFor(delay) {
2 return new Promise(resolve => setTimeout(resolve, delay));
3}
4
5page.evaluate(async() => {
6 //Define your waitFor function
7 //Code to execute before
8 await waitFor(1000);
9 //Code to execute after the 1000ms time delay
10 });