'Adds a new manual cohort with the specified name.
If a content group should also be associated, the name of the content group should be specified.'

def add_cohort(self, cohort_name, content_group=None, assignment_type=None):

    add_cohort_selector = self._bounded_selector('.action-create')
    self.wait_for_element_presence(add_cohort_selector, 'Add    Cohort    button    is    present.')
    create_buttons = self.q(css=add_cohort_selector)
    create_buttons.results[(len(create_buttons.results) - 1)].click()
    self.wait_for((lambda : ('Add    a    New    Cohort' in self.q(css=self._bounded_selector('.form-title')).text)), 'Create    cohort    form    is    visible')
    textinput = self.q(css=self._bounded_selector('#cohort-name')).results[0]
    textinput.send_keys(cohort_name)
    if assignment_type:
        self.set_assignment_type(assignment_type)
    if content_group:
        self._select_associated_content_group(content_group)
    self.save_cohort_settings()
    EmptyPromise((lambda : (cohort_name == self.get_selected_cohort())), 'Waiting    for    new    cohort').fulfill()
