'Uploads a file with cohort assignment information.'

def upload_cohort_file(self, filename):

    cvs_upload_toggle_css = '.toggle-cohort-management-secondary'
    self.wait_for_element_visibility(cvs_upload_toggle_css, 'Wait    for    csv    upload    link    to    appear')
    cvs_upload_toggle = self.q(css=self._bounded_selector(cvs_upload_toggle_css)).first
    if cvs_upload_toggle:
        cvs_upload_toggle.click()
        self.wait_for_element_visibility(self._bounded_selector(self.csv_browse_button_selector_css), 'File    upload    link    visible')
    path = InstructorDashboardPage.get_asset_path(filename)
    file_input = self.q(css=self._bounded_selector(self.csv_browse_button_selector_css)).results[0]
    file_input.send_keys(path)
    self.q(css=self._bounded_selector(self.csv_upload_button_selector_css)).first.click()
