Commit 854a564a by Will Daly

Fixed navigation acceptance test

Disable jquery animations to fix LMS navigation acceptance test.
parent 475cf077
...@@ -560,3 +560,17 @@ def retry_on_exception(func, max_attempts=5, ignored_exceptions=StaleElementRefe ...@@ -560,3 +560,17 @@ def retry_on_exception(func, max_attempts=5, ignored_exceptions=StaleElementRefe
attempt += 1 attempt += 1
assert_true(attempt < max_attempts, 'Ran out of attempts to execute {}'.format(func)) assert_true(attempt < max_attempts, 'Ran out of attempts to execute {}'.format(func))
@world.absorb
def disable_jquery_animations():
"""
Disable JQuery animations on the page. Any state changes
will occur immediately to the final state.
"""
# Ensure that jquery is loaded
world.wait_for_js_to_load()
# Disable jQuery animations
world.browser.execute_script("jQuery.fx.off = true;")
...@@ -4,12 +4,10 @@ Feature: LMS.Navigate Course ...@@ -4,12 +4,10 @@ Feature: LMS.Navigate Course
In order to access courseware In order to access courseware
I want to be able to navigate through the content I want to be able to navigate through the content
# Disabled 10/21 Scenario: I can navigate to a section
# Fails intermittently to click the link to the section Given I am viewing a course with multiple sections
#Scenario: I can navigate to a section When I navigate to a section
# Given I am viewing a course with multiple sections Then I see the content of the section
# When I navigate to a section
# Then I see the content of the section
Scenario: I can navigate to subsections Scenario: I can navigate to subsections
Given I am viewing a section with multiple subsections Given I am viewing a section with multiple subsections
...@@ -22,11 +20,9 @@ Feature: LMS.Navigate Course ...@@ -22,11 +20,9 @@ Feature: LMS.Navigate Course
Then I see the content of the sequence item Then I see the content of the sequence item
And a "seq_goto" browser event is emitted And a "seq_goto" browser event is emitted
# Disabled 10/21 Scenario: I can return to the last section I visited
# Fails intermittently to click the link to the section Given I am viewing a course with multiple sections
#Scenario: I can return to the last section I visited When I navigate to a section
# Given I am viewing a course with multiple sections And I see the content of the section
# When I navigate to a section And I return to the courseware
# And I see the content of the section Then I see that I was most recently in the subsection
# And I return to the courseware
# Then I see that I was most recently in the subsection
...@@ -88,6 +88,9 @@ def view_course_multiple_sequences(step): ...@@ -88,6 +88,9 @@ def view_course_multiple_sequences(step):
@step(u'I navigate to a section') @step(u'I navigate to a section')
def when_i_navigate_to_a_section(step): def when_i_navigate_to_a_section(step):
# Prevent jQuery menu animations from interferring with the clicks
world.disable_jquery_animations()
# Open the 2nd section # Open the 2nd section
world.css_click(css_selector='div.chapter', index=1) world.css_click(css_selector='div.chapter', index=1)
subsection_css = 'a[href*="Test_Subsection_2/"]' subsection_css = 'a[href*="Test_Subsection_2/"]'
...@@ -176,6 +179,9 @@ def wait_for_problem(display_name): ...@@ -176,6 +179,9 @@ def wait_for_problem(display_name):
""" """
Wait for the problem with `display_name` to appear on the page. Wait for the problem with `display_name` to appear on the page.
""" """
# Wait for the problem to reload
world.wait_for_ajax_complete()
wait_func = lambda _: world.css_has_text( wait_func = lambda _: world.css_has_text(
'h2.problem-header', display_name, strip=True 'h2.problem-header', display_name, strip=True
) )
......
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