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