2 Feature: Test role visibility for the participants page
3 In order to control access
5 I need to control which roles can see each other
7 Background: Add a bunch of users
8 Given the following "courses" exist:
9 | fullname | shortname |
11 And the following "users" exist:
12 | username | firstname | lastname | email |
13 | learner1 | Learner | 1 | learner1@example.com |
14 | teacher1 | Teacher | 1 | teacher1@example.com |
15 | manager1 | Manager | 1 | manager1@example.com |
16 And the following "course enrolments" exist:
17 | user | course | role |
18 | learner1 | C1 | student |
19 | teacher1 | C1 | editingteacher |
20 | manager1 | C1 | manager |
22 Scenario: Check the default roles are visible
23 Given I log in as "manager1"
24 And I am on "Course 1" course homepage
25 When I navigate to "Users > Enrolled users" in current page administration
26 Then "Learner 1" row "Roles" column of "participants" table should contain "Student"
27 And "Teacher 1" row "Roles" column of "participants" table should contain "Teacher"
28 And "Manager 1" row "Roles" column of "participants" table should contain "Manager"
29 And I should not see "No Roles" in the "table#participants" "css_element"
31 Scenario: Do not allow managers to view any roles but manager and check they are hidden
32 Given I log in as "teacher1"
33 And I am on "Course 1" course homepage
34 When I navigate to "Users > Enrolled users" in current page administration
35 Then "Learner 1" row "Roles" column of "participants" table should contain "Student"
36 And "Teacher 1" row "Roles" column of "participants" table should contain "Teacher"
37 And "Manager 1" row "Roles" column of "participants" table should not contain "Manager"
38 And "Manager 1" row "Roles" column of "participants" table should contain "No roles"