diff --git a/common/test/acceptance/pages/studio/overview.py b/common/test/acceptance/pages/studio/overview.py index b8eb7f29d9..8218522201 100644 --- a/common/test/acceptance/pages/studio/overview.py +++ b/common/test/acceptance/pages/studio/overview.py @@ -11,6 +11,7 @@ from selenium.webdriver.support.ui import Select from selenium.webdriver.common.keys import Keys from common.test.acceptance.pages.common.utils import click_css, confirm_prompt +from common.test.acceptance.tests.helpers import disable_animations, enable_animations from common.test.acceptance.pages.studio.course_page import CoursePage from common.test.acceptance.pages.studio.container import ContainerPage @@ -251,8 +252,7 @@ class CourseOutlineContainer(CourseOutlineItem): """ Toggle the expansion of this subsection. """ - # pylint: disable=no-member - self.browser.execute_script("jQuery.fx.off = true;") + disable_animations(self) def subsection_expanded(): """ @@ -268,7 +268,7 @@ class CourseOutlineContainer(CourseOutlineItem): # Need to click slightly off-center in order for the click to be recognized. ele = self.browser.find_element_by_css_selector(self._bounded_selector('.ui-toggle-expansion .fa')) - ActionChains(self.browser).move_to_element_with_offset(ele, 4, 4).click().perform() + ActionChains(self.browser).move_to_element_with_offset(ele, 8, 8).click().perform() # pylint: disable=no-member self.wait_for_element_presence(self._bounded_selector(self.ADD_BUTTON_SELECTOR), 'Subsection is expanded') EmptyPromise( @@ -276,7 +276,7 @@ class CourseOutlineContainer(CourseOutlineItem): "Check that the container {} has been toggled".format(self.locator) ).fulfill() - self.browser.execute_script("jQuery.fx.off = false;") + enable_animations(self) return self diff --git a/common/test/acceptance/tests/studio/test_studio_outline.py b/common/test/acceptance/tests/studio/test_studio_outline.py index b99c0b45e6..40387e836e 100644 --- a/common/test/acceptance/tests/studio/test_studio_outline.py +++ b/common/test/acceptance/tests/studio/test_studio_outline.py @@ -19,7 +19,7 @@ from common.test.acceptance.fixtures.config import ConfigModelFixture from common.test.acceptance.fixtures.course import XBlockFixtureDesc from base_studio_test import StudioCourseTest -from common.test.acceptance.tests.helpers import load_data_str +from common.test.acceptance.tests.helpers import load_data_str, disable_animations from common.test.acceptance.pages.lms.progress import ProgressPage @@ -1315,8 +1315,12 @@ class ExpandCollapseMultipleSectionsTest(CourseOutlineTest): And all sections are expanded """ self.course_outline_page.visit() + # We have seen unexplainable sporadic failures in this test. Try disabling animations to see + # if that helps. + disable_animations(self.course_outline_page) self.course_outline_page.toggle_expand_collapse() self.assertEquals(self.course_outline_page.expand_collapse_link_state, ExpandCollapseLinkState.EXPAND) + self.verify_all_sections(collapsed=True) self.course_outline_page.section_at(0).expand_subsection() self.course_outline_page.toggle_expand_collapse() self.assertEquals(self.course_outline_page.expand_collapse_link_state, ExpandCollapseLinkState.COLLAPSE)