Commit 3fd36070 by Xavier Antoviaque

Tests - Allow `go_to_page()` to return any DOM element by CSS selector

parent e8e7ee7f
......@@ -28,13 +28,13 @@ class MentoringBaseTest(SeleniumTest):
header1 = self.browser.find_element_by_css_selector('h1')
self.assertEqual(header1.text, 'XBlock scenarios')
def go_to_page(self, page_name):
def go_to_page(self, page_name, css_selector='div.mentoring'):
"""
Navigate to the page `page_name`, as listed on the workbench home
Returns the mentoring DOM element on the visited page
Returns the DOM element on the visited page located by the `css_selector`
"""
self.browser.get(self.live_server_url)
self.browser.find_element_by_link_text(page_name).click()
mentoring = self.browser.find_element_by_css_selector('div.mentoring')
mentoring = self.browser.find_element_by_css_selector(css_selector)
return mentoring
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment