[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/mod/feedback/tests/behat/ -> coursemapping.feature (source)

   1  @mod @mod_feedback
   2  Feature: Mapping courses in a feedback
   3    In order to collect the same feedback about multiple courses
   4    As a manager
   5    I need to be able to map site feedback to courses
   6  
   7    Background:
   8      Given the following "users" exist:
   9        | username | firstname | lastname |
  10        | user1    | Username  | 1        |
  11        | user2    | Username  | 2        |
  12        | user3    | Username  | 3        |
  13        | teacher  | Teacher   | 4        |
  14        | manager  | Manager   | 5        |
  15      And the following "courses" exist:
  16        | fullname | shortname |
  17        | Course 1 | C1        |
  18        | Course 2 | C2        |
  19        | Course 3 | C3        |
  20      And the following "course enrolments" exist:
  21        | user    | course | role    |
  22        | user1   | C1     | student |
  23        | user1   | C2     | student |
  24        | user2   | C1     | student |
  25        | user2   | C2     | student |
  26        | user3   | C3     | student |
  27        | teacher | C1     | editingteacher |
  28        | teacher | C2     | editingteacher |
  29        | teacher | C3     | editingteacher |
  30      And the following "system role assigns" exist:
  31        | user    | course               | role    |
  32        | manager | Acceptance test site | manager |
  33      And the following "activities" exist:
  34        | activity   | name             | course               | idnumber  | anonymous | publish_stats |
  35        | feedback   | Course feedback  | Acceptance test site | feedback0 | 1         | 1             |
  36        | feedback   | Another feedback | C1                   | feedback1 | 1         | 1             |
  37      When I log in as "manager"
  38      And I am on site homepage
  39      And I follow "Course feedback"
  40      And I follow "Edit questions"
  41      And I add a "Information" question to the feedback with:
  42        | Question         | this is an information question |
  43        | Label            | info                            |
  44        | Information type | Course                          |
  45      And I add a "Multiple choice (rated)" question to the feedback with:
  46        | Question               | this is a multiple choice rated    |
  47        | Label                  | multichoicerated                   |
  48        | Multiple choice type   | Multiple choice - single answer    |
  49        | Multiple choice values | 0/option a\n1/option b\n5/option c |
  50      And I add a "Multiple choice" question to the feedback with:
  51        | Question               | this is a simple multiple choice    |
  52        | Label                  | multichoicesimple                   |
  53        | Multiple choice type   | Multiple choice - single answer allowed (dropdownlist) |
  54        | Multiple choice values | option d\noption e\noption f                           |
  55      And I log out
  56      And I log in as "teacher"
  57      And I follow "Course 1"
  58      And I turn editing mode on
  59      And I add the "Feedback" block
  60      And I am on site homepage
  61      And I follow "Course 2"
  62      And I add the "Feedback" block
  63      And I am on site homepage
  64      And I follow "Course 3"
  65      And I add the "Feedback" block
  66      And I log out
  67  
  68    Scenario: Course feedback can not be mapped
  69      And I log in as "manager"
  70      And I am on site homepage
  71      And I follow "Course 1"
  72      And I follow "Another feedback"
  73      And I should not see "Mapped courses"
  74      And I should not see "Map feedback to courses"
  75  
  76    @javascript
  77    Scenario: Site feedback is not mapped to any course
  78      And I log in as "user1"
  79      And I am on site homepage
  80      And I follow "Course feedback"
  81      And I follow "Answer the questions..."
  82      And I should see "Acceptance test site" in the ".feedback_form" "css_element"
  83      And I set the following fields to these values:
  84        | option a                         | 1        |
  85        | this is a simple multiple choice | option d |
  86      And I press "Submit your answers"
  87      And I press "Continue"
  88      And I follow "Course 1"
  89      And I click on "Course feedback" "link" in the "Feedback" "block"
  90      And I follow "Answer the questions..."
  91      And I should not see "Acceptance test site" in the ".feedback_form" "css_element"
  92      And I should see "C1" in the ".feedback_form" "css_element"
  93      And I set the following fields to these values:
  94        | option b                         | 1        |
  95        | this is a simple multiple choice | option e |
  96      And I press "Submit your answers"
  97      And I press "Continue"
  98      And I click on "Course feedback" "link" in the "Feedback" "block"
  99      And I should not see "Answer the questions..."
 100      And I log out
 101      And I log in as "user2"
 102      And I follow "Course 1"
 103      And I click on "Course feedback" "link" in the "Feedback" "block"
 104      And I follow "Answer the questions..."
 105      And I should not see "Acceptance test site" in the ".feedback_form" "css_element"
 106      And I should see "C1" in the ".feedback_form" "css_element"
 107      And I set the following fields to these values:
 108        | option c                         | 1        |
 109        | this is a simple multiple choice | option e |
 110      And I press "Submit your answers"
 111      And I press "Continue"
 112      And I log out
 113      And I log in as "manager"
 114      And I am on site homepage
 115      And I follow "Course feedback"
 116  
 117      And I follow "Analysis"
 118      And I should see "All courses" in the "#feedback_course_filter .fautocomplete .label" "css_element"
 119      And I show chart data for the "multichoicerated" feedback
 120      And I should see "1 (33.33 %)" in the "option a" "table_row"
 121      And I should see "1 (33.33 %)" in the "option b" "table_row"
 122      And I should see "1 (33.33 %)" in the "option c" "table_row"
 123      And I should see "Average: 2.00"
 124      And I follow "Sort by course"
 125      And I should see "2.50" in the "C1" "table_row"
 126      And I should see "1.00" in the "Acceptance test site" "table_row"
 127      And I follow "Back"
 128      And I set the field "Filter by course" to "Course 1"
 129      And I press "Filter"
 130      And I should see "Course 1" in the "#feedback_course_filter .fautocomplete .label" "css_element"
 131      And I show chart data for the "multichoicerated" feedback
 132      And I should see "0" in the "option a" "table_row"
 133      And I should see "1 (50.00 %)" in the "option b" "table_row"
 134      And I should see "1 (50.00 %)" in the "option c" "table_row"
 135      And I log out
 136  
 137    @javascript
 138    Scenario: Site feedback is mapped to courses
 139      And I log in as "manager"
 140      And I am on site homepage
 141      And I follow "Course feedback"
 142      And I follow "Map feedback to courses"
 143      And I set the field "Courses" to "Course 2"
 144      And I set the field "Courses" to "Course 3"
 145      And I press "Save changes"
 146      And I log out
 147  
 148      And I log in as "user1"
 149      And I am on site homepage
 150      And I follow "Course feedback"
 151      And I should see "You can only access this feedback from a course"
 152      And I should not see "Answer the questions..."
 153  
 154      And I am on site homepage
 155      And I follow "Course 1"
 156      And "Feedback" "block" should not exist
 157      And I should not see "Course feedback"
 158  
 159      And I am on site homepage
 160      And I follow "Course 2"
 161      And I click on "Course feedback" "link" in the "Feedback" "block"
 162      And I follow "Answer the questions..."
 163      And I should not see "Acceptance test site" in the ".feedback_form" "css_element"
 164      And I should see "C2" in the ".feedback_form" "css_element"
 165      And I set the following fields to these values:
 166        | option b                         | 1        |
 167        | this is a simple multiple choice | option e |
 168      And I press "Submit your answers"
 169      And I press "Continue"
 170      And I click on "Course feedback" "link" in the "Feedback" "block"
 171      And I should not see "Answer the questions..."
 172      And I log out
 173      And I log in as "user2"
 174      And I follow "Course 2"
 175      And I click on "Course feedback" "link" in the "Feedback" "block"
 176      And I follow "Answer the questions..."
 177      And I should not see "Acceptance test site" in the ".feedback_form" "css_element"
 178      And I should see "C2" in the ".feedback_form" "css_element"
 179      And I set the following fields to these values:
 180        | option c                         | 1        |
 181        | this is a simple multiple choice | option e |
 182      And I press "Submit your answers"
 183      And I press "Continue"
 184      And I log out
 185      And I log in as "user3"
 186      And I follow "Course 3"
 187      And I click on "Course feedback" "link" in the "Feedback" "block"
 188      And I follow "Answer the questions..."
 189      And I should not see "Acceptance test site" in the ".feedback_form" "css_element"
 190      And I should see "C3" in the ".feedback_form" "css_element"
 191      And I set the following fields to these values:
 192        | option c                         | 1        |
 193        | this is a simple multiple choice | option d |
 194      And I press "Submit your answers"
 195      And I press "Continue"
 196      And I log out
 197      And I log in as "manager"
 198      And I am on site homepage
 199      And I follow "Course feedback"
 200      And I follow "Analysis"
 201      And I should see "All courses" in the "#feedback_course_filter .fautocomplete .label" "css_element"
 202      And I show chart data for the "multichoicerated" feedback
 203      And I should see "0" in the "option a" "table_row"
 204      And I should see "1 (33.33 %)" in the "option b" "table_row"
 205      And I should see "2 (66.67 %)" in the "option c" "table_row"
 206      And I should see "Average: 3.67"
 207      And I click on "Sort by course" "link"
 208      And I should see "3.00" in the "C3" "table_row"
 209      And I should see "2.50" in the "C2" "table_row"
 210      And I follow "Back"
 211      And I set the field "Filter by course" to "Course 2"
 212      And I press "Filter"
 213      And I show chart data for the "multichoicerated" feedback
 214      And I should see "0" in the "option a" "table_row"
 215      And I should see "1 (50.00 %)" in the "option b" "table_row"
 216      And I should see "1 (50.00 %)" in the "option c" "table_row"
 217      And I show chart data for the "multichoicesimple" feedback
 218      And I should see "2 (100.00 %)" in the "option e" "table_row"
 219      And I set the field "Filter by course" to "Course 3"
 220      And I press "Filter"
 221      And I show chart data for the "multichoicerated" feedback
 222      And I should see "0" in the "option a" "table_row"
 223      And I should see "0" in the "option b" "table_row"
 224      And I should see "1 (100.00 %)" in the "option c" "table_row"
 225      And I show chart data for the "multichoicesimple" feedback
 226      And I should see "1 (100.00 %)" in the "option d" "table_row"
 227      And I follow "Show all"
 228      And I show chart data for the "multichoicesimple" feedback
 229      And I should see "1 (33.33 %)" in the "option d" "table_row"
 230      And I should see "2 (66.67 %)" in the "option e" "table_row"
 231      And I should see "0" in the "option f" "table_row"
 232      And I log out
 233  
 234    Scenario: Site feedback deletion hides feedback block completely
 235      When I log in as "manager"
 236      And I am on site homepage
 237      And I follow "Turn editing on"
 238      And I add the "Feedback" block
 239      And I click on "Delete" "link" in the "//div[contains(@class,'block_site_main_menu')]//li[contains(.,'Course feedback')]" "xpath_element"
 240      And I press "Yes"
 241      And I follow "Turn editing off"
 242      And I am on site homepage
 243      Then "Feedback" "block" should not exist
 244      And I follow "Course 1"
 245      And "Feedback" "block" should not exist
 246      And I log out


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