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