time.sleep replaced by WebDriverWait in tests