Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 1... Línea 1...
1
@core @core_my
1
@core @core_my @block_myoverview
2
Feature: Run tests over my courses.
2
Feature: Run tests over my courses page
Línea 3... Línea 3...
3
 
3
 
4
  Background:
4
  Background:
5
    Given the following "users" exist:
5
    Given the following "users" exist:
6
      | username | firstname | lastname | email             |
6
      | username | firstname | lastname | email             |
Línea 15... Línea 15...
15
      | user  | role  | contextlevel | reference |
15
      | user  | role  | contextlevel | reference |
16
      | user1 | role1 | Category     | CatA      |
16
      | user1 | role1 | Category     | CatA      |
Línea 17... Línea 17...
17
 
17
 
18
  Scenario: Admin can add new courses or manage them from my courses
18
  Scenario: Admin can add new courses or manage them from my courses
19
    Given I am on the "My courses" page logged in as "admin"
19
    Given I am on the "My courses" page logged in as "admin"
20
    And I click on "Course management options" "link"
20
    And "Create course" "button" should not exist in the "page-header" "region"
21
    And I click on "New course" "link"
21
    And "Manage courses" "button" should not exist in the "page-header" "region"
22
    And I wait to be redirected
22
    When I click on "Create course" "button" in the "page-content" "region"
23
    Then I should see "Add a new course"
23
    Then I should see "Add a new course"
24
    And I am on the "My courses" page
24
    And I am on the "My courses" page
25
    And I click on "Course management options" "link"
-
 
26
    And I click on "Manage courses" "link"
25
    And I click on "Manage course categories" "button" in the "page-content" "region"
-
 
26
    And I should see "Manage course categories and courses"
-
 
27
    # Check that the expected buttons are displayed in the header when the user is enrolled in a course.
-
 
28
    But the following "course" exists:
-
 
29
      | fullname  | Course 1 |
-
 
30
      | shortname | C1       |
-
 
31
      | format    | topics   |
-
 
32
    And the following "course enrolment" exists:
-
 
33
      | user   | admin   |
-
 
34
      | course | C1      |
-
 
35
      | role   | student |
-
 
36
    And I am on the "My courses" page
-
 
37
    And "Create course" "button" should exist in the "page-header" "region"
-
 
38
    And "Manage courses" "button" should exist in the "page-header" "region"
-
 
39
    And "Create course" "button" should not exist in the "page-content" "region"
-
 
40
    And "Manage courses" "button" should not exist in the "page-content" "region"
Línea 27... Línea 41...
27
    And I should see "Manage course categories and courses"
41
    And "Manage course categories" "button" should not exist in the "page-content" "region"
28
 
42
 
29
  Scenario: User without creating a course and managing category permissions cannot see any link
43
  Scenario: User without creating a course and managing category permissions cannot see any link
-
 
44
    When I am on the "My courses" page logged in as "user1"
-
 
45
    Then "Create course" "button" should not exist
-
 
46
    And "Manage courses" "button" should not exist
-
 
47
    And "Manage course categories" "button" should not exist
-
 
48
    # Check that the same buttons are displayed in the header when the user is enrolled in a course.
-
 
49
    But the following "course" exists:
-
 
50
      | fullname  | Course 1 |
-
 
51
      | shortname | C1       |
-
 
52
      | format    | topics   |
-
 
53
    And the following "course enrolment" exists:
-
 
54
      | user   | user1   |
-
 
55
      | course | C1      |
-
 
56
      | role   | student |
-
 
57
    And I am on the "My courses" page
-
 
58
    And "Create course" "button" should not exist
Línea 30... Línea 59...
30
    Given I am on the "My courses" page logged in as "user1"
59
    And "Manage courses" "button" should not exist
31
    Then "Course management options" "link" should not exist
60
    And "Manage course categories" "button" should not exist
32
 
61
 
33
  Scenario: User without capability to browse courses cannot see any link
62
  Scenario: User without capability to browse courses cannot see any link
34
    Given the following "permission overrides" exist:
63
    Given the following "permission overrides" exist:
35
      | capability                     | permission | role | contextlevel | reference |
64
      | capability                     | permission | role | contextlevel | reference |
-
 
65
      | moodle/category:viewcourselist | Prevent    | user | System       |           |
-
 
66
    When I am on the "My courses" page logged in as "user1"
-
 
67
    Then "Create course" "button" should not exist
-
 
68
    And "Manage courses" "button" should not exist
-
 
69
    And "Manage course categories" "button" should not exist
-
 
70
    # Check that the same buttons are displayed in the header when the user is enrolled in a course.
-
 
71
    But the following "course" exists:
-
 
72
      | fullname  | Course 1 |
-
 
73
      | shortname | C1       |
-
 
74
      | format    | topics   |
-
 
75
    And the following "course enrolment" exists:
-
 
76
      | user   | user1   |
-
 
77
      | course | C1      |
-
 
78
      | role   | student |
-
 
79
    And I am on the "My courses" page
Línea 36... Línea 80...
36
      | moodle/category:viewcourselist | Prevent    | user | System       |           |
80
    And "Create course" "button" should not exist
37
    Given I am on the "My courses" page logged in as "user1"
81
    And "Manage courses" "button" should not exist
38
    Then "Course management options" "link" should not exist
82
    And "Manage course categories" "button" should not exist
39
 
83
 
40
  @javascript
84
  @javascript
41
  Scenario: User with creating a course permission can see the Create course link only
85
  Scenario: User with creating a course permission can see the Create course link only
42
    Given the following "permission overrides" exist:
86
    Given the following "permission overrides" exist:
43
      | capability           | permission | role  | contextlevel | reference |
87
      | capability           | permission | role  | contextlevel | reference |
44
      | moodle/course:create | Allow      | role1 | Category     | cata      |
-
 
45
    When I am on the "My courses" page logged in as "user1"
88
      | moodle/course:create | Allow      | role1 | Category     | cata      |
46
    Then "Course management options" "link" should exist
89
    When I am on the "My courses" page logged in as "user1"
47
    And I click on "Course management options" "link"
-
 
48
    And I should see "New course"
90
    Then "Create course" "button" should exist in the "page-content" "region"
49
    And I should not see "Manage courses"
91
    But "Manage course categories" "button" should not exist
-
 
92
    And "Create course" "button" should not exist in the "page-header" "region"
-
 
93
    And I click on "Create course" "button"
-
 
94
    And I should see "Add a new course"
-
 
95
    And "CatA" "autocomplete_selection" should exist
-
 
96
    # Check that the same buttons are displayed in the header when the user is enrolled in a course.
-
 
97
    But the following "course" exists:
-
 
98
      | fullname  | Course 1 |
-
 
99
      | shortname | C1       |
-
 
100
      | format    | topics   |
-
 
101
    And the following "course enrolment" exists:
-
 
102
      | user   | user1   |
-
 
103
      | course | C1      |
-
 
104
      | role   | student |
Línea 50... Línea -...
50
    And I click on "New course" "link"
-
 
51
    And I wait to be redirected
105
    And I am on the "My courses" page
52
    And I should see "Add a new course"
106
    And "Create course" "button" should exist in the "page-header" "region"
53
    And "CatA" "autocomplete_selection" should exist
107
    And "Manage courses" "button" should not exist
54
 
108
    And "Create course" "button" should not exist in the "page-content" "region"
55
  @javascript
109
 
56
  Scenario: User with managing a category permission can see the Manage course link only
110
  Scenario: User with managing a category permission can see the Manage course link only
57
    Given the following "permission overrides" exist:
111
    Given the following "permission overrides" exist:
58
      | capability             | permission | role  | contextlevel | reference |
-
 
59
      | moodle/category:manage | Allow      | role1 | Category     | cata      |
-
 
60
    When I am on the "My courses" page logged in as "user1"
112
      | capability             | permission | role  | contextlevel | reference |
61
    Then "Course management options" "link" should exist
-
 
62
    And I click on "Course management options" "link"
113
      | moodle/category:manage | Allow      | role1 | Category     | cata      |
-
 
114
    When I am on the "My courses" page logged in as "user1"
-
 
115
    Then "Manage course categories" "button" should exist in the "page-content" "region"
-
 
116
    And "Create course" "button" should not exist
-
 
117
    And I click on "Manage course categories" "button" in the "page-content" "region"
-
 
118
    And I should see "Manage course categories and courses"
-
 
119
    # Check that the same buttons are displayed in the header when the user is enrolled in a course.
-
 
120
    But the following "course" exists:
-
 
121
      | fullname  | Course 1 |
-
 
122
      | shortname | C1       |
-
 
123
      | format    | topics   |
-
 
124
    And the following "course enrolment" exists:
-
 
125
      | user   | user1   |
-
 
126
      | course | C1      |
Línea 63... Línea 127...
63
    And I should not see "New course"
127
      | role   | student |
64
    And I should see "Manage courses"
128
    And I am on the "My courses" page
65
    And I click on "Manage courses" "link"
129
    And "Manage courses" "button" should exist in the "page-header" "region"
66
    And I wait to be redirected
130
    And "Create course" "button" should not exist
67
    And I should see "Manage course categories and courses"
131
    And "Manage courses" "button" should not exist in the "page-content" "region"
68
 
132
 
69
  @javascript
133
  @javascript
70
  Scenario: User with both creating a course and managing a category permission can see both links
134
  Scenario: User with both creating a course and managing a category permission can see both links
71
    Given the following "permission overrides" exist:
135
    Given the following "permission overrides" exist:
72
      | capability             | permission | role  | contextlevel | reference |
136
      | capability             | permission | role  | contextlevel | reference |
73
      | moodle/course:create   | Allow      | role1 | Category     | cata      |
137
      | moodle/course:create   | Allow      | role1 | Category     | cata      |
74
      | moodle/category:manage | Allow      | role1 | Category     | cata      |
138
      | moodle/category:manage | Allow      | role1 | Category     | cata      |
75
    When I am on the "My courses" page logged in as "user1"
-
 
76
    Then "Course management options" "link" should exist
139
    When I am on the "My courses" page logged in as "user1"
77
    And I click on "Course management options" "link"
140
    Then "Create course" "button" should exist in the "page-content" "region"
78
    And I should see "New course"
141
    And "Manage course categories" "button" should exist in the "page-content" "region"
79
    And I should see "Manage courses"
-
 
80
    And I click on "New course" "link"
142
    And "Create course" "button" should not exist in the "page-header" "region"
81
    And I wait to be redirected
-
 
82
    And I should see "Add a new course"
143
    And "Manage courses" "button" should not exist in the "page-header" "region"
-
 
144
    And I click on "Create course" "button"
-
 
145
    And I should see "Add a new course"
-
 
146
    And "CatA" "autocomplete_selection" should exist
-
 
147
    And I am on the "My courses" page
-
 
148
    And I click on "Manage course categories" "button"
-
 
149
    And I should see "Manage course categories and courses"
-
 
150
    # Check that the same buttons are displayed in the header when the user is enrolled in a course.
-
 
151
    But the following "course" exists:
-
 
152
      | fullname  | Course 1 |
-
 
153
      | shortname | C1       |
-
 
154
      | format    | topics   |
-
 
155
    And the following "course enrolment" exists:
-
 
156
      | user   | user1   |
-
 
157
      | course | C1      |
Línea 83... Línea 158...
83
    And "CatA" "autocomplete_selection" should exist
158
      | role   | student |
84
    And I am on the "My courses" page
159
    And I am on the "My courses" page
85
    And I click on "Course management options" "link"
160
    And "Create course" "button" should exist in the "page-header" "region"
86
    And I click on "Manage courses" "link"
161
    And "Manage courses" "button" should exist in the "page-header" "region"
Línea 107... Línea 182...
107
    Then "Course overview" "text" should exist in the "region-main" "region"
182
    Then "Course overview" "text" should exist in the "region-main" "region"
108
    And I should not see "Add a block"
183
    And I should not see "Add a block"
109
    And I should see "This is visible on all pages"
184
    And I should see "This is visible on all pages"
110
    And "Move Text on all pages block" "menuitem" should not exist in the "Text on all pages" "block"
185
    And "Move Text on all pages block" "menuitem" should not exist in the "Text on all pages" "block"
111
    And "Move Course overview block" "menuitem" should not exist in the "Course overview" "block"
186
    And "Move Course overview block" "menuitem" should not exist in the "Course overview" "block"
112
    And I click on "Actions menu" "icon" in the "Course overview" "block"
187
    And "Actions menu" "icon" in the "Course overview" "block" should not be visible
113
    And I should not see "Delete Course overview block"
-
 
Línea 114... Línea -...
114
 
-
 
115
  @javascript
188
 
116
  Scenario: User with creating a course permission can't see the Request course link
189
  Scenario: User with creating a course permission can't see the Request course link
117
    Given the following "permission overrides" exist:
190
    Given the following "permission overrides" exist:
118
      | capability            | permission | role  | contextlevel | reference |
191
      | capability            | permission | role  | contextlevel | reference |
119
      | moodle/course:request | Allow      | user  | System       |           |
192
      | moodle/course:request | Allow      | user  | System       |           |
-
 
193
    When I am on the "My courses" page logged in as "admin"
-
 
194
    Then "Create course" "button" should exist in the "page-content" "region"
-
 
195
    And "Request a course" "button" should not exist
-
 
196
    And "Create course" "button" should not exist in the "page-header" "region"
-
 
197
    # Check that the same buttons are displayed in the header when the user is enrolled in a course.
-
 
198
    But the following "course" exists:
-
 
199
      | fullname  | Course 1 |
-
 
200
      | shortname | C1       |
120
    When I am on the "My courses" page logged in as "admin"
201
      | format    | topics   |
-
 
202
    And the following "course enrolment" exists:
-
 
203
      | user   | admin   |
-
 
204
      | course | C1      |
121
    And I click on "Course management options" "link"
205
      | role   | student |
-
 
206
    And I am on the "My courses" page
122
    And I should see "New course"
207
    And "Create course" "button" should exist in the "page-header" "region"
-
 
208
    And "Request a course" "button" should not exist
Línea 123... Línea -...
123
    Then I should not see "Request a course"
-
 
124
 
209
    And "Create course" "button" should not exist in the "page-content" "region"
125
  @javascript
210
 
126
  Scenario: User without creating a course but with course request permission could see the Request course link
211
  Scenario: User without creating a course but with course request permission could see the Request course link
127
    Given the following "permission overrides" exist:
212
    Given the following "permission overrides" exist:
128
      | capability            | permission | role  | contextlevel | reference |
213
      | capability            | permission | role  | contextlevel | reference |
-
 
214
      | moodle/course:request | Allow      | user  | System       |           |
129
      | moodle/course:request | Allow      | user  | System       |           |
215
    When I am on the "My courses" page logged in as "user1"
130
    When I am on the "My courses" page logged in as "user1"
216
    Then "Request a course" "button" should exist in the "page-content" "region"
131
    And I click on "Course management options" "link"
217
    And "Create course" "button" should not exist in the "page-content" "region"
-
 
218
    And "Create course" "button" should not exist in the "page-header" "region"
132
    And I should not see "New course"
219
    And "Request a course" "button" should not exist in the "page-header" "region"
133
    Then I should see "Request a course"
220
    # Check the request a course button is not displayed when this feature is disabled.
134
    And the following config values are set as admin:
221
    And the following config values are set as admin:
-
 
222
      | enablecourserequests | 0 |
-
 
223
    And I am on the "My courses" page logged in as "user1"
-
 
224
    And "Request a course" "button" should not exist
-
 
225
    # Check that the same buttons are displayed in the header when the user is enrolled in a course.
-
 
226
    But the following "course" exists:
-
 
227
      | fullname  | Course 1 |
-
 
228
      | shortname | C1       |
-
 
229
      | format    | topics   |
-
 
230
    And the following "course enrolment" exists:
-
 
231
      | user   | user1   |
-
 
232
      | course | C1      |
-
 
233
      | role   | student |
-
 
234
    And the following config values are set as admin:
-
 
235
      | enablecourserequests | 1 |
135
      | enablecourserequests | 0 |
236
    And I am on the "My courses" page
-
 
237
    And "Request a course" "button" should exist in the "page-header" "region"
Línea 136... Línea 238...
136
    And I am on the "My courses" page logged in as "user1"
238
    And "Create course" "button" should not exist
137
    And "Course management options" "link" should not exist
239
    And "Request a course" "button" should not exist in the "page-content" "region"
-
 
240
 
-
 
241
  Scenario: User without creating nor course request permission shouldn't see any Request course link
-
 
242
    Given I am on the "My courses" page logged in as "user1"
-
 
243
    Then "Request a course" "button" should not exist in the "page-content" "region"
-
 
244
    And "Create course" "button" should not exist in the "page-content" "region"
-
 
245
    And "Manage courses" "button" should not exist in the "page-content" "region"
-
 
246
    # Check that the same buttons are displayed in the header when the user is enrolled in a course.
-
 
247
    But the following "course" exists:
-
 
248
      | fullname  | Course 1 |
-
 
249
      | shortname | C1       |
-
 
250
      | format    | topics   |
-
 
251
    And the following "course enrolment" exists:
-
 
252
      | user   | user1   |
-
 
253
      | course | C1      |
-
 
254
      | role   | student |
138
 
255
    And I am on the "My courses" page