Merge pull request #6941 from edx/anton/fix-flaky-tests

TNL-454: Fix flaky bok-choy tests.
This commit is contained in:
Anton Stupak
2015-02-20 14:31:42 +02:00
3 changed files with 20 additions and 27 deletions

View File

@@ -356,10 +356,6 @@ class VideoPage(PageObject):
self.q(css=button_selector).first.click()
button_states = {'play': 'playing', 'pause': 'pause'}
if button in button_states:
self.wait_for_state(button_states[button])
self.wait_for_ajax()
def _get_element_dimensions(self, selector):
@@ -677,7 +673,7 @@ class VideoPage(PageObject):
elif 'is-ended' in current_state:
return 'finished'
def _wait_for(self, check_func, desc, result=False, timeout=200):
def _wait_for(self, check_func, desc, result=False, timeout=200, try_interval=0.2):
"""
Calls the method provided as an argument until the Promise satisfied or BrokenPromise
@@ -689,9 +685,9 @@ class VideoPage(PageObject):
"""
if result:
return Promise(check_func, desc, timeout=timeout).fulfill()
return Promise(check_func, desc, timeout=timeout, try_interval=try_interval).fulfill()
else:
return EmptyPromise(check_func, desc, timeout=timeout).fulfill()
return EmptyPromise(check_func, desc, timeout=timeout, try_interval=try_interval).fulfill()
def wait_for_state(self, state):
"""