def test_lhn_stays_expanded(self, header_dashboard, selenium): """Tests if, after opening LHN, it slides out and stays expanded.""" lhn_menu = header_dashboard.open_lhn_menu() initial_position = lhn_menu.my_objects.element.location selenium_utils.wait_until_stops_moving(lhn_menu.my_objects.element) selenium_utils.hover_over_element( selenium, dashboard.Header(selenium).button_my_tasks.element) assert initial_position == lhn.Menu(selenium).my_objects.element.location
def open_lhn_menu(self): """Opens LHN on Dashboard. For some reason, after creating 2 objects via LHN (and clicking 2x on LHN button), third time toggle_lhn_menu signals it's not part of the DOM anymore. For this reason we're refreshing elements. Return: LHN Menu """ try: self.toggle_lhn_menu.toggle() return lhn.Menu(self._driver) except exceptions.StaleElementReferenceException: self._refresh_elements() return self.open_lhn_menu()
def test_lhn_stays_expanded(self, selenium): """Tests if, after opening the LHN, it slides out and stays expanded.""" conftest_utils.navigate_to_page_with_lhn(selenium) lhn_menu = dashboard.Header(selenium).open_lhn_menu() initial_position = lhn_menu.my_objects.element.location selenium_utils.wait_until_stops_moving(lhn_menu.my_objects.element) selenium_utils.hover_over_element( selenium, dashboard.Header(selenium).button_my_tasks.element) assert initial_position == \ lhn.Menu(selenium).my_objects.element.location