@@ -27,6 +27,7 @@ Feature: Test basic usage of book activity in app
2727 | Basic book | Hidden chapter | This is a hidden chapter | 0 | 1 | 4 |
2828 | Basic book | Hidden subchapter | This is a hidden subchapter | 1 | 1 | 5 |
2929 | Basic book | Chapt 3 | This is the third chapter | 0 | 0 | 6 |
30+ | Basic book | Last hidden | Another hidden subchapter | 1 | 1 | 7 |
3031
3132 Scenario : View book table of contents (student)
3233 Given I entered the course "Course 1" as "student1" in the app
@@ -39,6 +40,7 @@ Feature: Test basic usage of book activity in app
3940 And I should find "Start" in the app
4041 But I should not find "Hidden chapter" in the app
4142 And I should not find "Hidden subchapter" in the app
43+ And I should not find "Last hidden" in the app
4244 And I should not find "This is the first chapter" in the app
4345
4446 When I press "Start" in the app
@@ -49,6 +51,7 @@ Feature: Test basic usage of book activity in app
4951 And I should find "Chapt 3" in the app
5052 But I should not find "Hidden chapter" in the app
5153 And I should not find "Hidden subchapter" in the app
54+ And I should not find "Last hidden" in the app
5255
5356 Scenario : View book table of contents (teacher)
5457 Given I entered the course "Course 1" as "teacher1" in the app
@@ -60,6 +63,7 @@ Feature: Test basic usage of book activity in app
6063 And I should find "Hidden chapter" in the app
6164 And I should find "Hidden subchapter" in the app
6265 And I should find "Chapt 3" in the app
66+ And I should find "Last hidden" in the app
6367 And I should find "Start" in the app
6468 And I should not find "This is the first chapter" in the app
6569
@@ -71,6 +75,7 @@ Feature: Test basic usage of book activity in app
7175 And I should find "Hidden chapter" in the app
7276 And I should find "Hidden subchapter" in the app
7377 And I should find "Chapt 3" in the app
78+ And I should find "Last hidden" in the app
7479
7580 Scenario : Open chapters from table of contents
7681 Given I entered the course "Course 1" as "student1" in the app
@@ -127,65 +132,177 @@ Feature: Test basic usage of book activity in app
127132 And I should find "4 / 4" in the app
128133 But I should not find "This is the first chapter" in the app
129134
130- # TODO: Test navigate using swipe.
135+ # Navigate using swipe.
136+ When I swipe to the left in "Chapt 3" "ion-slides" in the app
137+ Then I should find "Chapt 3" in the app
138+ And I should find "This is the third chapter" in the app
139+ And I should find "4 / 4" in the app
140+
141+ When I swipe to the right in "Chapt 3" "ion-slides" in the app
142+ Then I should find "Chapt 2" in the app
143+ And I should find "This is the second chapter" in the app
144+ And I should find "3 / 4" in the app
145+
146+ When I swipe to the right in "Chapt 2" "ion-slides" in the app
147+ Then I should find "Chapt 1.1" in the app
148+ And I should find "This is a subchapter" in the app
149+ And I should find "2 / 4" in the app
150+
151+ When I swipe to the left in "Chapt 1.1" "ion-slides" in the app
152+ Then I should find "Chapt 2" in the app
153+ And I should find "This is the second chapter" in the app
154+ And I should find "3 / 4" in the app
131155
132156Scenario : View and navigate book contents (teacher)
133157 Given I entered the course "Course 1" as "teacher1" in the app
134158 And I press "Basic book" in the app
135159 And I press "Start" in the app
136160 Then I should find "Chapt 1" in the app
137161 And I should find "This is the first chapter" in the app
138- And I should find "1 / 6 " in the app
162+ And I should find "1 / 7 " in the app
139163
140164 When I press "Next" in the app
141165 Then I should find "Chapt 1.1" in the app
142166 And I should find "This is a subchapter" in the app
143- And I should find "2 / 6 " in the app
167+ And I should find "2 / 7 " in the app
144168 But I should not find "This is the first chapter" in the app
145169
146170 When I press "Next" in the app
147171 Then I should find "Chapt 2" in the app
148172 And I should find "This is the second chapter" in the app
149- And I should find "3 / 6 " in the app
173+ And I should find "3 / 7 " in the app
150174 But I should not find "This is a subchapter" in the app
151175
152176 When I press "Next" in the app
153177 Then I should find "Hidden chapter" in the app
154178 And I should find "This is a hidden chapter" in the app
155- And I should find "4 / 6 " in the app
179+ And I should find "4 / 7 " in the app
156180 But I should not find "This is the second chapter" in the app
157181
158182 When I press "Next" in the app
159183 Then I should find "Hidden subchapter" in the app
160184 And I should find "This is a hidden subchapter" in the app
161- And I should find "5 / 6 " in the app
185+ And I should find "5 / 7 " in the app
162186 But I should not find "This is a hidden chapter" in the app
163187
164188 When I press "Previous" in the app
165189 Then I should find "Hidden chapter" in the app
166190 And I should find "This is a hidden chapter" in the app
167- And I should find "4 / 6 " in the app
191+ And I should find "4 / 7 " in the app
168192 But I should not find "This is a hidden subchapter" in the app
169193
170194 # Navigate using TOC.
171195 When I press "Table of contents" in the app
172196 And I press "Chapt 1" in the app
173197 Then I should find "Chapt 1" in the app
174198 And I should find "This is the first chapter" in the app
175- And I should find "1 / 6 " in the app
199+ And I should find "1 / 7 " in the app
176200 But I should not find "This is a hidden chapter" in the app
177201
178202 When I press "Table of contents" in the app
179203 And I press "Hidden subchapter" in the app
180204 Then I should find "Hidden subchapter" in the app
181205 And I should find "This is a hidden subchapter" in the app
182- And I should find "5 / 6 " in the app
206+ And I should find "5 / 7 " in the app
183207 But I should not find "This is the first chapter" in the app
184208
185- # TODO: Test navigate using swipe.
209+ # Navigate using swipe.
210+ When I swipe to the left in "Hidden subchapter" "ion-slides" in the app
211+ Then I should find "Chapt 3" in the app
212+ And I should find "This is the third chapter" in the app
213+ And I should find "6 / 7" in the app
214+
215+ When I swipe to the left in "Chapt 3" "ion-slides" in the app
216+ Then I should find "Last hidden" in the app
217+ And I should find "Another hidden subchapter" in the app
218+ And I should find "7 / 7" in the app
219+
220+ When I swipe to the left in "Last hidden" "ion-slides" in the app
221+ Then I should find "Last hidden" in the app
222+ And I should find "Another hidden subchapter" in the app
223+ And I should find "7 / 7" in the app
224+
225+ When I swipe to the right in "Last hidden" "ion-slides" in the app
226+ Then I should find "Chapt 3" in the app
227+ And I should find "This is the third chapter" in the app
228+ And I should find "6 / 7" in the app
186229
187230 Scenario : Link to book opens chapter content
188231 Given I entered the book activity "Basic book" on course "Course 1" as "student1" in the app
189232 Then I should find "This is the first chapter" in the app
190233
191- # TODO: Scenario to test book numbering (numbers, bullets, etc.).
234+ Scenario : Test numbering (student)
235+ Given the following "activities" exist:
236+ | activity | name | intro | course | idnumber | numbering |
237+ | book | Bull book | Test book description | C1 | book2 | 2 |
238+ | book | Ind book | Test book description | C1 | book2 | 3 |
239+ | book | None book | Test book description | C1 | book2 | 0 |
240+ And the following "mod_book > chapter" exist:
241+ | book | title | content | subchapter | hidden | pagenum |
242+ | Bull book | Chapt 1 | This is the first chapter | 0 | 0 | 1 |
243+ | Ind book | Chapt 1 | This is the first chapter | 0 | 0 | 1 |
244+ | None book | Chapt 1 | This is the first chapter | 0 | 0 | 1 |
245+ And I entered the course "Course 1" as "student1" in the app
246+ And I press "Basic book" in the app
247+ Then I should find "1. Chapt 1" in the app
248+ And I should find "1.1. Chapt 1.1" in the app
249+ And I should find "2. Chapt 2" in the app
250+ And I should find "3. Chapt 3" in the app
251+
252+ When I press "Start" in the app
253+ And I press "Table of contents" in the app
254+ Then I should find "1. Chapt 1" in the app
255+ And I should find "1.1. Chapt 1.1" in the app
256+ And I should find "2. Chapt 2" in the app
257+ And I should find "3. Chapt 3" in the app
258+
259+ When I press "Close" in the app
260+ And I press the back button in the app
261+ And I press the back button in the app
262+ And I press "Bull book" in the app
263+ Then I should find "• Chapt 1" in the app
264+ But I should not find "1. Chapt 1" in the app
265+
266+ When I press "Start" in the app
267+ And I press "Table of contents" in the app
268+ Then I should find "• Chapt 1" in the app
269+ But I should not find "1. Chapt 1" in the app
270+
271+ When I press "Close" in the app
272+ And I press the back button in the app
273+ And I press the back button in the app
274+ And I press "Ind book" in the app
275+ Then I should find "Chapt 1" in the app
276+ But I should not find "• Chapt 1" in the app
277+ And I should not find "1. Chapt 1" in the app
278+
279+ When I press "Start" in the app
280+ And I press "Table of contents" in the app
281+ Then I should find "Chapt 1" in the app
282+ But I should not find "• Chapt 1" in the app
283+ And I should not find "1. Chapt 1" in the app
284+
285+ When I press "Close" in the app
286+ And I press the back button in the app
287+ And I press the back button in the app
288+ And I press "None book" in the app
289+ Then I should find "Chapt 1" in the app
290+ But I should not find "• Chapt 1" in the app
291+ And I should not find "1. Chapt 1" in the app
292+
293+ When I press "Start" in the app
294+ And I press "Table of contents" in the app
295+ Then I should find "Chapt 1" in the app
296+ But I should not find "• Chapt 1" in the app
297+ And I should not find "1. Chapt 1" in the app
298+
299+ Scenario : Test numbering (teacher)
300+ Given I entered the course "Course 1" as "teacher1" in the app
301+ And I press "Basic book" in the app
302+ Then I should find "1. Chapt 1" in the app
303+ And I should find "1.1. Chapt 1.1" in the app
304+ And I should find "2. Chapt 2" in the app
305+ And I should find "x. Hidden chapter" in the app
306+ And I should find "x.x. Hidden subchapter" in the app
307+ And I should find "3. Chapt 3" in the app
308+ And I should find "3.x. Last hidden" in the app
0 commit comments