Merge pull request #11240 from edx/benp/ff42-container-block-3
Fix flaky condition for firefox 42 on subsection container block (studio)
This commit is contained in:
@@ -6,6 +6,7 @@ import datetime
|
||||
from bok_choy.page_object import PageObject
|
||||
from bok_choy.promise import EmptyPromise
|
||||
|
||||
from selenium.webdriver import ActionChains
|
||||
from selenium.webdriver.support.ui import Select
|
||||
from selenium.webdriver.common.keys import Keys
|
||||
|
||||
@@ -254,12 +255,17 @@ class CourseOutlineContainer(CourseOutlineItem):
|
||||
"""
|
||||
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
|
||||
return add_button and add_button[0].is_displayed()
|
||||
|
||||
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, 4, 4).click().perform()
|
||||
self.wait_for_element_presence(self._bounded_selector(self.ADD_BUTTON_SELECTOR), 'Subsection is expanded')
|
||||
|
||||
EmptyPromise(
|
||||
|
||||
Reference in New Issue
Block a user