If you can make time.sleep(2) in line 91 105 to be self.wait_for_element_displayed(something), it might be better.