Commit 2b731b70 by Ben Patterson

Fix flaky condition only appearing in newer firefox versions.

parent 9cf16cd2
...@@ -6,6 +6,7 @@ import datetime ...@@ -6,6 +6,7 @@ import datetime
from bok_choy.page_object import PageObject from bok_choy.page_object import PageObject
from bok_choy.promise import EmptyPromise from bok_choy.promise import EmptyPromise
from selenium.webdriver import ActionChains
from selenium.webdriver.support.ui import Select from selenium.webdriver.support.ui import Select
from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.keys import Keys
...@@ -254,12 +255,17 @@ class CourseOutlineContainer(CourseOutlineItem): ...@@ -254,12 +255,17 @@ class CourseOutlineContainer(CourseOutlineItem):
""" """
Returns whether or not this subsection is expanded. Returns whether or not this subsection is expanded.
""" """
self.wait_for_element_presence(
self._bounded_selector(self.ADD_BUTTON_SELECTOR), 'Toggle control is present'
)
add_button = self.q(css=self._bounded_selector(self.ADD_BUTTON_SELECTOR)).first.results add_button = self.q(css=self._bounded_selector(self.ADD_BUTTON_SELECTOR)).first.results
return add_button and add_button[0].is_displayed() return add_button and add_button[0].is_displayed()
currently_expanded = subsection_expanded() currently_expanded = subsection_expanded()
self.q(css=self._bounded_selector('.ui-toggle-expansion i')).first.click() # 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 i'))
ActionChains(self.browser).move_to_element_with_offset(ele, 1, 1).click().perform()
self.wait_for_element_presence(self._bounded_selector(self.ADD_BUTTON_SELECTOR), 'Subsection is expanded') self.wait_for_element_presence(self._bounded_selector(self.ADD_BUTTON_SELECTOR), 'Subsection is expanded')
EmptyPromise( EmptyPromise(
......
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