Merge pull request #11387 from edx/benp/fix-test-tooltip

Correct flaky condition on tooltip.
This commit is contained in:
Ben Patterson
2016-02-02 10:44:53 -05:00
2 changed files with 9 additions and 7 deletions

View File

@@ -78,16 +78,18 @@ class CoursewarePage(CoursePage):
else:
return self.q(css=self.xblock_component_selector).attrs('innerHTML')[index].strip()
def tooltips_displayed(self):
def verify_tooltips_displayed(self):
"""
Verify if sequence navigation bar tooltips are being displayed upon mouse hover.
Verify that all sequence navigation bar tooltips are being displayed upon mouse hover.
If a tooltip does not appear, raise a BrokenPromise.
"""
for index, tab in enumerate(self.q(css='#sequence-list > li')):
ActionChains(self.browser).move_to_element(tab).perform()
if not self.q(css='#tab_{index} > p'.format(index=index)).visible:
return False
return True
self.wait_for_element_visibility(
'#tab_{index} > p'.format(index=index),
'Tab {index} should appear'.format(index=index)
)
@property
def course_license(self):

View File

@@ -864,7 +864,7 @@ class TooltipTest(UniqueCourseTest):
self.course_info_page.visit()
self.tab_nav.go_to_tab('Courseware')
self.assertTrue(self.courseware_page.tooltips_displayed())
self.courseware_page.verify_tooltips_displayed()
@attr('shard_1')