AutorÃa | Ultima modificación | Ver Log |
@core @core_cohort @enrol_cohortFeature: Access visible and hidden cohortsIn order to enrol users from cohortsAs an manager or teacherI need to be able to view the list of cohorts defined above the courseBackground:Given the following "categories" exist:| name | category | idnumber || Cat 1 | 0 | CAT1 || Cat 2 | 0 | CAT2 |And the following "cohorts" exist:| name | idnumber | visible || System cohort | CV0 | 1 || System hidden cohort | CH0 | 0 || System empty cohort | CVE0 | 1 |And the following "cohorts" exist:| name | idnumber | contextlevel | reference | visible || Cohort in category 1 | CV1 | Category | CAT1 | 1 || Cohort in category 2 | CV2 | Category | CAT2 | 1 || Cohort hidden in category 1 | CH1 | Category | CAT1 | 0 || Cohort empty in category 1 | CVE1 | Category | CAT1 | 1 |Given the following "users" exist:| username | firstname | lastname | email || user1 | First | User | first@example.com || user2 | Second | User | second@example.com || student | Sam | User | student@example.com || teacher | Terry | User | teacher@example.com |And the following "cohort members" exist:| user | cohort || student | CV0 || student | CV1 || student | CV2 || student | CH0 || student | CH1 |And the following "role assigns" exist:| user | role | contextlevel | reference || user1 | manager | System | || user2 | manager | Category | CAT1 |And the following "courses" exist:| fullname | shortname | category || Course 1 | C1 | CAT1 |And the following "course enrolments" exist:| user | course | role || teacher | C1 | editingteacher |@javascript @skip_chrome_zerosizeScenario: Teacher can see visible cohorts defined in the above contextsWhen I log in as "teacher"And I am on the "Course 1" "enrolment methods" pageAnd I select "Cohort sync" from the "Add method" singleselectAnd I open the autocomplete suggestions listThen "Cohort in category 1" "autocomplete_suggestions" should existAnd "System cohort" "autocomplete_suggestions" should existAnd "Cohort hidden in category 1" "autocomplete_suggestions" should not existAnd "System hidden cohort" "autocomplete_suggestions" should not existAnd "Cohort in category 2" "autocomplete_suggestions" should not existAnd "Cohort empty in category 1" "autocomplete_suggestions" should existAnd "System empty cohort" "autocomplete_suggestions" should existAnd I set the field "Cohort" to "System cohort"And I press "Add method"And I am on the "Course 1" "enrolled users" pageAnd I should see "student@example.com"And I am on the "Course 1" "groups" pageAnd I press "Auto-create groups"And the "Select members from cohort" select box should contain "Cohort in category 1"And the "Select members from cohort" select box should contain "System cohort"And the "Select members from cohort" select box should not contain "Cohort hidden in category 1"And the "Select members from cohort" select box should not contain "System hidden cohort"And the "Select members from cohort" select box should not contain "Cohort in category 2"And the "Select members from cohort" select box should not contain "Cohort empty in category 1"And the "Select members from cohort" select box should not contain "System empty cohort"@javascript @skip_chrome_zerosizeScenario: System manager can see all cohorts defined in the above contextsWhen I log in as "user1"And I am on the "Course 1" "enrolment methods" pageAnd I select "Cohort sync" from the "Add method" singleselectAnd I open the autocomplete suggestions listThen "Cohort in category 1" "autocomplete_suggestions" should existAnd "System cohort" "autocomplete_suggestions" should existAnd "Cohort hidden in category 1" "autocomplete_suggestions" should existAnd "System hidden cohort" "autocomplete_suggestions" should existAnd "Cohort in category 2" "autocomplete_suggestions" should not existAnd "Cohort empty in category 1" "autocomplete_suggestions" should existAnd "System empty cohort" "autocomplete_suggestions" should existAnd I set the field "Cohort" to "System cohort"And I press "Add method"And I am on the "Course 1" "enrolled users" pageAnd I should see "student@example.com"And I am on the "Course 1" "groups" pageAnd I press "Auto-create groups"And the "Select members from cohort" select box should contain "Cohort in category 1"And the "Select members from cohort" select box should contain "System cohort"And the "Select members from cohort" select box should contain "Cohort hidden in category 1"And the "Select members from cohort" select box should contain "System hidden cohort"And the "Select members from cohort" select box should not contain "Cohort in category 2"And the "Select members from cohort" select box should not contain "Cohort empty in category 1"And the "Select members from cohort" select box should not contain "System empty cohort"@javascript @skip_chrome_zerosizeScenario: Category manager can see all cohorts defined in his category and visible cohorts defined aboveWhen I log in as "user2"And I am on the "Course 1" "enrolment methods" pageAnd I select "Cohort sync" from the "Add method" singleselectAnd I open the autocomplete suggestions listThen "Cohort in category 1" "autocomplete_suggestions" should existAnd "System cohort" "autocomplete_suggestions" should existAnd "Cohort hidden in category 1" "autocomplete_suggestions" should existAnd "System hidden cohort" "autocomplete_suggestions" should not existAnd "Cohort in category 2" "autocomplete_suggestions" should not existAnd "Cohort empty in category 1" "autocomplete_suggestions" should existAnd "System empty cohort" "autocomplete_suggestions" should existAnd I set the field "Cohort" to "System cohort"And I press "Add method"And I am on the "Course 1" "enrolled users" pageAnd I should see "student@example.com"And I am on the "Course 1" "groups" pageAnd I press "Auto-create groups"And the "Select members from cohort" select box should contain "Cohort in category 1"And the "Select members from cohort" select box should contain "System cohort"And the "Select members from cohort" select box should contain "Cohort hidden in category 1"And the "Select members from cohort" select box should not contain "System hidden cohort"And the "Select members from cohort" select box should not contain "Cohort in category 2"And the "Select members from cohort" select box should not contain "Cohort empty in category 1"And the "Select members from cohort" select box should not contain "System empty cohort"