Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@core @core_course
2
Feature: Activity navigation
3
  In order to quickly switch between activities
4
  As a user
5
  I need to use the activity navigation controls in activities
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username  | firstname  | lastname  | email                 |
10
      | teacher1  | Teacher    | 1         | teacher1@example.com  |
11
      | student1  | Student    | 1         | student1@example.com  |
12
    And the following "courses" exist:
13
      | fullname | shortname | format |
14
      | Course 1 | C1        | topics |
15
      | Course 2 | C2        | topics |
16
    And the following "course enrolments" exist:
17
      | user      | course  | role            |
18
      | student1  | C1      | student         |
19
      | teacher1  | C1      | editingteacher  |
20
      | student1  | C2      | student         |
21
    And I enable "chat" "mod" plugin
22
    And I enable "survey" "mod" plugin
23
    And the following "activities" exist:
24
      | activity   | name         | intro                       | course | idnumber  | section |
25
      | assign     | Assignment 1 | Test assignment description | C1     | assign1   | 0       |
26
      | book       | Book 1       | Test book description       | C1     | book1     | 0       |
27
      | chat       | Chat 1       | Test chat description       | C1     | chat1     | 0       |
28
      | choice     | Choice 1     | Test choice description     | C1     | choice1   | 1       |
29
      | data       | Database 1   | Test database description   | C1     | data1     | 1       |
30
      | feedback   | Feedback 1   | Test feedback description   | C1     | feedback1 | 1       |
31
      | folder     | Folder 1     | Test folder description     | C1     | folder1   | 2       |
32
      | forum      | Forum 1      | Test forum description      | C1     | forum1    | 2       |
33
      | glossary   | Glossary 1   | Test glossary description   | C1     | glossary1 | 2       |
34
      | imscp      | Imscp 1      | Test imscp description      | C1     | imscp1    | 3       |
35
      | label      | Label 1      | Test label description      | C1     | label1    | 3       |
36
      | lesson     | Lesson 1     | Test lesson description     | C1     | lesson1   | 3       |
37
      | lti        | Lti 1        | Test lti description        | C1     | lti1      | 4       |
38
      | page       | Page 1       | Test page description       | C1     | page1     | 4       |
39
      | quiz       | Quiz 1       | Test quiz description       | C1     | quiz1     | 4       |
40
      | resource   | Resource 1   | Test resource description   | C1     | resource1 | 5       |
41
      | scorm      | Scorm 1      | Test scorm description      | C1     | scorm1    | 5       |
42
      | survey     | Survey 1     | Test survey description     | C1     | survey1   | 5       |
43
      | url        | Url 1        | Test url description        | C1     | url1      | 6       |
44
      | wiki       | Wiki 1       | Test wiki description       | C1     | wiki1     | 6       |
45
      | workshop   | Workshop 1   | Test workshop description   | C1     | workshop1 | 6       |
46
      | assign     | Assignment 1 | Test assignment description | C2     | assign21  | 0       |
47
    And the following config values are set as admin:
48
      | allowstealth | 1 |
49
    And I log in as "teacher1"
50
    And I am on "Course 1" course homepage with editing mode on
51
    # Stealth activity.
52
    And I click on "Hide" "link" in the "Forum 1" activity
53
    And I click on "Make available" "link" in the "Forum 1" activity
54
    # Hidden activity.
55
    And I click on "Hide" "link" in the "Glossary 1" activity
56
    # Hidden section.
57
    And I am on "Course 1" course homepage
58
    And I hide section "5"
59
    # Set up book.
60
    And I follow "Book 1"
61
    And I should see "Add new chapter"
62
    And I set the following fields to these values:
63
      | Chapter title | Chapter 1                             |
64
      | Content       | In the beginning... blah, blah, blah. |
65
    And I press "Save changes"
66
    And I log out
67
 
68
  Scenario: Step through activities in the course as a teacher.
69
    Given I log in as "teacher1"
70
    And I am on "Course 1" course homepage
71
    When I follow "Assignment 1"
72
    # The first activity won't have the previous activity link.
73
    Then "#prev-activity-link" "css_element" should not exist
74
    And I should see "Book 1" in the "#next-activity-link" "css_element"
75
    And I follow "Book 1"
76
    And I should see "Assignment" in the "#prev-activity-link" "css_element"
77
    And I should see "Chat 1" in the "#next-activity-link" "css_element"
78
    And I follow "Chat 1"
79
    And I should see "Book 1" in the "#prev-activity-link" "css_element"
80
    And I should see "Choice 1" in the "#next-activity-link" "css_element"
81
    And I follow "Choice 1"
82
    And I should see "Chat 1" in the "#prev-activity-link" "css_element"
83
    And I should see "Database 1" in the "#next-activity-link" "css_element"
84
    And I follow "Database 1"
85
    And I should see "Choice 1" in the "#prev-activity-link" "css_element"
86
    And I should see "Feedback 1" in the "#next-activity-link" "css_element"
87
    And I follow "Feedback 1"
88
    And I should see "Database 1" in the "#prev-activity-link" "css_element"
89
    # The next link will be Folder 1 because Forum 1 is in stealth mode.
90
    And I should see "Folder 1" in the "#next-activity-link" "css_element"
91
    And I follow "Folder 1"
92
    And I should see "Feedback 1" in the "#prev-activity-link" "css_element"
93
    # Hidden activity will have a '(hidden)' text within the activity link.
94
    And I should see "Glossary 1 (hidden)" in the "#next-activity-link" "css_element"
95
    And I follow "Glossary 1 (hidden)"
96
    And I should see "Folder 1" in the "#prev-activity-link" "css_element"
97
    And I should see "Imscp 1" in the "#next-activity-link" "css_element"
98
    And I follow "Imscp 1"
99
    And I should see "Glossary 1" in the "#prev-activity-link" "css_element"
100
    # The next link will be Lesson 1 because Label 1 doesn't have a view URL.
101
    And I should see "Lesson 1" in the "#next-activity-link" "css_element"
102
    And I follow "Lesson 1"
103
    And I should see "Imscp 1" in the "#prev-activity-link" "css_element"
104
    And I should see "Lti 1" in the "#next-activity-link" "css_element"
105
    And I follow "Lti 1"
106
    And I should see "Lesson 1" in the "#prev-activity-link" "css_element"
107
    And I should see "Page 1" in the "#next-activity-link" "css_element"
108
    And I follow "Page 1"
109
    And I should see "Lti 1" in the "#prev-activity-link" "css_element"
110
    And I should see "Quiz 1" in the "#next-activity-link" "css_element"
111
    And I follow "Quiz 1"
112
    And I should see "Page 1" in the "#prev-activity-link" "css_element"
113
    # Hidden sections will have the activities render with the '(hidden)' text.
114
    And I should see "Resource 1 (hidden)" in the "#next-activity-link" "css_element"
115
    And I follow "Resource 1 (hidden)"
116
    And I should see "Quiz 1" in the "#prev-activity-link" "css_element"
117
    And I should see "Scorm 1 (hidden)" in the "#next-activity-link" "css_element"
118
    And I follow "Scorm 1 (hidden)"
119
    And I should see "Resource 1 (hidden)" in the "#prev-activity-link" "css_element"
120
    And I should see "Survey 1 (hidden)" in the "#next-activity-link" "css_element"
121
    And I follow "Survey 1 (hidden)"
122
    And I should see "Scorm 1 (hidden)" in the "#prev-activity-link" "css_element"
123
    And I should see "Url 1" in the "#next-activity-link" "css_element"
124
    And I follow "Url 1"
125
    And I should see "Survey 1 (hidden)" in the "#prev-activity-link" "css_element"
126
    And I should see "Wiki 1" in the "#next-activity-link" "css_element"
127
    And I follow "Wiki 1"
128
    And I should see "Url 1" in the "#prev-activity-link" "css_element"
129
    And I should see "Workshop 1" in the "#next-activity-link" "css_element"
130
    And I follow "Workshop 1"
131
    And I should see "Wiki 1" in the "#prev-activity-link" "css_element"
132
    # The last activity won't have the next activity link.
133
    And "#next-activity-link" "css_element" should not exist
134
 
135
  Scenario: Step through activities in the course as a student.
136
    Given I log in as "student1"
137
    And I am on "Course 1" course homepage
138
    When I follow "Assignment 1"
139
    # The first activity won't have the previous activity link.
140
    Then "#prev-activity-link" "css_element" should not exist
141
    And I should see "Book 1" in the "#next-activity-link" "css_element"
142
    And I follow "Book 1"
143
    And I should see "Assignment" in the "#prev-activity-link" "css_element"
144
    And I should see "Chat 1" in the "#next-activity-link" "css_element"
145
    And I follow "Chat 1"
146
    And I should see "Book 1" in the "#prev-activity-link" "css_element"
147
    And I should see "Choice 1" in the "#next-activity-link" "css_element"
148
    And I follow "Choice 1"
149
    And I should see "Chat 1" in the "#prev-activity-link" "css_element"
150
    And I should see "Database 1" in the "#next-activity-link" "css_element"
151
    And I follow "Database 1"
152
    And I should see "Choice 1" in the "#prev-activity-link" "css_element"
153
    And I should see "Feedback 1" in the "#next-activity-link" "css_element"
154
    And I follow "Feedback 1"
155
    And I should see "Database 1" in the "#prev-activity-link" "css_element"
156
    # The next link will be Folder 1 because Forum 1 is in stealth mode.
157
    And I should see "Folder 1" in the "#next-activity-link" "css_element"
158
    And I follow "Folder 1"
159
    And I should see "Feedback 1" in the "#prev-activity-link" "css_element"
160
    # The next link will be Imscp 1 because hidden activities are not shown to students.
161
    And I should see "Imscp 1" in the "#next-activity-link" "css_element"
162
    And I follow "Imscp 1"
163
    And I should see "Folder 1" in the "#prev-activity-link" "css_element"
164
    # The next link will be Lesson 1 because Label 1 doesn't have a view URL.
165
    And I should see "Lesson 1" in the "#next-activity-link" "css_element"
166
    And I follow "Lesson 1"
167
    And I should see "Imscp 1" in the "#prev-activity-link" "css_element"
168
    And I should see "Lti 1" in the "#next-activity-link" "css_element"
169
    And I follow "Lti 1"
170
    And I should see "Lesson 1" in the "#prev-activity-link" "css_element"
171
    And I should see "Page 1" in the "#next-activity-link" "css_element"
172
    And I follow "Page 1"
173
    And I should see "Lti 1" in the "#prev-activity-link" "css_element"
174
    And I should see "Quiz 1" in the "#next-activity-link" "css_element"
175
    And I follow "Quiz 1"
176
    And I should see "Page 1" in the "#prev-activity-link" "css_element"
177
    # Hidden sections will have the activities hidden so the links won't be available to students.
178
    And I should see "Url 1" in the "#next-activity-link" "css_element"
179
    And I follow "Url 1"
180
    And I should see "Quiz 1" in the "#prev-activity-link" "css_element"
181
    And I should see "Wiki 1" in the "#next-activity-link" "css_element"
182
    And I follow "Wiki 1"
183
    And I should see "Url 1" in the "#prev-activity-link" "css_element"
184
    And I should see "Workshop 1" in the "#next-activity-link" "css_element"
185
    And I follow "Workshop 1"
186
    And I should see "Wiki 1" in the "#prev-activity-link" "css_element"
187
    # The last activity won't have the next activity link.
188
    And "#next-activity-link" "css_element" should not exist
189
 
190
  Scenario: Jump to another activity as a teacher
191
    Given I log in as "teacher1"
192
    When I am on "Course 1" course homepage
193
    And I follow "Assignment 1"
194
    Then "Jump to..." "field" should exist
195
    # The current activity will not be listed.
196
    And the "Jump to..." select box should not contain "Assignment 1"
197
    # Stealth activities will not be listed.
198
    And the "Jump to..." select box should not contain "Forum 1"
199
    # Resources without view URL (e.g. labels) will not be listed.
200
    And the "Jump to..." select box should not contain "Label 1"
201
    # Check drop down menu contents.
202
    And the "Jump to..." select box should contain "Book 1"
203
    And the "Jump to..." select box should contain "Chat 1"
204
    And the "Jump to..." select box should contain "Choice 1"
205
    And the "Jump to..." select box should contain "Database 1"
206
    And the "Jump to..." select box should contain "Feedback 1"
207
    And the "Jump to..." select box should contain "Folder 1"
208
    And the "Jump to..." select box should contain "Imscp 1"
209
    And the "Jump to..." select box should contain "Lesson 1"
210
    And the "Jump to..." select box should contain "Lti 1"
211
    And the "Jump to..." select box should contain "Page 1"
212
    And the "Jump to..." select box should contain "Quiz 1"
213
    And the "Jump to..." select box should contain "Url 1"
214
    And the "Jump to..." select box should contain "Wiki 1"
215
    And the "Jump to..." select box should contain "Workshop 1"
216
    # Hidden activities will be rendered with a '(hidden)' text.
217
    And the "Jump to..." select box should contain "Glossary 1 (hidden)"
218
    # Activities in hidden sections will be rendered with a '(hidden)' text.
219
    And the "Jump to..." select box should contain "Resource 1 (hidden)"
220
    And the "Jump to..." select box should contain "Scorm 1 (hidden)"
221
    And the "Jump to..." select box should contain "Survey 1 (hidden)"
222
    # Jump to an activity somewhere in the middle.
223
    When I select "Page 1" from the "Jump to..." singleselect
224
    Then I should see "Page 1"
225
    And I should see "Lti 1" in the "#prev-activity-link" "css_element"
226
    And I should see "Quiz 1" in the "#next-activity-link" "css_element"
227
    # Jump to the first activity.
228
    And I select "Assignment 1" from the "Jump to..." singleselect
229
    And I should see "Book 1" in the "#next-activity-link" "css_element"
230
    But "#prev-activity-link" "css_element" should not exist
231
    # Jump to the last activity.
232
    And I select "Workshop 1" from the "Jump to..." singleselect
233
    And I should see "Wiki 1" in the "#prev-activity-link" "css_element"
234
    But "#next-activity-link" "css_element" should not exist
235
    # Jump to a hidden activity.
236
    And I select "Glossary 1" from the "Jump to..." singleselect
237
    And I should see "Folder 1" in the "#prev-activity-link" "css_element"
238
    And I should see "Imscp 1" in the "#next-activity-link" "css_element"
239
 
240
  Scenario: Jump to another activity as a student
241
    Given I log in as "student1"
242
    And I am on "Course 1" course homepage
243
    And I follow "Assignment 1"
244
    And "Jump to..." "field" should exist
245
    # The current activity will not be listed.
246
    And the "Jump to..." select box should not contain "Assignment 1"
247
    # Stealth activities will not be listed for students.
248
    And the "Jump to..." select box should not contain "Forum 1"
249
    # Resources without view URL (e.g. labels) will not be listed.
250
    And the "Jump to..." select box should not contain "Label 1"
251
    # Hidden activities will not be listed for students.
252
    And the "Jump to..." select box should not contain "Glossary 1"
253
    # Activities in hidden sections will not be listed for students.
254
    And the "Jump to..." select box should not contain "Resource 1"
255
    And the "Jump to..." select box should not contain "Scorm 1"
256
    And the "Jump to..." select box should not contain "Survey 1"
257
    # Only activities visible to students will be listed.
258
    And the "Jump to..." select box should contain "Book 1"
259
    And the "Jump to..." select box should contain "Chat 1"
260
    And the "Jump to..." select box should contain "Choice 1"
261
    And the "Jump to..." select box should contain "Database 1"
262
    And the "Jump to..." select box should contain "Feedback 1"
263
    And the "Jump to..." select box should contain "Folder 1"
264
    And the "Jump to..." select box should contain "Imscp 1"
265
    And the "Jump to..." select box should contain "Lesson 1"
266
    And the "Jump to..." select box should contain "Lti 1"
267
    And the "Jump to..." select box should contain "Page 1"
268
    And the "Jump to..." select box should contain "Quiz 1"
269
    And the "Jump to..." select box should contain "Url 1"
270
    And the "Jump to..." select box should contain "Wiki 1"
271
    And the "Jump to..." select box should contain "Workshop 1"
272
    # Jump to an activity somewhere in the middle.
273
    When I select "Page 1" from the "Jump to..." singleselect
274
    Then I should see "Page 1"
275
    And I should see "Lti 1" in the "#prev-activity-link" "css_element"
276
    And I should see "Quiz 1" in the "#next-activity-link" "css_element"
277
    # Jump to the first activity.
278
    And I select "Assignment 1" from the "Jump to..." singleselect
279
    And I should see "Book 1" in the "#next-activity-link" "css_element"
280
    But "#prev-activity-link" "css_element" should not exist
281
    # Jump to the last activity.
282
    And I select "Workshop 1" from the "Jump to..." singleselect
283
    And I should see "Wiki 1" in the "#prev-activity-link" "css_element"
284
    But "#next-activity-link" "css_element" should not exist
285
 
286
  Scenario: Open an activity in a course that only has a single activity
287
    Given I log in as "student1"
288
    And I am on "Course 2" course homepage
289
    And I follow "Assignment 1"
290
    Then "#prev-activity-link" "css_element" should not exist
291
    And "#next-activity-link" "css_element" should not exist
292
    And "Jump to..." "field" should not exist