Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@tool @tool_capability
2
Feature: show capabilities for selected roles
3
  In order to check roles capabilities
4
  As an admin
5
  I need to be able to customize capabilities report viewing only specific roles and capabilities
6
 
7
  Background:
8
    Given the following "roles" exist:
9
      | shortname     | name      | archetype |
10
      | studenteq     | Studenteq | student   |
11
      | studentdf     | Studentdf | student   |
12
    And the following "permission overrides" exist:
13
      | capability                    | permission | role        | contextlevel | reference |
14
      | moodle/course:changefullname  | Allow      | studentdf   | System       |           |
15
      | moodle/course:changeshortname | Prohibit   | studentdf   | System       |           |
16
      | moodle/course:changeidnumber  | Prevent    | studentdf   | System       |           |
17
    And I log in as "admin"
18
    And I navigate to "Users > Permissions > Capability overview" in site administration
19
 
20
  Scenario: visualize capabilities table with a limited number of capabilities
21
    When I set the following fields to these values:
22
      | Capability: | moodle/course:changefullname, moodle/course:changeshortname |
23
      | Roles:      | Studentdf                                                                                 |
24
    And I click on "Get the overview" "button"
25
    Then I should see "moodle/course:changefullname" in the "comparisontable" "table"
26
    And I should see "moodle/course:changeshortname" in the "comparisontable" "table"
27
    And I should not see "moodle/course:changecategory" in the "comparisontable" "table"
28
 
29
  Scenario: visualize an allow capability
30
    When I set the following fields to these values:
31
      | Capability: | moodle/course:changefullname |
32
      | Roles:      | Studentdf                                                                                                     |
33
    And I click on "Get the overview" "button"
34
    Then I should see "Allow" in the "comparisontable" "table"
35
    And I should not see "Prevent" in the "comparisontable" "table"
36
    And I should not see "Prohibit" in the "comparisontable" "table"
37
    And I should not see "Not set" in the "comparisontable" "table"
38
 
39
  Scenario: visualize a prohibit capability
40
    When I set the following fields to these values:
41
      | Capability: | moodle/course:changeshortname |
42
      | Roles:      | Studentdf                                                                                                     |
43
    And I click on "Get the overview" "button"
44
    Then I should not see "Allow" in the "comparisontable" "table"
45
    And I should not see "Prevent" in the "comparisontable" "table"
46
    And I should see "Prohibit" in the "comparisontable" "table"
47
    And I should not see "Not set" in the "comparisontable" "table"
48
 
49
  Scenario: visualize a not set capability
50
    When I set the following fields to these values:
51
      | Capability: | moodle/course:changecategory |
52
      | Roles:      | Studentdf                    |
53
    And I click on "Get the overview" "button"
54
    Then I should not see "Allow" in the "comparisontable" "table"
55
    And I should not see "Prevent" in the "comparisontable" "table"
56
    And I should not see "Prohibit" in the "comparisontable" "table"
57
    And I should see "Not set" in the "comparisontable" "table"
58
 
59
  Scenario: visualize more than one role
60
    When I set the following fields to these values:
61
      | Capability: | moodle/course:changecategory |
62
      | Roles:      | Student, Studentdf           |
63
    And I click on "Get the overview" "button"
64
    Then I should see "Student" in the "comparisontable" "table"
65
    And I should see "Studentdf" in the "comparisontable" "table"
66
    And I should not see "Teacher" in the "comparisontable" "table"
67
 
68
  Scenario: visualize all roles without selecting any role
69
    When I set the following fields to these values:
70
      | Capability: | moodle/course:changecategory |
71
    And I click on "Get the overview" "button"
72
    Then I should see "Student" in the "comparisontable" "table"
73
    And I should see "Studentdf" in the "comparisontable" "table"
74
    And I should see "Teacher" in the "comparisontable" "table"
75
 
76
  Scenario: visualize all roles by selecting All option
77
    When I set the following fields to these values:
78
      | Capability: | moodle/course:changecategory |
79
      | Roles:      | All                          |
80
    And I click on "Get the overview" "button"
81
    Then I should see "Student" in the "comparisontable" "table"
82
    And I should see "Studentdf" in the "comparisontable" "table"
83
    And I should see "Teacher" in the "comparisontable" "table"
84
 
85
  @javascript
86
  Scenario: filter capability list using javascript
87
    Given I should see "moodle/site:config" in the "Capability" "field"
88
    And I should see "moodle/course:change" in the "Capability" "field"
89
    And I set the field "Search" in the "#capability-overview-form" "css_element" to "moodle/course:change"
90
    Then I should see "moodle/course:change" in the "Capability" "field"
91
    And I should not see "moodle/site:config" in the "Capability" "field"
92
 
93
  @javascript
94
  Scenario: selecting capabilities using filters
95
    Given I should see "moodle/course:change" in the "Capability" "field"
96
    And I set the field "Search" in the "#capability-overview-form" "css_element" to "moodle/course:change"
97
    And I wait "1" seconds
98
    When I set the following fields to these values:
99
      | Capability: | moodle/course:changecategory |
100
      | Roles:      | Student                      |
101
    And I click on "Get the overview" "button"
102
    Then I should see "moodle/course:changecategory" in the "comparisontable" "table"
103
    And the field "Capability:" matches value "moodle/course:changecategory"