Skip to content

Commit

Permalink
WIP tests not working
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Rodriguez committed Oct 28, 2015
1 parent ac0bed5 commit 814b787
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions common/test/acceptance/pages/lms/course_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,18 @@ def verify_skip_to_container_exists(self):
self.q(css=skip_href).is_present, "Main content area is present"
).fulfill()

def skip_to_main_content(self):
def ensure_skip_link_sends_focus_to_container(self):
"""
Checks to make sure the skip link skips to its href
and the container receives focus.
"""
skip_link = self.q(css=".nav-skip")
skip_url = skip_link.attrs('href')[0]
skip_id = skip_url.split('/')[-1]
# from nose.tools import set_trace; set_trace()
focusable_link = '$(".nav-skip").css({ "top": 0 }).focus()'
from nose.tools import set_trace; set_trace()
self.browser.execute_script(focusable_link)
skip_link.click()
self.wait_for(
self.q(css=skip_id).is_focused, "Main content area is focusable"
self.q(css=skip_id).is_focused, "Main content area is focusable", timeout=5
)
2 changes: 1 addition & 1 deletion common/test/acceptance/tests/lms/test_lms_courseware.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def test_skip_navigation(self):
self.courseware_page.verify_skip_to_container_exists()

# Activate the link and expect focus to be on the #href
self.courseware_page.skip_to_main_content()
self.courseware_page.ensure_skip_link_sends_focus_to_container()


class ProctoredExamTest(UniqueCourseTest):
Expand Down

0 comments on commit 814b787

Please sign in to comment.