[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/mod/quiz/tests/behat/ -> editing_move_by_click.feature (source)

   1  @mod @mod_quiz
   2  Feature: Edit quiz page - drag-and-drop
   3    In order to change the layout of a quiz I built
   4    As a teacher
   5    I need to be able to drag and drop questions to reorder them.
   6  
   7    Background:
   8      Given the following "users" exist:
   9        | username | firstname | lastname | email                |
  10        | teacher1 | T1        | Teacher1 | teacher1@example.com |
  11      And the following "courses" exist:
  12        | fullname | shortname | category |
  13        | Course 1 | C1        | 0        |
  14      And the following "course enrolments" exist:
  15        | user     | course | role           |
  16        | teacher1 | C1     | editingteacher |
  17      And the following "question categories" exist:
  18        | contextlevel | reference | name           |
  19        | Course       | C1        | Test questions |
  20      And the following "questions" exist:
  21        | questioncategory | qtype     | name       | questiontext        |
  22        | Test questions   | truefalse | Question A | This is question 01 |
  23        | Test questions   | truefalse | Question B | This is question 02 |
  24        | Test questions   | truefalse | Question C | This is question 03 |
  25      And the following "activities" exist:
  26        | activity   | name   | course | idnumber |
  27        | quiz       | Quiz 1 | C1     | quiz1    |
  28      And quiz "Quiz 1" contains the following questions:
  29        | question   | page |
  30        | Question A | 1    |
  31        | Question B | 1    |
  32        | Question C | 2    |
  33      And I log in as "teacher1"
  34      And I follow "Course 1"
  35      And I follow "Quiz 1"
  36      And I follow "Edit quiz"
  37  
  38    @javascript
  39    Scenario: Re-order questions by clicking on the move icon.
  40      Then I should see "Question A" on quiz page "1"
  41      And I should see "Question B" on quiz page "1"
  42      And I should see "Question C" on quiz page "2"
  43  
  44      When I move "Question A" to "After Question 2" in the quiz by clicking the move icon
  45      Then I should see "Question B" on quiz page "1"
  46      And I should see "Question A" on quiz page "1"
  47      And I should see "Question B" before "Question A" on the edit quiz page
  48      And I should see "Question C" on quiz page "2"
  49  
  50      When I move "Question A" to "After Page 2" in the quiz by clicking the move icon
  51      Then I should see "Question B" on quiz page "1"
  52      And I should see "Question A" on quiz page "2"
  53      And I should see "Question C" on quiz page "2"
  54      And I should see "Question A" before "Question C" on the edit quiz page
  55  
  56      When I move "Question B" to "After Question 2" in the quiz by clicking the move icon
  57      Then I should see "Question A" on quiz page "1"
  58      And I should see "Question B" on quiz page "1"
  59      And I should see "Question C" on quiz page "1"
  60      And I should see "Question A" before "Question B" on the edit quiz page
  61      And I should see "Question B" before "Question C" on the edit quiz page
  62  
  63      When I move "Question B" to "After Page 1" in the quiz by clicking the move icon
  64      Then I should see "Question B" on quiz page "1"
  65      And I should see "Question A" on quiz page "1"
  66      And I should see "Question C" on quiz page "1"
  67      And I should see "Question B" before "Question A" on the edit quiz page
  68      And I should see "Question A" before "Question C" on the edit quiz page
  69  
  70      When I click on the "Add" page break icon after question "Question A"
  71      When I open the "Page 2" add to quiz menu
  72      And I follow "a new question" in the open menu
  73      And I set the field "qtype_qtype_description" to "1"
  74      And I press "submitbutton"
  75      Then I should see "Adding a description"
  76      And I set the following fields to these values:
  77        | Question name | Question D  |
  78        | Question text | Useful info |
  79      And I press "id_submitbutton"
  80      Then I should see "Question B" on quiz page "1"
  81      And I should see "Question A" on quiz page "1"
  82      And I should see "Question C" on quiz page "2"
  83      And I should see "Question D" on quiz page "2"
  84      And I should see "Question B" before "Question A" on the edit quiz page
  85      And I should see "Question C" before "Question D" on the edit quiz page
  86  
  87      And "Question B" should have number "1" on the edit quiz page
  88      And "Question A" should have number "2" on the edit quiz page
  89      And "Question C" should have number "3" on the edit quiz page
  90      And "Question D" should have number "i" on the edit quiz page
  91  
  92      When I move "Question D" to "After Question 2" in the quiz by clicking the move icon
  93      Then I should see "Question B" on quiz page "1"
  94      And I should see "Question D" on quiz page "1"
  95      And I should see "Question A" on quiz page "1"
  96      And I should see "Question C" on quiz page "2"
  97      And I should see "Question B" before "Question A" on the edit quiz page
  98      And I should see "Question A" before "Question D" on the edit quiz page
  99  
 100      And "Question B" should have number "1" on the edit quiz page
 101      And "Question D" should have number "i" on the edit quiz page
 102      And "Question A" should have number "2" on the edit quiz page
 103      And "Question C" should have number "3" on the edit quiz page


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