source: moodle/trunk/fuentes/admin/tool/behat/tests/behat/edit_permissions.feature @ 1331

Last change on this file since 1331 was 1331, checked in by jrpelegrina, 3 years ago

Updated to moodle 3.0.3

File size: 2.7 KB
Line 
1@tool @tool_behat
2Feature: Edit capabilities
3  In order to extend and restrict moodle features
4  As an admin or a teacher
5  I need to allow/deny the existing capabilities at different levels
6
7  Background:
8    Given the following "users" exist:
9      | username | firstname | lastname | email |
10      | teacher1 | Teacher | 1 | teacher1@example.com |
11    And the following "courses" exist:
12      | fullname | shortname | category |
13      | Course 1 | C1 | 0 |
14    And the following "course enrolments" exist:
15      | user | course | role |
16      | teacher1 | C1 | editingteacher |
17
18  Scenario: Default system capabilities modification
19    Given I log in as "admin"
20    And I set the following system permissions of "Teacher" role:
21      | capability | permission |
22      | block/mnet_hosts:myaddinstance | Allow |
23      | moodle/community:add | Inherit |
24      | moodle/grade:managesharedforms | Prevent |
25      | moodle/course:request | Prohibit |
26    When I follow "Edit Teacher role"
27    Then "block/mnet_hosts:myaddinstance" capability has "Allow" permission
28    And "moodle/community:add" capability has "Not set" permission
29    And "moodle/grade:managesharedforms" capability has "Prevent" permission
30    And "moodle/course:request" capability has "Prohibit" permission
31
32  Scenario: Course capabilities overrides
33    Given I log in as "teacher1"
34    And I follow "Course 1"
35    And I expand "Users" node
36    And I follow "Permissions"
37    And I override the system permissions of "Student" role with:
38      | mod/forum:deleteanypost | Prohibit |
39      | mod/forum:editanypost | Prevent |
40      | mod/forum:addquestion | Allow |
41    When I set the field "Advanced role override" to "Student (3)"
42    And I press "Go"
43    Then "mod/forum:deleteanypost" capability has "Prohibit" permission
44    And "mod/forum:editanypost" capability has "Prevent" permission
45    And "mod/forum:addquestion" capability has "Allow" permission
46
47  Scenario: Module capabilities overrides
48    Given I log in as "teacher1"
49    And I follow "Course 1"
50    And I turn editing mode on
51    And I add a "Forum" to section "1" and I fill the form with:
52      | Forum name | I'm the name |
53      | Description | I'm the introduction |
54    And I follow "I'm the name"
55    And I follow "Permissions"
56    And I override the system permissions of "Student" role with:
57      | mod/forum:deleteanypost | Prohibit |
58      | mod/forum:editanypost | Prevent |
59      | mod/forum:addquestion | Allow |
60    When I set the field "Advanced role override" to "Student (3)"
61    And I press "Go"
62    Then "mod/forum:deleteanypost" capability has "Prohibit" permission
63    And "mod/forum:editanypost" capability has "Prevent" permission
64    And "mod/forum:addquestion" capability has "Allow" permission
Note: See TracBrowser for help on using the repository browser.