Fixes for assorted flaky bok-choy tests
This commit is contained in:
@@ -723,6 +723,7 @@ class DiscussionTabHomePage(CoursePage, DiscussionPageMixin):
|
||||
Get the rendered preview of the contents of the Discussions new post editor
|
||||
Waits for content to appear, as the preview is triggered on debounced/delayed onchange
|
||||
"""
|
||||
self.scroll_to_element(selector)
|
||||
self.wait_for_element_visibility(selector, "WMD preview pane has contents", timeout=10)
|
||||
return self.q(css=".wmd-preview").html[0]
|
||||
|
||||
|
||||
@@ -520,6 +520,7 @@ class TeamPage(CoursePage, PaginatedUIMixin, BreadcrumbsMixin):
|
||||
def click_leave_team_link(self, remaining_members=0, cancel=False):
|
||||
""" Click on Leave Team link"""
|
||||
leave_team_css = '.leave-team-link'
|
||||
self.scroll_to_element(leave_team_css)
|
||||
self.wait_for_element_visibility(leave_team_css, 'Leave Team link is visible.')
|
||||
click_css(self, leave_team_css, require_notification=False)
|
||||
confirm_prompt(self, cancel, require_notification=False)
|
||||
|
||||
@@ -435,8 +435,8 @@ def verify_expected_problem_visibility(test, courseware_page, expected_problems)
|
||||
"""
|
||||
Helper method that checks that the expected problems are visible on the current page.
|
||||
"""
|
||||
test.assertEqual(
|
||||
len(expected_problems), courseware_page.num_xblock_components, "Incorrect number of visible problems"
|
||||
courseware_page.wait_for(
|
||||
lambda: courseware_page.num_xblock_components == len(expected_problems), "Expected number of problems visible"
|
||||
)
|
||||
for index, expected_problem in enumerate(expected_problems):
|
||||
test.assertIn(expected_problem, courseware_page.xblock_components[index].text)
|
||||
|
||||
@@ -1066,8 +1066,9 @@ class UnitPublishingTest(ContainerBase):
|
||||
"""
|
||||
Verifies no component is visible when viewing as a student.
|
||||
"""
|
||||
self._verify_and_return_staff_page().set_staff_view_mode('Learner')
|
||||
self.assertEqual(0, self.courseware.num_xblock_components)
|
||||
page = self._verify_and_return_staff_page()
|
||||
page.set_staff_view_mode('Learner')
|
||||
page.wait_for(lambda: self.courseware.num_xblock_components == 0, 'No XBlocks visible')
|
||||
|
||||
def _verify_student_view_visible(self, expected_components):
|
||||
"""
|
||||
|
||||
@@ -802,7 +802,8 @@ class StaffLockTest(CourseOutlineTest):
|
||||
course_home_page.wait_for_page()
|
||||
self.assertEqual(course_home_page.outline.num_sections, 2)
|
||||
course_home_page.preview.set_staff_view_mode('Learner')
|
||||
self.assertEqual(course_home_page.outline.num_sections, 1)
|
||||
course_home_page.wait_for(lambda: course_home_page.outline.num_sections == 1,
|
||||
'Only 1 section is visible in the outline')
|
||||
|
||||
def test_toggling_staff_lock_on_section_does_not_publish_draft_units(self):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user