Skip to content
Snippets Groups Projects
Commit 854a564a authored by Will Daly's avatar Will Daly
Browse files

Fixed navigation acceptance test

Disable jquery animations to fix LMS navigation acceptance test.
parent 475cf077
No related merge requests found
......@@ -560,3 +560,17 @@ def retry_on_exception(func, max_attempts=5, ignored_exceptions=StaleElementRefe
attempt += 1
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
In order to access courseware
I want to be able to navigate through the content
# Disabled 10/21
# Fails intermittently to click the link to the section
#Scenario: I can navigate to a section
# Given I am viewing a course with multiple sections
# When I navigate to a section
# Then I see the content of the section
Scenario: I can navigate to a section
Given I am viewing a course with multiple sections
When I navigate to a section
Then I see the content of the section
Scenario: I can navigate to subsections
Given I am viewing a section with multiple subsections
......@@ -22,11 +20,9 @@ Feature: LMS.Navigate Course
Then I see the content of the sequence item
And a "seq_goto" browser event is emitted
# Disabled 10/21
# Fails intermittently to click the link to the section
#Scenario: I can return to the last section I visited
# Given I am viewing a course with multiple sections
# When I navigate to a section
# And I see the content of the section
# And I return to the courseware
# Then I see that I was most recently in the subsection
Scenario: I can return to the last section I visited
Given I am viewing a course with multiple sections
When I navigate to a section
And I see the content of the section
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):
@step(u'I navigate to a section')
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
world.css_click(css_selector='div.chapter', index=1)
subsection_css = 'a[href*="Test_Subsection_2/"]'
......@@ -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 to reload
world.wait_for_ajax_complete()
wait_func = lambda _: world.css_has_text(
'h2.problem-header', display_name, strip=True
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment