[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/mod/lesson/tests/behat/ -> lesson_student_dashboard.feature (source)

   1  @mod @mod_lesson
   2  Feature: In Dashboard, a student can see their current status on all lessons with an upcoming due date
   3    In order to know my status on a lesson
   4    As a student
   5    I need to see it in Dashboard
   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 | category |
  14        | Course 1 | C1 | 0 |
  15      And the following "course enrolments" exist:
  16        | user | course | role |
  17        | teacher1 | C1 | editingteacher |
  18        | student1 | C1 | student |
  19      And the following "activities" exist:
  20        | activity | name             | intro                   | deadline   | retake | course | idnumber |
  21        | lesson   | Test lesson name | Test lesson description | 1893481200 | 1      | C1     | lesson1  |
  22      And I log in as "teacher1"
  23      And I follow "Course 1"
  24      And I turn editing mode on
  25  
  26    Scenario: A completed lesson with only questions that allows multiple attempts
  27      Given I follow "Test lesson name"
  28      And I follow "Add a question page"
  29      And I set the field "Select a question type" to "True/false"
  30      And I press "Add a question page"
  31      And I set the following fields to these values:
  32        | Page title | True/false question 1 |
  33        | Page contents | Cat is an amphibian |
  34        | id_answer_editor_0 | False |
  35        | id_response_editor_0 | Correct |
  36        | id_jumpto_0 | Next page |
  37        | id_answer_editor_1 | True |
  38        | id_response_editor_1 | Wrong |
  39        | id_jumpto_1 | This page |
  40      And I press "Save page"
  41      And I select "Question" from the "qtype" singleselect
  42      And I set the field "Select a question type" to "True/false"
  43      And I press "Add a question page"
  44      And I set the following fields to these values:
  45        | Page title | True/false question 2 |
  46        | Page contents | Paper is made from trees. |
  47        | id_answer_editor_0 | True |
  48        | id_response_editor_0 | Correct |
  49        | id_jumpto_0 | Next page |
  50        | id_answer_editor_1 | False |
  51        | id_response_editor_1 | Wrong |
  52        | id_jumpto_1 | This page |
  53      And I press "Save page"
  54      And I log out
  55      And I log in as "student1"
  56      And I follow "Course 1"
  57      And I follow "Test lesson name"
  58      And I should see "Cat is an amphibian"
  59      And I set the following fields to these values:
  60        | False | 1 |
  61      And I press "Submit"
  62      And I press "Continue"
  63      And I should see "Paper is made from trees."
  64      And I set the following fields to these values:
  65        | False | 1 |
  66      And I press "Submit"
  67      And I press "Continue"
  68      And I should see "Congratulations - end of lesson reached"
  69      When I click on "Dashboard" "link" in the "Navigation" "block"
  70      Then I should see "You have lessons that are due"
  71      And I should see "Completed, You can re-attempt this lesson"
  72  
  73    Scenario: A completed lesson with only questions that does not allow multiple attempts
  74      Given  I follow "Test lesson name"
  75      And I navigate to "Edit settings" node in "Lesson administration"
  76      And I set the following fields to these values:
  77        | Re-takes allowed | 0 |
  78      And I press "Save and display"
  79      And I follow "Add a question page"
  80      And I set the field "Select a question type" to "True/false"
  81      And I press "Add a question page"
  82      And I set the following fields to these values:
  83        | Page title | True/false question 1 |
  84        | Page contents | Cat is an amphibian |
  85        | id_answer_editor_0 | False |
  86        | id_response_editor_0 | Correct |
  87        | id_jumpto_0 | Next page |
  88        | id_answer_editor_1 | True |
  89        | id_response_editor_1 | Wrong |
  90        | id_jumpto_1 | This page |
  91      And I press "Save page"
  92      And I select "Question" from the "qtype" singleselect
  93      And I set the field "Select a question type" to "True/false"
  94      And I press "Add a question page"
  95      And I set the following fields to these values:
  96        | Page title | True/false question 2 |
  97        | Page contents | Paper is made from trees. |
  98        | id_answer_editor_0 | True |
  99        | id_response_editor_0 | Correct |
 100        | id_jumpto_0 | Next page |
 101        | id_answer_editor_1 | False |
 102        | id_response_editor_1 | Wrong |
 103        | id_jumpto_1 | This page |
 104      And I press "Save page"
 105      And I log out
 106      And I log in as "student1"
 107      And I follow "Course 1"
 108      And I follow "Test lesson name"
 109      And I should see "Cat is an amphibian"
 110      And I set the following fields to these values:
 111        | False | 1 |
 112      And I press "Submit"
 113      And I press "Continue"
 114      And I should see "Paper is made from trees."
 115      And I set the following fields to these values:
 116        | False | 1 |
 117      And I press "Submit"
 118      And I press "Continue"
 119      And I should see "Congratulations - end of lesson reached"
 120      When I click on "Dashboard" "link" in the "Navigation" "block"
 121      Then I should not see "You have lessons that are due"
 122  
 123    Scenario: A completed lesson with only content pages that allows multiple attempts
 124      Given I follow "Test lesson name"
 125      And I follow "Add a content page"
 126      And I set the following fields to these values:
 127        | Page title | First page name |
 128        | Page contents | First page contents |
 129        | id_answer_editor_0 | Next page |
 130        | id_jumpto_0 | Next page |
 131      And I press "Save page"
 132      And I select "Add a content page" from the "qtype" singleselect
 133      And I set the following fields to these values:
 134        | Page title | Second page name |
 135        | Page contents | Second page contents |
 136        | id_answer_editor_0 | Previous page |
 137        | id_jumpto_0 | Previous page |
 138        | id_answer_editor_1 | End of lesson |
 139        | id_jumpto_1 | End of lesson |
 140      And I press "Save page"
 141      And I log out
 142      And I log in as "student1"
 143      And I follow "Course 1"
 144      And I follow "Test lesson name"
 145      And I should see "First page contents"
 146      And I press "Next page"
 147      And I should see "Second page contents"
 148      And I press "End of lesson"
 149      When I click on "Dashboard" "link" in the "Navigation" "block"
 150      Then I should see "You have lessons that are due"
 151      And I should see "Completed, You can re-attempt this lesson"
 152  
 153    Scenario: A completed lesson with only content pages that does not allow multiple attempts
 154      Given I follow "Test lesson name"
 155      And I navigate to "Edit settings" node in "Lesson administration"
 156      And I set the following fields to these values:
 157        | Re-takes allowed | 0 |
 158      And I press "Save and display"
 159      And I follow "Add a content page"
 160      And I set the following fields to these values:
 161        | Page title | First page name |
 162        | Page contents | First page contents |
 163        | id_answer_editor_0 | Next page |
 164        | id_jumpto_0 | Next page |
 165      And I press "Save page"
 166      And I select "Add a content page" from the "qtype" singleselect
 167      And I set the following fields to these values:
 168        | Page title | Second page name |
 169        | Page contents | Second page contents |
 170        | id_answer_editor_0 | Previous page |
 171        | id_jumpto_0 | Previous page |
 172        | id_answer_editor_1 | End of lesson |
 173        | id_jumpto_1 | End of lesson |
 174      And I press "Save page"
 175      And I log out
 176      And I log in as "student1"
 177      And I follow "Course 1"
 178      And I follow "Test lesson name"
 179      And I should see "First page contents"
 180      And I press "Next page"
 181      And I should see "Second page contents"
 182      And I press "End of lesson"
 183      When I click on "Dashboard" "link" in the "Navigation" "block"
 184      Then I should not see "You have lessons that are due"
 185  
 186    Scenario: An incomplete lesson with only questions.
 187      Given I follow "Test lesson name"
 188      And I follow "Add a question page"
 189      And I set the field "Select a question type" to "True/false"
 190      And I press "Add a question page"
 191      And I set the following fields to these values:
 192        | Page title | True/false question 1 |
 193        | Page contents | Cat is an amphibian |
 194        | id_answer_editor_0 | False |
 195        | id_response_editor_0 | Correct |
 196        | id_jumpto_0 | Next page |
 197        | id_answer_editor_1 | True |
 198        | id_response_editor_1 | Wrong |
 199        | id_jumpto_1 | This page |
 200      And I press "Save page"
 201      And I select "Question" from the "qtype" singleselect
 202      And I set the field "Select a question type" to "True/false"
 203      And I press "Add a question page"
 204      And I set the following fields to these values:
 205        | Page title | True/false question 2 |
 206        | Page contents | Paper is made from trees. |
 207        | id_answer_editor_0 | True |
 208        | id_response_editor_0 | Correct |
 209        | id_jumpto_0 | Next page |
 210        | id_answer_editor_1 | False |
 211        | id_response_editor_1 | Wrong |
 212        | id_jumpto_1 | This page |
 213      And I press "Save page"
 214      And I log out
 215      And I log in as "student1"
 216      And I follow "Course 1"
 217      And I follow "Test lesson name"
 218      And I should see "Cat is an amphibian"
 219      And I set the following fields to these values:
 220        | False | 1 |
 221      And I press "Submit"
 222      And I press "Continue"
 223      When I click on "Dashboard" "link" in the "Navigation" "block"
 224      Then I should see "You have lessons that are due"
 225      And I should see "Lesson has been started, but not yet completed"
 226  
 227    Scenario: An incomplete lesson with only content pages.
 228      Given I follow "Test lesson name"
 229      And I follow "Add a content page"
 230      And I set the following fields to these values:
 231        | Page title | First page name |
 232        | Page contents | First page contents |
 233        | id_answer_editor_0 | Next page |
 234        | id_jumpto_0 | Next page |
 235      And I press "Save page"
 236      And I select "Add a content page" from the "qtype" singleselect
 237      And I set the following fields to these values:
 238        | Page title | Second page name |
 239        | Page contents | Second page contents |
 240        | id_answer_editor_0 | Previous page |
 241        | id_jumpto_0 | Previous page |
 242        | id_answer_editor_1 | End of lesson |
 243        | id_jumpto_1 | End of lesson |
 244      And I press "Save page"
 245      And I log out
 246      And I log in as "student1"
 247      And I follow "Course 1"
 248      And I follow "Test lesson name"
 249      And I should see "First page contents"
 250      And I press "Next page"
 251      And I should see "Second page contents"
 252      When I click on "Dashboard" "link" in the "Navigation" "block"
 253      Then I should see "You have lessons that are due"
 254      And I should see "Lesson has been started, but not yet completed"
 255  
 256    Scenario: A lesson with only questions that has not been started.
 257      Given I follow "Test lesson name"
 258      And I follow "Add a question page"
 259      And I set the field "Select a question type" to "True/false"
 260      And I press "Add a question page"
 261      And I set the following fields to these values:
 262        | Page title | True/false question 1 |
 263        | Page contents | Cat is an amphibian |
 264        | id_answer_editor_0 | False |
 265        | id_response_editor_0 | Correct |
 266        | id_jumpto_0 | Next page |
 267        | id_answer_editor_1 | True |
 268        | id_response_editor_1 | Wrong |
 269        | id_jumpto_1 | This page |
 270      And I press "Save page"
 271      And I select "Question" from the "qtype" singleselect
 272      And I set the field "Select a question type" to "True/false"
 273      And I press "Add a question page"
 274      And I set the following fields to these values:
 275        | Page title | True/false question 2 |
 276        | Page contents | Paper is made from trees. |
 277        | id_answer_editor_0 | True |
 278        | id_response_editor_0 | Correct |
 279        | id_jumpto_0 | Next page |
 280        | id_answer_editor_1 | False |
 281        | id_response_editor_1 | Wrong |
 282        | id_jumpto_1 | This page |
 283      And I press "Save page"
 284      And I log out
 285      And I log in as "student1"
 286      When I click on "Dashboard" "link" in the "Navigation" "block"
 287      Then I should see "You have lessons that are due"
 288      And I should see "No attempts have been made on this lesson"
 289  
 290    Scenario: A lesson with only content pages that has not been started.
 291      Given I follow "Test lesson name"
 292      And I follow "Add a content page"
 293      And I set the following fields to these values:
 294        | Page title | First page name |
 295        | Page contents | First page contents |
 296        | id_answer_editor_0 | Next page |
 297        | id_jumpto_0 | Next page |
 298      And I press "Save page"
 299      And I select "Add a content page" from the "qtype" singleselect
 300      And I set the following fields to these values:
 301        | Page title | Second page name |
 302        | Page contents | Second page contents |
 303        | id_answer_editor_0 | Previous page |
 304        | id_jumpto_0 | Previous page |
 305        | id_answer_editor_1 | End of lesson |
 306        | id_jumpto_1 | End of lesson |
 307      And I press "Save page"
 308      And I log out
 309      And I log in as "student1"
 310      When I click on "Dashboard" "link" in the "Navigation" "block"
 311      Then I should see "You have lessons that are due"
 312      And I should see "No attempts have been made on this lesson"
 313  
 314    Scenario: Viewing the status for multiple lessons in multiple courses
 315      Given the following "courses" exist:
 316        | fullname | shortname | category |
 317        | Course 2 | C2 | 0 |
 318      And the following "course enrolments" exist:
 319        | user | course | role |
 320        | teacher1 | C2 | editingteacher |
 321        | student1 | C2 | student |
 322      And the following "activities" exist:
 323        | activity | name               | intro                   | deadline   | retake | course | idnumber |
 324        | lesson   | Test lesson name 2 | Test lesson description | 1893481200 | 1      | C1     | lesson1  |
 325        | lesson   | Test lesson name 3 | Test lesson description | 1893481200 | 1      | C2     | lesson1  |
 326      And I turn editing mode off
 327      And I follow "Test lesson name"
 328      And I follow "Add a question page"
 329      And I set the field "Select a question type" to "True/false"
 330      And I press "Add a question page"
 331      And I set the following fields to these values:
 332        | Page title | True/false question |
 333        | Page contents | D035 M00d13 r0x0rz j00 b0x0rs? |
 334        | id_answer_editor_0 | True |
 335        | id_answer_editor_1 | False |
 336      And I press "Save page"
 337      And I follow "Test lesson name 2"
 338      And I follow "Add a question page"
 339      And I set the field "Select a question type" to "True/false"
 340      And I press "Add a question page"
 341      And I set the following fields to these values:
 342        | Page title | True/false question |
 343        | Page contents | D035 M00d13 r0x0rz j00 b0x0rs? |
 344        | id_answer_editor_0 | True |
 345        | id_answer_editor_1 | False |
 346      And I press "Save page"
 347      And I click on "Dashboard" "link" in the "Navigation" "block"
 348      And I follow "Course 2"
 349      And I follow "Test lesson name 3"
 350      And I follow "Add a question page"
 351      And I set the field "Select a question type" to "True/false"
 352      And I press "Add a question page"
 353      And I set the following fields to these values:
 354        | Page title | True/false question 1 |
 355        | Page contents | D035 M00d13 r0x0rz j00 b0x0rs? |
 356        | id_answer_editor_0 | True |
 357        | id_answer_editor_1 | False |
 358      And I press "Save page"
 359      And I select "Question" from the "qtype" singleselect
 360      And I set the field "Select a question type" to "True/false"
 361      And I press "Add a question page"
 362      And I set the following fields to these values:
 363        | Page title | True/false question 2 |
 364        | Page contents | D035 M00d13 r0x0rz j00 b0x0rs? |
 365        | id_answer_editor_0 | True |
 366        | id_answer_editor_1 | False |
 367      And I press "Save page"
 368      And I log out
 369      And I log in as "student1"
 370      And I follow "Course 1"
 371      And I follow "Test lesson name"
 372      And I should see "D035 M00d13 r0x0rz j00 b0x0rs?"
 373      And I set the following fields to these values:
 374        | True | 1 |
 375      And I press "Submit"
 376      And I click on "Dashboard" "link" in the "Navigation" "block"
 377      And I follow "Course 2"
 378      And I follow "Test lesson name 3"
 379      And I should see "D035 M00d13 r0x0rz j00 b0x0rs?"
 380      And I set the following fields to these values:
 381        | True | 1 |
 382      And I press "Submit"
 383      When I click on "Dashboard" "link" in the "Navigation" "block"
 384      Then I should see "You have lessons that are due" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' coursebox ' ) and contains(normalize-space(.), 'Course 1')]/div[contains( normalize-space(.), 'You have lessons that are due ' )]" "xpath_element"
 385      And I should see "You have lessons that are due" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' coursebox ' ) and contains(normalize-space(.), 'Course 2')]/div[contains( normalize-space(.), 'You have lessons that are due ' )]" "xpath_element"
 386      And I should see "Lesson has been started, but not yet completed" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' overview ' ) and descendant-or-self::a[.='Test lesson name 3']]" "xpath_element"
 387      And I should see "Completed, You can re-attempt this lesson" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' overview ' ) and descendant-or-self::a[.='Test lesson name']]" "xpath_element"
 388      And I should see "No attempts have been made on this lesson" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' overview ' ) and descendant-or-self::a[.='Test lesson name 2']]" "xpath_element"


Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1