Commit e884c65a by Christina Roberts

Merge pull request #10106 from edx/christina/tnl-2667

Fix flaky Studio Course Team bok choy tests
parents c1ba907b 4125e594
...@@ -254,6 +254,7 @@ class UserWrapper(PageObject): ...@@ -254,6 +254,7 @@ class UserWrapper(PageObject):
self.wait_for_element_visibility('.prompt', 'Prompt is visible') self.wait_for_element_visibility('.prompt', 'Prompt is visible')
self.wait_for_element_visibility('.prompt .action-primary', 'Confirmation button is visible') self.wait_for_element_visibility('.prompt .action-primary', 'Confirmation button is visible')
self.q(css='.prompt .action-primary').click() self.q(css='.prompt .action-primary').click()
self.wait_for_element_absence('.page-prompt .is-shown', 'Confirmation prompt is hidden')
wait_for_ajax_or_reload(self.browser) wait_for_ajax_or_reload(self.browser)
@property @property
......
""" """
Acceptance tests for course in studio Acceptance tests for course in studio
""" """
from flaky import flaky
from nose.plugins.attrib import attr from nose.plugins.attrib import attr
from .base_studio_test import StudioCourseTest from .base_studio_test import StudioCourseTest
...@@ -11,7 +10,6 @@ from ...pages.studio.users import CourseTeamPage ...@@ -11,7 +10,6 @@ from ...pages.studio.users import CourseTeamPage
from ...pages.studio.index import DashboardPage from ...pages.studio.index import DashboardPage
@flaky # TODO fix this, see TNL-2667
@attr('shard_2') @attr('shard_2')
class CourseTeamPageTest(StudioCourseTest): class CourseTeamPageTest(StudioCourseTest):
""" As a course author, I want to be able to add others to my team """ """ As a course author, I want to be able to add others to my team """
...@@ -75,9 +73,15 @@ class CourseTeamPageTest(StudioCourseTest): ...@@ -75,9 +73,15 @@ class CourseTeamPageTest(StudioCourseTest):
def _assert_user_present(self, user, present=True): def _assert_user_present(self, user, present=True):
""" Checks if specified user present on Course Team page """ """ Checks if specified user present on Course Team page """
if present: if present:
self.assertIn(user.get('username'), self.page.usernames) self.page.wait_for(
lambda: user.get('username') in self.page.usernames,
description="Wait for user to be present"
)
else: else:
self.assertNotIn(user.get('username'), self.page.usernames) self.page.wait_for(
lambda: user.get('username') not in self.page.usernames,
description="Wait for user to be absent"
)
def _should_see_dialog(self, dialog_type, dialog_message): def _should_see_dialog(self, dialog_type, dialog_message):
""" Asserts dialog with specified message is shown """ """ Asserts dialog with specified message is shown """
...@@ -152,7 +156,6 @@ class CourseTeamPageTest(StudioCourseTest): ...@@ -152,7 +156,6 @@ class CourseTeamPageTest(StudioCourseTest):
self._assert_can_not_manage_users() self._assert_can_not_manage_users()
@flaky # TNL-3515
def test_admins_can_delete_other_users(self): def test_admins_can_delete_other_users(self):
""" """
Scenario: Admins can delete other users Scenario: Admins can delete other users
......
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