def get_side_bar_help_element_and_click_help(self, as_list_item=False, index=-1): """ Click on the help, and also get the DOM help element. It operates on the help elements in the side bar. Arguments: as_list_item (bool): Indicates whether help element is enclosed in a 'li' DOM element. index (int): The index of element in case there are more than one matching elements. Returns: WebElement: Help DOM element in the side bar. """ element_css = None if as_list_item: element_css = SIDE_BAR_HELP_AS_LIST_ITEM else: element_css = SIDE_BAR_HELP_CSS help_element = self.q(css=element_css).results[index] click_and_wait_for_window(self, help_element) return help_element
def view_published_version(self): """ Clicks "View Live Version", which will open the published version of the unit page in the LMS. Switches the browser to the newly opened LMS window. """ click_and_wait_for_window(self, self.q(css='.button-view').first) self._switch_to_lms()
def verify_help_link(self, href): """ Verifies that help link is correct Arguments: href (str): Help url """ help_element = self.cohort_management.get_cohort_help_element() self.assertEqual(help_element.text, "What does this mean?") click_and_wait_for_window(self, help_element) assert_opened_help_link_is_correct(self, href)
def test_instructor_dashboard_help(self): """ Scenario: Help button opens staff help Given that I am viewing the Instructor Dashboard When I click "Help" Then I see help about the instructor dashboard in a new tab """ href = url_for_help('course_author', '/CA_instructor_dash_help.html') help_element = self.instructor_dashboard_page.get_help_element() click_and_wait_for_window(self, help_element) assert_opened_help_link_is_correct(self, href)
def get_nav_help_element_and_click_help(self, signed_in=True): """ Click on the help, and also get the DOM help element. It operates on the help elements in the navigation bar. Arguments: signed_in (bool): Indicates whether user is signed in or not. Returns: WebElement: Help DOM element in the navigation bar. """ element_css = None if signed_in: element_css = NAV_HELP_CSS else: element_css = NAV_HELP_NOT_SIGNED_IN_CSS help_element = self.q(css=element_css).results[0] click_and_wait_for_window(self, help_element) return help_element