[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

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

   1  @mod @mod_lesson
   2  Feature: In a lesson activity, students can see questions in random order
   3    In order to create a lesson with clusters
   4    As a teacher
   5    I need to add content pages and questions with clusters and end of clusters pages
   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 I log in as "teacher1"
  20      And I follow "Course 1"
  21      And I turn editing mode on
  22  
  23    Scenario: Lesson with two clusters
  24      Given I add a "Lesson" to section "1" and I fill the form with:
  25        | Name | Lesson with clusters |
  26        | Description | Test lesson description |
  27      And I follow "Lesson with clusters"
  28      And I follow "Add a content page"
  29      And I set the following fields to these values:
  30        | Page title | First page name |
  31        | Page contents | First page contents |
  32        | id_answer_editor_0 | Next page |
  33        | id_jumpto_0 | Next page |
  34      And I press "Save page"
  35      And I select "Add a content page" from the "qtype" singleselect
  36      And I set the following fields to these values:
  37        | Page title | Second page name |
  38        | Page contents | Second page contents |
  39        | id_answer_editor_0 | Previous page |
  40        | id_jumpto_0 | Previous page |
  41        | id_answer_editor_1 | Next page |
  42        | id_jumpto_1 | Next page |
  43      And I press "Save page"
  44      And I follow "Expanded"
  45      And I click on "Add a cluster" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][3]" "xpath_element"
  46      And I click on "Add a question page here" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][4]" "xpath_element"
  47      And I set the field "Select a question type" to "Multichoice"
  48      And I press "Add a question page"
  49      And I set the following fields to these values:
  50        | Page title | question 1 |
  51        | Page contents | Question from cluster 1 |
  52        | id_answer_editor_0 | Correct answer |
  53        | id_response_editor_0 | Good |
  54        | id_jumpto_0 | Cluster |
  55        | id_score_0 | 1 |
  56        | id_answer_editor_1 | Incorrect answer |
  57        | id_response_editor_1 | Bad |
  58        | id_jumpto_1 | This page |
  59        | id_score_1 | 0 |
  60      And I press "Save page"
  61      And I click on "Add a question page here" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][5]" "xpath_element"
  62      And I set the field "Select a question type" to "Multichoice"
  63      And I press "Add a question page"
  64      And I set the following fields to these values:
  65        | Page title | question 2 |
  66        | Page contents | Question from cluster 1 |
  67        | id_answer_editor_0 | Correct answer |
  68        | id_response_editor_0 | Good |
  69        | id_jumpto_0 | Cluster |
  70        | id_score_0 | 1 |
  71        | id_answer_editor_1 | Incorrect answer |
  72        | id_response_editor_1 | Bad |
  73        | id_jumpto_1 | This page |
  74        | id_score_1 | 0 |
  75      And I press "Save page"
  76      And I click on "Add an end of cluster" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][6]" "xpath_element"
  77      And I click on "Add a content page" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][7]" "xpath_element"
  78          And I set the following fields to these values:
  79        | Page title | Third page name |
  80        | Page contents | Content page after cluster 1 |
  81        | id_answer_editor_0 | Next page |
  82        | id_jumpto_0 | Next page |
  83      And I press "Save page"
  84      And I click on "Add a cluster" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][8]" "xpath_element"
  85      And I click on "Add a question page here" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][9]" "xpath_element"
  86      And I set the field "Select a question type" to "Multichoice"
  87      And I press "Add a question page"
  88      And I set the following fields to these values:
  89        | Page title | question 3 |
  90        | Page contents | Question from cluster 2 |
  91        | id_answer_editor_0 | Correct answer |
  92        | id_response_editor_0 | Good |
  93        | id_jumpto_0 | Unseen question within a cluster |
  94        | id_score_0 | 1 |
  95        | id_answer_editor_1 | Incorrect answer |
  96        | id_response_editor_1 | Bad |
  97        | id_jumpto_1 | This page |
  98        | id_score_1 | 0 |
  99      And I press "Save page"
 100      And I click on "Add a question page here" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][10]" "xpath_element"
 101      And I set the field "Select a question type" to "Multichoice"
 102      And I press "Add a question page"
 103      And I set the following fields to these values:
 104        | Page title | question 4 |
 105        | Page contents | Question from cluster 2 |
 106        | id_answer_editor_0 | Correct answer |
 107        | id_response_editor_0 | Good |
 108        | id_jumpto_0 | Unseen question within a cluster |
 109        | id_score_0 | 1 |
 110        | id_answer_editor_1 | Incorrect answer |
 111        | id_response_editor_1 | Bad |
 112        | id_jumpto_1 | This page |
 113        | id_score_1 | 0 |
 114      And I press "Save page"
 115      And I click on "Add an end of cluster" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][11]" "xpath_element"
 116      And I click on "Add a content page" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][12]" "xpath_element"
 117          And I set the following fields to these values:
 118        | Page title | Fourth page name |
 119        | Page contents | Content page after cluster 2 |
 120        | id_answer_editor_0 | Next page |
 121        | id_jumpto_0 | Next page |
 122      And I press "Save page"
 123      And I log out
 124      And I log in as "student1"
 125      And I follow "Course 1"
 126      When I follow "Lesson with clusters"
 127      Then I should see "First page contents"
 128      And I press "Next page"
 129      And I should see "Second page contents"
 130      And I press "Next page"
 131      And I should see "Question from cluster 1"
 132      And I set the following fields to these values:
 133        | Correct answer | 1 |
 134      And I press "Submit"
 135      And I should see "Good"
 136      And I press "Continue"
 137      And I should see "Question from cluster 1"
 138      And I set the following fields to these values:
 139        | Correct answer | 1 |
 140      And I press "Submit"
 141      And I should see "Good"
 142      And I press "Continue"
 143      And I should see "Content page after cluster 1"
 144      And I press "Next page"
 145      And I should see "Question from cluster 2"
 146      And I set the following fields to these values:
 147        | Correct answer | 1 |
 148      And I press "Submit"
 149      And I should see "Good"
 150      And I press "Continue"
 151      And I should see "Question from cluster 2"
 152      And I set the following fields to these values:
 153        | Correct answer | 1 |
 154      And I press "Submit"
 155      And I should see "Good"
 156      And I press "Continue"
 157      And I should see "Content page after cluster 2"
 158      And I press "Next page"
 159      And I should see "Congratulations - end of lesson reached"
 160      And I should see "Your score is 4 (out of 4)."


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