Proyectos de Subversion Moodle

Rev

Rev 1 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@core @core_course @javascript
2
Feature: Display and choose from the available activities in course
3
  In order to add activities to a course
4
  As a teacher
5
  I should be enabled to choose from a list of available activities and also being able to read their summaries.
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname | email |
10
      | teacher | Teacher | 1 | teacher@example.com |
11
    And the following "courses" exist:
12
      | fullname | shortname | format | startdate |
13
      | Course   | C         | topics |           |
14
      | Course 2 | C2        | weeks  | 95713920  |
15
    And the following "course enrolments" exist:
16
      | user    | course | role           |
17
      | teacher | C      | editingteacher |
18
      | teacher | C2     | editingteacher |
19
    And the following config values are set as admin:
20
      | enablemoodlenet | 0 | tool_moodlenet |
21
    And I log in as "teacher"
22
    And I am on "Course" course homepage with editing mode on
23
 
24
  Scenario: The available activities are displayed to the teacher in the activity chooser
1441 ariadna 25
    Given I open the activity chooser
1 efrain 26
    Then I should see "Add an activity or resource" in the ".modal-title" "css_element"
27
    And I should see "Assignment" in the ".modal-body" "css_element"
28
 
29
  Scenario: The teacher can choose to add an activity from the activity items in the activity chooser
1441 ariadna 30
    Given I open the activity chooser
1 efrain 31
    When I click on "Add a new Assignment" "link" in the "Add an activity or resource" "dialogue"
32
    Then I should see "New Assignment"
33
    And I set the following fields to these values:
34
      | Assignment name | Test Assignment |
35
    And I press "Save and return to course"
1441 ariadna 36
    Then I should see "Test Assignment" in the "General" "section"
1 efrain 37
 
38
  Scenario: The teacher can choose to add an activity from the activity summary in the activity chooser
1441 ariadna 39
    Given I open the activity chooser
1 efrain 40
    When I click on "Information about the Assignment activity" "button" in the "Add an activity or resource" "dialogue"
41
    When I click on "Add a new Assignment" "link" in the "help" "core_course > Activity chooser screen"
42
    Then I should see "New Assignment"
43
 
44
  Scenario: Show summary
1441 ariadna 45
    Given I open the activity chooser
1 efrain 46
    When I click on "Information about the Assignment activity" "button" in the "Add an activity or resource" "dialogue"
47
    Then I should see "Assignment" in the "help" "core_course > Activity chooser screen"
48
    And I should see "The assignment activity module enables a teacher to communicate tasks, collect work and provide grades and feedback."
49
    # Confirm show summary also works for weekly format course
50
    And I am on "C2" course homepage with editing mode on
1441 ariadna 51
    And I click on "Add content" "button" in the "13 January - 19 January" "section"
52
    And I click on "Activity or resource" "button" in the "13 January - 19 January" "section"
1 efrain 53
    And I click on "Information about the Assignment activity" "button" in the "Add an activity or resource" "dialogue"
54
    And I should see "Assignment" in the "help" "core_course > Activity chooser screen"
55
    And I should see "The assignment activity module enables a teacher to communicate tasks, collect work and provide grades and feedback."
56
 
57
  Scenario: Hide summary
1441 ariadna 58
    Given I open the activity chooser
1 efrain 59
    When I click on "Information about the Assignment activity" "button" in the "modules" "core_course > Activity chooser screen"
60
    And I should see "The assignment activity module enables a teacher to communicate tasks, collect work and provide grades and feedback." in the "help" "core_course > Activity chooser screen"
61
    And I should see "Back" in the "help" "core_course > Activity chooser screen"
62
    When I click on "Back" "button" in the "help" "core_course > Activity chooser screen"
63
    Then "modules" "core_course > Activity chooser screen" should be visible
64
    And "help" "core_course > Activity chooser screen" should not be visible
65
    And "Back" "button" should not exist in the "modules" "core_course > Activity chooser screen"
66
    And I should not see "The assignment activity module enables a teacher to communicate tasks, collect work and provide grades and feedback." in the "Add an activity or resource" "dialogue"
67
    # Confirm hide summary also works for weekly format course
68
    And I am on "C2" course homepage with editing mode on
1441 ariadna 69
    And I click on "Add content" "button" in the "13 January - 19 January" "section"
70
    And I click on "Activity or resource" "button" in the "13 January - 19 January" "section"
1 efrain 71
    And I click on "Information about the Assignment activity" "button" in the "Add an activity or resource" "dialogue"
72
    And I click on "Back" "button" in the "help" "core_course > Activity chooser screen"
73
    And "modules" "core_course > Activity chooser screen" should be visible
74
    And "help" "core_course > Activity chooser screen" should not be visible
75
    And "Back" "button" should not exist in the "modules" "core_course > Activity chooser screen"
76
    And I should not see "The assignment activity module enables a teacher to communicate tasks, collect work and provide grades and feedback." in the "Add an activity or resource" "dialogue"
77
 
78
  Scenario: View recommended activities
79
    When I log out
80
    And I log in as "admin"
81
    And I am on site homepage
82
    And I navigate to "Courses > Activity chooser > Recommended activities" in site administration
83
    And I click on ".activity-recommend-checkbox" "css_element" in the "Book" "table_row"
84
    # Setup done, lets check it works with a teacher.
85
    And I log out
86
    And I log in as "teacher"
87
    And I am on "Course" course homepage with editing mode on
88
    And I open the activity chooser
89
    Then I should see "Recommended" in the "Add an activity or resource" "dialogue"
90
    And I click on "Recommended" "link" in the "Add an activity or resource" "dialogue"
91
    And I should see "Book" in the "recommended" "core_course > Activity chooser tab"
92
 
93
  Scenario: Favourite a module in the activity chooser
94
    Given I open the activity chooser
95
    And I should not see "Starred" in the "Add an activity or resource" "dialogue"
96
    And I click on "Star Assignment activity" "button" in the "Add an activity or resource" "dialogue"
97
    And I should see "Starred" in the "Add an activity or resource" "dialogue"
98
    When I click on "Starred" "link" in the "Add an activity or resource" "dialogue"
99
    Then I should see "Assignment" in the "favourites" "core_course > Activity chooser tab"
100
    And I click on "Information about the Assignment activity" "button" in the "favourites" "core_course > Activity chooser tab"
101
    And I should see "The assignment activity module enables a teacher to communicate tasks, collect work and provide grades and feedback."
102
 
103
  Scenario: Add a favourite module and check it exists when reopening the chooser
104
    Given I open the activity chooser
105
    And I click on "Star Assignment activity" "button" in the "Add an activity or resource" "dialogue"
106
    And I click on "Star Forum activity" "button" in the "Add an activity or resource" "dialogue"
107
    And I should see "Starred" in the "Add an activity or resource" "dialogue"
108
    And I click on "Close" "button" in the "Add an activity or resource" "dialogue"
1441 ariadna 109
    And I click on "Add content" "button" in the "New section" "section"
110
    And I click on "Activity or resource" "button" in the "New section" "section"
1 efrain 111
    And I click on "Starred" "link" in the "Add an activity or resource" "dialogue"
112
    Then I should see "Forum" in the "favourites" "core_course > Activity chooser tab"
113
 
114
  Scenario: Add a favourite and then remove it whilst checking the tabs work as expected
115
    Given I open the activity chooser
116
    And I click on "Star Assignment activity" "button" in the "Add an activity or resource" "dialogue"
117
    And I click on "Starred" "link" in the "Add an activity or resource" "dialogue"
118
    And I click on "Star Assignment activity" "button" in the "Add an activity or resource" "dialogue"
119
    Then I should not see "Starred" in the "Add an activity or resource" "dialogue"
120
 
121
  Scenario: The teacher can search for an activity by it's name
1441 ariadna 122
    Given I open the activity chooser
1 efrain 123
    When I set the field "search" to "Lesson"
124
    Then I should see "1 results found" in the "Add an activity or resource" "dialogue"
125
    And I should see "Lesson" in the "Add an activity or resource" "dialogue"
126
 
127
  Scenario: The teacher can search for an activity by it's description
128
    Given I open the activity chooser
129
    When I set the field "search" to "The lesson activity module enables a teacher to deliver content"
130
    Then I should see "1 results found" in the "Add an activity or resource" "dialogue"
131
    And I should see "Lesson" in the "Add an activity or resource" "dialogue"
132
 
133
  Scenario: Search results are not returned if the search query does not match any activity name or description
1441 ariadna 134
    Given I open the activity chooser
1 efrain 135
    When I set the field "search" to "Random search query"
136
    Then I should see "0 results found" in the "Add an activity or resource" "dialogue"
137
    And ".option" "css_element" should not exist in the ".searchresultitemscontainer" "css_element"
138
 
139
  Scenario: Teacher can return to the default activity chooser state by manually removing the search query
1441 ariadna 140
    Given I open the activity chooser
1 efrain 141
    And I set the field "search" to "Lesson"
142
    And I should see "1 results found" in the "Add an activity or resource" "dialogue"
143
    And I should see "Lesson" in the "Add an activity or resource" "dialogue"
144
    When I set the field "search" to ""
145
    And I should not see "1 results found" in the "Add an activity or resource" "dialogue"
146
    Then ".searchresultscontainer" "css_element" should not be visible
147
    And ".optionscontainer" "css_element" should exist
148
 
149
  Scenario: Teacher can not see a "clear" button if a search query is not entered in the activity chooser search bar
1441 ariadna 150
    When I open the activity chooser
1 efrain 151
    Then "Clear search input" "button" should not be visible
152
 
153
  Scenario: Teacher can see a "clear" button after entering a search query in the activity chooser search bar
1441 ariadna 154
    Given I open the activity chooser
1 efrain 155
    When I set the field "search" to "Search query"
156
    Then "Clear search input" "button" should not be visible
157
 
158
  Scenario: Teacher can not see a "clear" button if the search query is removed in the activity chooser search bar
1441 ariadna 159
    Given I open the activity chooser
1 efrain 160
    And I set the field "search" to "Search query"
161
    And "Clear search input" "button" should exist
162
    When I set the field "search" to ""
163
    # Waiting for the animation to hide the button to finish.
164
    And I wait "1" seconds
165
    Then "Clear search input" "button" should not be visible
166
 
167
  Scenario: Teacher can instantly remove the search query from the activity search bar by clicking on the "clear" button
1441 ariadna 168
    Given I open the activity chooser
1 efrain 169
    And I set the field "search" to "Search query"
170
    And I should see "results found" in the "Add an activity or resource" "dialogue"
171
    When I click on "Clear search input" "button"
172
    Then I should not see "Search query"
173
    And ".searchresultscontainer" "css_element" should not be visible
174
    And ".optionscontainer" "css_element" should exist
175
 
176
  Scenario: Teacher gets the base case for the Activity Chooser tab mode
1441 ariadna 177
    Given I open the activity chooser
1 efrain 178
    And I should see "Activities" in the "Add an activity or resource" "dialogue"
179
    When I click on "Activities" "link" in the "Add an activity or resource" "dialogue"
180
    Then I should not see "Book" in the "activity" "core_course > Activity chooser tab"
181
    And I click on "Resources" "link" in the "Add an activity or resource" "dialogue"
182
    And I should not see "Assignment" in the "resources" "core_course > Activity chooser tab"
183
 
184
  Scenario: Teacher gets the simple case for the Activity Chooser tab mode
185
    Given I log out
186
    And I log in as "admin"
187
    And I am on site homepage
188
    When I navigate to "Courses > Activity chooser > Activity chooser settings" in site administration
189
    And I select "Starred, All, Recommended" from the "Activity chooser tabs" singleselect
190
    And I press "Save changes"
191
    And I log out
192
    And I log in as "teacher"
193
    And I am on "Course" course homepage with editing mode on
1441 ariadna 194
    And I open the activity chooser
1 efrain 195
    Then I should not see "Activities" in the "Add an activity or resource" "dialogue"
196
    And I should not see "Resources" in the "Add an activity or resource" "dialogue"
197
 
198
  Scenario: Teacher gets the final case for the Activity Chooser tab mode
199
    Given I log out
200
    And I log in as "admin"
201
    And I am on site homepage
202
    When I navigate to "Courses > Activity chooser > Activity chooser settings" in site administration
203
    And I select "Starred, Activities, Resources, Recommended" from the "Activity chooser tabs" singleselect
204
    And I press "Save changes"
205
    And I log out
206
    And I log in as "teacher"
207
    And I am on "Course" course homepage with editing mode on
1441 ariadna 208
    And I open the activity chooser
1 efrain 209
    Then I should not see "All" in the "Add an activity or resource" "dialogue"
210
    And I should see "Activities" in the "Add an activity or resource" "dialogue"
211
    And I should see "Resources" in the "Add an activity or resource" "dialogue"
212
 
213
  Scenario: Recommended tab is displayed in the right position depending on the activitychoosertabmode setting
214
    Given I log out
215
    And I log in as "admin"
216
    And I navigate to "Courses > Activity chooser > Recommended activities" in site administration
217
    And I click on ".activity-recommend-checkbox" "css_element" in the "Book" "table_row"
218
    And the following config values are set as admin:
219
      # 3 = Starred, Recommended, All, Activities, Resources
220
      | activitychoosertabmode | 3 |
221
    And I log out
222
    And I log in as "teacher"
223
    And I am on "Course" course homepage with editing mode on
1441 ariadna 224
    When I open the activity chooser
1 efrain 225
    Then "Recommended" "link" should appear before "All" "link" in the "Add an activity or resource" "dialogue"
226
    But the following config values are set as admin:
227
      # 0 = Starred, All, Activities, Resources, Recommended
228
      | activitychoosertabmode | 0 |
229
    And I reload the page
1441 ariadna 230
    And I open the activity chooser
1 efrain 231
    And "Recommended" "link" should appear after "Resources" "link" in the "Add an activity or resource" "dialogue"
232
    But the following config values are set as admin:
233
      # 1 = Starred, All, Recommended
234
      | activitychoosertabmode | 1 |
235
    And I reload the page
1441 ariadna 236
    And I open the activity chooser
1 efrain 237
    And "Recommended" "link" should appear after "All" "link" in the "Add an activity or resource" "dialogue"
238
    But the following config values are set as admin:
239
      # 2 = Starred, Activities, Resources, Recommended
240
      | activitychoosertabmode | 2 |
241
    And I reload the page
1441 ariadna 242
    And I open the activity chooser
1 efrain 243
    And "Recommended" "link" should appear after "Resources" "link" in the "Add an activity or resource" "dialogue"
244
    But the following config values are set as admin:
245
      # 4 = Starred, Recommended, All
246
      | activitychoosertabmode | 4 |
247
    And I reload the page
1441 ariadna 248
    And I open the activity chooser
1 efrain 249
    And "Recommended" "link" should appear before "All" "link" in the "Add an activity or resource" "dialogue"
250
    But the following config values are set as admin:
251
      # 5 = Starred, Recommended, Activities, Resources
252
      | activitychoosertabmode | 5 |
253
    And I reload the page
1441 ariadna 254
    And I open the activity chooser
1 efrain 255
    And "Recommended" "link" should appear before "Activities" "link" in the "Add an activity or resource" "dialogue"
256
 
257
  Scenario: Teacher can navigate through activity chooser in Topics format course
1441 ariadna 258
    When I open the activity chooser
1 efrain 259
    Then I should see "All" in the "Add an activity or resource" "dialogue"
260
    And I press the tab key
261
    And I press the tab key
262
    And I press the tab key
263
    And I press the tab key
264
    # Confirm right key works
265
    And I press the right key
266
    And I press the right key
267
    And the focused element is "Choice" "menuitem" in the "Add an activity or resource" "dialogue"
268
    # Confirm left key works
269
    And I press the left key
270
    And the focused element is "Book" "menuitem" in the "Add an activity or resource" "dialogue"
271
    # Confirm clicking "x" button closes modal
272
    And I click on "Close" "button" in the "Add an activity or resource" "dialogue"
273
    And "Add an activity or resource" "dialogue" should not be visible
1441 ariadna 274
    And I open the activity chooser
1 efrain 275
    # Confirm escape key closes the modal
276
    And I press the escape key
277
    And "Add an activity or resource" "dialogue" should not be visible
278
 
279
  Scenario: Teacher can navigate through activity chooser in Weekly format course
280
    Given I am on "C2" course homepage with editing mode on
1441 ariadna 281
    And I click on "Add content" "button" in the "13 January - 19 January" "section"
282
    When I click on "Activity or resource" "button" in the "13 January - 19 January" "section"
1 efrain 283
    Then I should see "All" in the "Add an activity or resource" "dialogue"
284
    And I press the tab key
285
    And I press the tab key
286
    And I press the tab key
287
    And I press the tab key
288
    # Confirm right key works
289
    And I press the right key
290
    And I press the right key
291
    And the focused element is "Choice" "menuitem" in the "Add an activity or resource" "dialogue"
292
    # Confirm left key works
293
    And I press the left key
294
    And the focused element is "Book" "menuitem" in the "Add an activity or resource" "dialogue"
295
    # Confirm clicking "x" button closes modal
296
    And I click on "Close" "button" in the "Add an activity or resource" "dialogue"
297
    And "Add an activity or resource" "dialogue" should not be visible
1441 ariadna 298
    And I click on "Add content" "button" in the "13 January - 19 January" "section"
299
    And I click on "Activity or resource" "button" in the "13 January - 19 January" "section"
1 efrain 300
    # Confirm escape key closes the modal
301
    And I press the escape key
302
    And "Add an activity or resource" "dialogue" should not be visible
303
 
304
  Scenario: Teacher can access 'More help' from activity information in activity chooser
1441 ariadna 305
    Given I open the activity chooser
1 efrain 306
    When I click on "Information about the Assignment activity" "button" in the "Add an activity or resource" "dialogue"
307
    # Confirm more help link exists
308
    Then "More help" "link" should exist
309
    # Confirm that corresponding help icon exist
1441 ariadna 310
    And ".fa-book" "css_element" should exist
1 efrain 311
    # Confirm that link opens in new window
312
    And "Opens in new window" "link" should be visible
313
    # Confirm the same behaviour for weekly format course
314
    And I am on "C2" course homepage with editing mode on
1441 ariadna 315
    And I click on "Add content" "button" in the "13 January - 19 January" "section"
316
    And I click on "Activity or resource" "button" in the "13 January - 19 January" "section"
1 efrain 317
    And I should see "All" in the "Add an activity or resource" "dialogue"
318
    And I click on "Information about the Assignment activity" "button" in the "Add an activity or resource" "dialogue"
319
    # Confirm more help link exists
320
    And "More help" "link" should exist
321
    # Confirm that corresponding help icon exist
1441 ariadna 322
    And ".fa-book" "css_element" should exist
1 efrain 323
    # Confirm that link opens in new window
324
    And "Opens in new window" "link" should be visible