Executes JavaScript and waits up to $timeout seconds for it to return true.
In this example we will wait up to 60 seconds for all jQuery AJAX requests to finish.
php
waitForJS("return $.active == 0;", 60);
?>
See also:
Codeception\Module\WebDriver::waitForJS()