Fix tests to wait for page load