first commit

This commit is contained in:
CHIEFSOFT\ameye
2024-09-30 18:11:26 -04:00
commit e592ca6823
27270 changed files with 5002257 additions and 0 deletions
@@ -0,0 +1,103 @@
@tool @tool_capability
Feature: show capabilities for selected roles
In order to check roles capabilities
As an admin
I need to be able to customize capabilities report viewing only specific roles and capabilities
Background:
Given the following "roles" exist:
| shortname | name | archetype |
| studenteq | Studenteq | student |
| studentdf | Studentdf | student |
And the following "permission overrides" exist:
| capability | permission | role | contextlevel | reference |
| moodle/course:changefullname | Allow | studentdf | System | |
| moodle/course:changeshortname | Prohibit | studentdf | System | |
| moodle/course:changeidnumber | Prevent | studentdf | System | |
And I log in as "admin"
And I navigate to "Users > Permissions > Capability overview" in site administration
Scenario: visualize capabilities table with a limited number of capabilities
When I set the following fields to these values:
| Capability: | moodle/course:changefullname, moodle/course:changeshortname |
| Roles: | Studentdf |
And I click on "Get the overview" "button"
Then I should see "moodle/course:changefullname" in the "comparisontable" "table"
And I should see "moodle/course:changeshortname" in the "comparisontable" "table"
And I should not see "moodle/course:changecategory" in the "comparisontable" "table"
Scenario: visualize an allow capability
When I set the following fields to these values:
| Capability: | moodle/course:changefullname |
| Roles: | Studentdf |
And I click on "Get the overview" "button"
Then I should see "Allow" in the "comparisontable" "table"
And I should not see "Prevent" in the "comparisontable" "table"
And I should not see "Prohibit" in the "comparisontable" "table"
And I should not see "Not set" in the "comparisontable" "table"
Scenario: visualize a prohibit capability
When I set the following fields to these values:
| Capability: | moodle/course:changeshortname |
| Roles: | Studentdf |
And I click on "Get the overview" "button"
Then I should not see "Allow" in the "comparisontable" "table"
And I should not see "Prevent" in the "comparisontable" "table"
And I should see "Prohibit" in the "comparisontable" "table"
And I should not see "Not set" in the "comparisontable" "table"
Scenario: visualize a not set capability
When I set the following fields to these values:
| Capability: | moodle/course:changecategory |
| Roles: | Studentdf |
And I click on "Get the overview" "button"
Then I should not see "Allow" in the "comparisontable" "table"
And I should not see "Prevent" in the "comparisontable" "table"
And I should not see "Prohibit" in the "comparisontable" "table"
And I should see "Not set" in the "comparisontable" "table"
Scenario: visualize more than one role
When I set the following fields to these values:
| Capability: | moodle/course:changecategory |
| Roles: | Student, Studentdf |
And I click on "Get the overview" "button"
Then I should see "Student" in the "comparisontable" "table"
And I should see "Studentdf" in the "comparisontable" "table"
And I should not see "Teacher" in the "comparisontable" "table"
Scenario: visualize all roles without selecting any role
When I set the following fields to these values:
| Capability: | moodle/course:changecategory |
And I click on "Get the overview" "button"
Then I should see "Student" in the "comparisontable" "table"
And I should see "Studentdf" in the "comparisontable" "table"
And I should see "Teacher" in the "comparisontable" "table"
Scenario: visualize all roles by selecting All option
When I set the following fields to these values:
| Capability: | moodle/course:changecategory |
| Roles: | All |
And I click on "Get the overview" "button"
Then I should see "Student" in the "comparisontable" "table"
And I should see "Studentdf" in the "comparisontable" "table"
And I should see "Teacher" in the "comparisontable" "table"
@javascript
Scenario: filter capability list using javascript
Given I should see "moodle/site:config" in the "Capability" "field"
And I should see "moodle/course:change" in the "Capability" "field"
And I set the field "Search" in the "#capability-overview-form" "css_element" to "moodle/course:change"
Then I should see "moodle/course:change" in the "Capability" "field"
And I should not see "moodle/site:config" in the "Capability" "field"
@javascript
Scenario: selecting capabilities using filters
Given I should see "moodle/course:change" in the "Capability" "field"
And I set the field "Search" in the "#capability-overview-form" "css_element" to "moodle/course:change"
And I wait "1" seconds
When I set the following fields to these values:
| Capability: | moodle/course:changecategory |
| Roles: | Student |
And I click on "Get the overview" "button"
Then I should see "moodle/course:changecategory" in the "comparisontable" "table"
And the field "Capability:" matches value "moodle/course:changecategory"
@@ -0,0 +1,133 @@
@tool @tool_capability
Feature: Show capabilities for multiple contexts
In order to check roles capabilities
As an admin
I need to be able to see capability overrides on several contexts
Background:
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
| Course 2 | C2 | 0 |
And the following "permission overrides" exist:
| capability | permission | role | contextlevel | reference |
| enrol/category:config | Allow | student | Course | C1 |
| enrol/cohort:unenrol | Allow | student | Course | C2 |
And I log in as "admin"
And I navigate to "Users > Permissions > Capability overview" in site administration
Scenario: Show capabilities table with one capability with overrides
When I set the following fields to these values:
| Capability: | enrol/category:config |
| Roles: | Student |
And I click on "Get the overview" "button"
Then I should see "Permissions in System"
And I should see "Permissions in Category: Category 1"
And I should see "Permissions in Course: Course 1"
And I should not see "Permissions in Course: Course 2"
Scenario: Show capabilities table with one capability without overrides
When I set the following fields to these values:
| Capability: | enrol/cohort:config |
| Roles: | Student |
And I click on "Get the overview" "button"
Then I should see "Permissions in System"
And I should not see "Permissions in Category: Category 1"
And I should not see "Permissions in Course: Course 1"
And I should not see "Permissions in Course: Course 2"
Scenario: Show capabilities table with two capabilities, 1st without overrides and 2nd with
When I set the following fields to these values:
| Capability: | enrol/category:synchronised, enrol/category:config |
| Roles: | Student |
And I click on "Get the overview" "button"
Then I should see "Permissions in System"
And I should see "Permissions in Category: Category 1"
And I should see "Permissions in Course: Course 1"
And I should not see "Permissions in Course: Course 2"
Scenario: Show capabilities table with two capabilities, 1st with overrides and 2nd without
When I set the following fields to these values:
| Capability: | enrol/category:config, enrol/cohort:config |
| Roles: | Student |
And I click on "Get the overview" "button"
Then I should see "Permissions in System"
And I should see "Permissions in Category: Category 1"
And I should see "Permissions in Course: Course 1"
And I should not see "Permissions in Course: Course 2"
Scenario: Show capabilities table with two capabilities, none with overrides
When I set the following fields to these values:
| Capability: | enrol/category:synchronised, enrol/cohort:config |
| Roles: | Student |
And I click on "Get the overview" "button"
Then I should see "Permissions in System"
And I should not see "Permissions in Category: Category 1"
And I should not see "Permissions in Course: Course 1"
And I should not see "Permissions in Course: Course 2"
Scenario: Show capabilities table with capability with override and no role selected
When I set the following fields to these values:
| Capability: | enrol/category:config |
| Roles: | |
And I click on "Get the overview" "button"
Then I should see "Permissions in System"
And I should see "Permissions in Category: Category 1"
And I should see "Permissions in Course: Course 1"
And I should not see "Permissions in Course: Course 2"
Scenario: Show capabilities table with capability without override and no role selected
When I set the following fields to these values:
| Capability: | enrol/cohort:config |
| Roles: | |
And I click on "Get the overview" "button"
Then I should see "Permissions in System"
And I should not see "Permissions in Category: Category 1"
And I should not see "Permissions in Course: Course 1"
And I should not see "Permissions in Course: Course 2"
Scenario: Show capabilities table with capability with two overrides on different contexts
When I set the following fields to these values:
| Capability: | enrol/category:config, enrol/cohort:unenrol |
| Roles: | |
And I click on "Get the overview" "button"
Then I should see "Permissions in System"
And I should see "Permissions in Category: Category 1"
And I should see "Permissions in Course: Course 1"
And I should see "Permissions in Course: Course 2"
Scenario: Show capabilities table with capability with override and only diff
When I set the following fields to these values:
| Capability: | enrol/category:config |
| Roles: | Student, Teacher |
And I set the field "Show differences only" to "1"
And I click on "Get the overview" "button"
Then I should see "Permissions in System"
And I should see "Permissions in Category: Category 1"
And I should see "There are no differences to show between selected roles in this context"
And I should see "Permissions in Course: Course 1"
And I should not see "Permissions in Course: Course 2"
Scenario: Show capabilities table with capability without override and only diff and same capability
When I set the following fields to these values:
| Capability: | enrol/category:synchronised |
| Roles: | Student, Teacher |
And I set the field "Show differences only" to "1"
And I click on "Get the overview" "button"
Then I should see "Permissions in System"
And I should see "There are no differences to show between selected roles in this context"
And I should not see "Permissions in Category: Category 1"
And I should not see "Permissions in Course: Course 1"
And I should not see "Permissions in Course: Course 2"
Scenario: Show capabilities table with two capabilities only one override and only diff checked
When I set the following fields to these values:
| Capability: | enrol/category:config, enrol/cohort:config |
| Roles: | Student, Teacher |
And I set the field "Show differences only" to "1"
And I click on "Get the overview" "button"
Then I should see "Permissions in System"
And I should see "Permissions in Category: Category 1"
And I should see "There are no differences to show between selected roles in this context"
And I should see "Permissions in Course: Course 1"
And I should not see "Permissions in Course: Course 2"
@@ -0,0 +1,67 @@
@tool @tool_capability
Feature: show only differences between roles for selected capabilities
In order to check roles capabilities
As an admin
I need to be able to filter capabilities report viewing only role differences
Background:
Given the following "roles" exist:
| shortname | name | archetype |
| studenteq | Studenteq | student |
| studentdf | Studentdf | student |
And the following "permission overrides" exist:
| capability | permission | role | contextlevel | reference |
| moodle/course:changefullname | Allow | studentdf | System | |
| moodle/course:changeshortname | Prohibit | studentdf | System | |
And I log in as "admin"
And I navigate to "Users > Permissions > Capability overview" in site administration
Scenario: Compare identical roles
When I set the following fields to these values:
| Capability: | moodle/course:changefullname, moodle/course:changeshortname, moodle/course:changeidnumber, moodle/course:changesummary |
| Roles: | Student, Studenteq |
And I set the field "Show differences only" to "1"
And I click on "Get the overview" "button"
Then I should see "There are no differences to show between selected roles in this context"
Scenario: Compare different roles
When I set the following fields to these values:
| Capability: | moodle/course:changefullname, moodle/course:changeshortname, moodle/course:changeidnumber, moodle/course:changesummary |
| Roles: | Student, Studentdf |
And I set the field "Show differences only" to "1"
And I click on "Get the overview" "button"
Then I should not see "There are no differences to show between selected roles in this context"
And I should see "moodle/course:changefullname" in the "comparisontable" "table"
And I should see "moodle/course:changeshortname" in the "comparisontable" "table"
And I should not see "moodle/course:changesummary" in the "comparisontable" "table"
Scenario: Compare different roles but comparing capabilities that are equals on both
When I set the following fields to these values:
| Capability: | moodle/course:changeidnumber, moodle/course:changesummary |
| Roles: | Student, Studentdf |
And I set the field "Show differences only" to "1"
And I click on "Get the overview" "button"
Then I should see "There are no differences to show between selected roles in this context"
Scenario: Compare all roles without selecting specific role
When I set the following fields to these values:
| Capability: | moodle/course:changefullname, moodle/site:config |
And I set the field "Show differences only" to "1"
And I click on "Get the overview" "button"
Then I should not see "moodle/site:config" in the "comparisontable" "table"
And I should see "moodle/course:changefullname" in the "comparisontable" "table"
Scenario: Compare all roles without selecting specific role on not defined capability
When I set the following fields to these values:
| Capability: | moodle/site:config |
And I set the field "Show differences only" to "1"
And I click on "Get the overview" "button"
Then I should see "There are no differences to show between selected roles in this context"
Scenario: Comparing only one role
When I set the following fields to these values:
| Capability: | moodle/course:changefullname, moodle/course:changeshortname, moodle/course:changeidnumber, moodle/course:changesummary |
| Roles: | Student |
And I set the field "Show differences only" to "1"
And I click on "Get the overview" "button"
Then I should see "There are no differences to show between selected roles in this context"