Assign cohorts to groups in the instructor dashboard

TNL-653
This commit is contained in:
Andy Armstrong
2014-12-18 17:23:58 -05:00
parent 674bfc4fcb
commit b77e65cdc2
19 changed files with 877 additions and 302 deletions

View File

@@ -153,7 +153,7 @@ class MembershipPageCohortManagementSection(PageObject):
Adds a new manual cohort with the specified name.
"""
self.q(css=self._bounded_selector("div.cohort-management-nav .action-create")).first.click()
textinput = self.q(css=self._bounded_selector("#cohort-create-name")).results[0]
textinput = self.q(css=self._bounded_selector("#cohort-name")).results[0]
textinput.send_keys(cohort_name)
self.q(css=self._bounded_selector("div.form-actions .action-save")).first.click()

View File

@@ -3,6 +3,7 @@ Helper functions and classes for discussion tests.
"""
from uuid import uuid4
import json
from ...fixtures.discussion import (
SingleThreadViewFixture,
@@ -68,11 +69,11 @@ class CohortTestMixin(object):
"""
Adds a cohort group by name, returning the ID for the group.
"""
url = LMS_BASE_URL + "/courses/" + course_fixture._course_key + '/cohorts/add'
data = {"name": cohort_name}
url = LMS_BASE_URL + "/courses/" + course_fixture._course_key + '/cohorts/'
data = json.dumps({"name": cohort_name})
response = course_fixture.session.post(url, data=data, headers=course_fixture.headers)
self.assertTrue(response.ok, "Failed to create cohort")
return response.json()['cohort']['id']
return response.json()['id']
def add_user_to_cohort(self, course_fixture, username, cohort_id):
"""