forked from moodle/moodle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'MDL-72193' of https://github.com/paulholden/moodle
- Loading branch information
Showing
2 changed files
with
56 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,11 +5,14 @@ Feature: A teacher can manage manually enrolled users in their course | |
I can manually add and remove users in my course | ||
|
||
Background: | ||
Given the following "users" exist: | ||
| username | firstname | middlename | lastname | email | | ||
| teacher | Teacher | | User | teacher@example.com | | ||
| user1 | First | Alice | User | first@example.com | | ||
| user2 | Second | Bob | User | second@example.com | | ||
Given the following "custom profile fields" exist: | ||
| datatype | shortname | name | | ||
| text | fruit | Fruit | | ||
And the following "users" exist: | ||
| username | firstname | middlename | lastname | email | profile_field_fruit | | ||
| teacher | Teacher | | User | teacher@example.com | | | ||
| user1 | First | Alice | User | first@example.com | Apple | | ||
| user2 | Second | Bob | User | second@example.com | Banana | | ||
And the following "courses" exist: | ||
| fullname | shortname | category | | ||
| Course 1 | C1 | 0 | | ||
|
@@ -24,8 +27,7 @@ Feature: A teacher can manage manually enrolled users in their course | |
And the following "permission overrides" exist: | ||
| capability | permission | role | contextlevel | reference | | ||
| moodle/site:viewfullnames | <permission> | editingteacher | Course | C1 | | ||
When I log in as "teacher" | ||
And I am on the "Course 1" "enrolment methods" page | ||
When I am on the "Course 1" "enrolment methods" page logged in as "teacher" | ||
And I click on "Enrol users" "link" in the "Manual enrolments" "table_row" | ||
And I set the field "addselect_searchtext" to "First" | ||
And I wait "1" seconds | ||
|
@@ -48,8 +50,7 @@ Feature: A teacher can manage manually enrolled users in their course | |
| user | course | role | | ||
| user1 | C1 | student | | ||
| user2 | C1 | student | | ||
When I log in as "teacher" | ||
And I am on the "Course 1" "enrolment methods" page | ||
When I am on the "Course 1" "enrolment methods" page logged in as "teacher" | ||
And I click on "Enrol users" "link" in the "Manual enrolments" "table_row" | ||
And I set the field "removeselect_searchtext" to "First" | ||
And I wait "1" seconds | ||
|
@@ -60,3 +61,35 @@ Feature: A teacher can manage manually enrolled users in their course | |
| permission | expectedfullname | | ||
| Allow | First Alice User | | ||
| Prohibit | First User | | ||
|
||
@javascript | ||
Scenario: Manually enrol users in course using custom user profile fields | ||
Given the following config values are set as admin: | ||
| showuseridentity | email,profile_field_fruit | | ||
When I am on the "Course 1" "enrolment methods" page logged in as "teacher" | ||
And I click on "Enrol users" "link" in the "Manual enrolments" "table_row" | ||
Then the "Not enrolled users" select box should contain "Second User ([email protected]\, Banana)" | ||
And I set the field "addselect_searchtext" to "Apple" | ||
And I wait "1" seconds | ||
And the "Not enrolled users" select box should not contain "Second User ([email protected]\, Banana)" | ||
And I set the field "Not enrolled users" to "First User ([email protected]\, Apple)" | ||
And I press "Add" | ||
And the "Enrolled users" select box should contain "First User ([email protected]\, Apple)" | ||
|
||
@javascript | ||
Scenario: Manually unenrol users in course using custom user profile fields | ||
Given the following config values are set as admin: | ||
| showuseridentity | email,profile_field_fruit | | ||
And the following "course enrolments" exist: | ||
| user | course | role | | ||
| user1 | C1 | student | | ||
| user2 | C1 | student | | ||
When I am on the "Course 1" "enrolment methods" page logged in as "teacher" | ||
And I click on "Enrol users" "link" in the "Manual enrolments" "table_row" | ||
Then the "Enrolled users" select box should contain "Second User ([email protected]\, Banana)" | ||
And I set the field "removeselect_searchtext" to "Apple" | ||
And I wait "1" seconds | ||
And the "Enrolled users" select box should not contain "Second User ([email protected]\, Banana)" | ||
And I set the field "Enrolled users" to "First User ([email protected]\, Apple)" | ||
And I press "Remove" | ||
And the "Not enrolled users" select box should contain "First User ([email protected]\, Apple)" |