diff --git a/common/test/acceptance/pages/lms/instructor_dashboard.py b/common/test/acceptance/pages/lms/instructor_dashboard.py index 728d5b86c0..c07b5e04f9 100644 --- a/common/test/acceptance/pages/lms/instructor_dashboard.py +++ b/common/test/acceptance/pages/lms/instructor_dashboard.py @@ -299,6 +299,11 @@ class CohortManagementSection(PageObject): textinput.send_keys(user) textinput.send_keys(",") self.q(css=self._bounded_selector("div.cohort-management-group-add .action-primary")).first.click() + # Expect the confirmation message substring. (The full message will differ depending on 1 or >1 students added) + self.wait_for( + lambda: "added to this cohort" in self.get_cohort_confirmation_messages(wait_for_messages=True)[0], + "Student(s) added confirmation message." + ) def get_cohort_student_input_field_value(self): """ @@ -393,14 +398,14 @@ class CohortManagementSection(PageObject): return self._get_messages(title_css, detail_css, wait_for_messages=wait_for_messages) - def _get_cohort_messages(self, type): + def _get_cohort_messages(self, type, wait_for_messages=False): """ Returns array of messages related to manipulating cohorts directly through the UI for the given type. """ title_css = "div.cohort-management-group-add .cohort-" + type + " .message-title" detail_css = "div.cohort-management-group-add .cohort-" + type + " .summary-item" - return self._get_messages(title_css, detail_css) + return self._get_messages(title_css, detail_css, wait_for_messages) def get_csv_messages(self): """ @@ -428,12 +433,12 @@ class CohortManagementSection(PageObject): messages.append(detail.text) return messages - def get_cohort_confirmation_messages(self): + def get_cohort_confirmation_messages(self, wait_for_messages=False): """ Returns an array of messages present in the confirmation area of the cohort management UI. The first entry in the array is the title. Any further entries are the details. """ - return self._get_cohort_messages("confirmations") + return self._get_cohort_messages("confirmations", wait_for_messages) def get_cohort_error_messages(self): """