MDL-63854 competencies, themes: misplaced dropdown arrows
[moodle.git] / course / tests / behat / category_role_assignment.feature
blob3dfe02cf855bc42713a612f2f67437d23533d907
1 @core @core_course
2 Feature: Role assignments can be made at the category level
3   In order to grant a user different capabilities
4   As a user
5   I can assign roles in categories
7   Background:
8     Given the following "users" exist:
9       | username  | firstname | lastname |
10       | manager   | Manager   | Manager  |
11     And the following "categories" exist:
12       | name | category | idnumber |
13       | Cat 1 | 0 | CAT1 |
14     And the following "role assigns" exist:
15       | user    | role          | contextlevel | reference |
16       | manager | manager       | Category     | CAT1      |
17     And I log in as "admin"
19   @javascript
20   Scenario: A user with a category role can assign roles
21     Given I define the allowed role assignments for the "Manager" role as:
22       | Teacher | Assignable |
23     And I log out
24     And I log in as "manager"
25     And I am on course index
26     When I follow "Cat 1"
27     Then "Assign roles" "link" should exist in current page administration
29   @javascript
30   Scenario: A user with a category role cannot assign roles if there are no roles to assign
31     Given I define the allowed role assignments for the "Manager" role as:
32       | Manager             | Not assignable |
33       | Course creator      | Not assignable |
34       | Teacher             | Not assignable |
35       | Non-editing teacher | Not assignable |
36       | Student             | Not assignable |
37     And I log out
38     And I log in as "manager"
39     And I am on course index
40     When I follow "Cat 1"
41     Then "Assign roles" "link" should not exist in current page administration