[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

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

   1  @mod @mod_feedback
   2  Feature: Exporting and importing feedbacks
   3    In order to quickly copy feedbacks across courses and sites
   4    As a teacher
   5    I need to be able to export and import feedbacks
   6  
   7    Background:
   8      Given the following "users" exist:
   9        | username | firstname | lastname |
  10        | teacher | Teacher   | 1        |
  11      And the following "courses" exist:
  12        | fullname | shortname |
  13        | Course 1 | C1        |
  14        | Course 2 | C2        |
  15      And the following "course enrolments" exist:
  16        | user     | course | role           |
  17        | teacher | C1     | editingteacher |
  18        | teacher | C1     | editingteacher |
  19      And the following "activities" exist:
  20        | activity   | name                | course | idnumber    |
  21        | feedback   | Learning experience | C1     | feedback0   |
  22  
  23    Scenario: Export sample feedback and compare with the fixture
  24      When I log in as "teacher"
  25      And I follow "Course 1"
  26      And I follow "Learning experience"
  27      And I follow "Edit questions"
  28      And I add a "Information" question to the feedback with:
  29        | Question         | this is an information question |
  30        | Label            | info                            |
  31        | Information type | Course                          |
  32      And I add a "Label" question to the feedback with:
  33        | Contents | label text |
  34      And I add a "Longer text answer" question to the feedback with:
  35        | Question         | this is a longer text answer |
  36        | Label            | longertext                   |
  37        | Required         | 1                            |
  38      And I add a "Multiple choice" question to the feedback with:
  39        | Question         | this is a multiple choice 1 |
  40        | Label            | multichoice1                |
  41        | Multiple choice type | Multiple choice - single answer |
  42        | Multiple choice values | option a\noption b\noption c  |
  43      And I select "Add a page break" from the "Add question" singleselect
  44      And I add a "Multiple choice" question to the feedback with:
  45        | Question                       | this is a multiple choice 2        |
  46        | Label                          | multichoice2                       |
  47        | Multiple choice type           | Multiple choice - multiple answers |
  48        | Hide the "Not selected" option | Yes                                |
  49        | Multiple choice values         | option d\noption e\noption f       |
  50        | Dependence item                | multichoice1                       |
  51        | Dependence value               | option a                           |
  52      And I add a "Multiple choice" question to the feedback with:
  53        | Question                       | this is a multiple choice 3        |
  54        | Label                          | multichoice3                       |
  55        | Multiple choice type           | Multiple choice - single answer allowed (dropdownlist) |
  56        | Multiple choice values         | option g\noption h\noption i                           |
  57      And I add a "Multiple choice (rated)" question to the feedback with:
  58        | Question               | this is a multiple choice rated |
  59        | Label                  | multichoice4                    |
  60        | Multiple choice type   | Multiple choice - single answer |
  61        | Multiple choice values | 0/option k\n1/option l\n5/option m |
  62      And I add a "Numeric answer" question to the feedback with:
  63        | Question               | this is a numeric answer |
  64        | Label                  | numeric                  |
  65        | Range to               | 100                      |
  66      And I add a "Short text answer" question to the feedback with:
  67        | Question               | this is a short text answer |
  68        | Label                  | shorttext                   |
  69        | Maximum characters accepted | 200                    |
  70      And I follow "Templates"
  71      Then following "Export questions" should export feedback identical to "mod/feedback/tests/fixtures/testexport.xml"
  72      And I log out
  73  
  74    @javascript @_file_upload
  75    Scenario: Import feedback deleting old items
  76      When I log in as "teacher"
  77      And I follow "Course 1"
  78      And I follow "Learning experience"
  79      And I follow "Edit questions"
  80      And I add a "Numeric answer" question to the feedback with:
  81        | Question               | Existing question |
  82        | Label                  | numeric           |
  83        | Range to               | 100               |
  84      And I follow "Templates"
  85      And I follow "Import questions"
  86      And I upload "mod/feedback/tests/fixtures/testexport.xml" file to "File" filemanager
  87      And I press "Yes"
  88      And I follow "Edit questions"
  89      Then I should not see "Existing question"
  90      And I should see "this is an information question"
  91      And I should see "label text"
  92      And I should see "this is a longer text answer"
  93      And I should see "this is a multiple choice 1"
  94      And I should see "this is a multiple choice 2"
  95      And I should see "this is a multiple choice 3"
  96      And I should see "this is a multiple choice rated"
  97      And I should see "this is a numeric answer"
  98      And I should see "this is a short text answer"
  99      And I log out
 100  
 101    @javascript @_file_upload
 102    Scenario: Import feedback appending new items
 103      When I log in as "teacher"
 104      And I follow "Course 1"
 105      And I follow "Learning experience"
 106      And I follow "Edit questions"
 107      And I add a "Numeric answer" question to the feedback with:
 108        | Question               | Existing question |
 109        | Label                  | numeric           |
 110        | Range to               | 100               |
 111      And I follow "Templates"
 112      And I follow "Import questions"
 113      And I set the field "Append new items" to "1"
 114      And I upload "mod/feedback/tests/fixtures/testexport.xml" file to "File" filemanager
 115      And I press "Yes"
 116      And I follow "Edit questions"
 117      Then I should see "Existing question"
 118      And "Existing question" "text" should appear before "this is an information question" "text"
 119      And I should see "this is an information question"
 120      And I should see "label text"
 121      And I should see "this is a longer text answer"
 122      And I should see "this is a multiple choice 1"
 123      And I should see "this is a multiple choice 2"
 124      And I should see "this is a multiple choice 3"
 125      And I should see "this is a multiple choice rated"
 126      And I should see "this is a numeric answer"
 127      And I should see "this is a short text answer"
 128      And I log out


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