Remove sleep_for_seconds from tests

Also add wait_for_ajax on UI methods

Related to #453