[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/admin/tool/recyclebin/tests/behat/ -> backup_user_data.feature (source)

   1  @tool @tool_recyclebin
   2  Feature: Backup user data
   3    As a teacher
   4    I want user data to be backed up when I delete a course module
   5    So that I can recover student content
   6  
   7    Background: Course with teacher and student exist.
   8      Given the following "users" exist:
   9        | username | firstname | lastname | email |
  10        | teacher1 | Teacher | 1 | teacher@asd.com |
  11        | student1 | Student | 1 | student@asd.com |
  12      And the following "courses" exist:
  13        | fullname | shortname |
  14        | Course 1 | C1 |
  15      And the following "course enrolments" exist:
  16        | user | course | role |
  17        | teacher1 | C1 | editingteacher |
  18        | student1 | C1 | student |
  19      And the following config values are set as admin:
  20        | coursebinenable | 1 | tool_recyclebin |
  21        | autohide | 0 | tool_recyclebin |
  22  
  23    @javascript
  24    Scenario: Delete and restore a quiz with user data
  25      Given I log in as "teacher1"
  26      And I follow "Course 1"
  27      And I turn editing mode on
  28      And I add a "Quiz" to section "1" and I fill the form with:
  29        | Name        | Quiz 1                |
  30        | Description | Test quiz description |
  31      And I add a "True/False" question to the "Quiz 1" quiz with:
  32        | Question name                      | TF1                          |
  33        | Question text                      | First question               |
  34        | General feedback                   | Thank you, this is the general feedback |
  35        | Correct answer                     | False                                   |
  36        | Feedback for the response 'True'.  | So you think it is true                 |
  37        | Feedback for the response 'False'. | So you think it is false                |
  38      And I add a "True/False" question to the "Quiz 1" quiz with:
  39        | Question name                      | TF2                                     |
  40        | Question text                      | Second question                         |
  41        | General feedback                   | Thank you, this is the general feedback |
  42        | Correct answer                     | False                                   |
  43        | Feedback for the response 'True'.  | So you think it is true                 |
  44        | Feedback for the response 'False'. | So you think it is false                |
  45      And I log out
  46      And I log in as "student1"
  47      And I follow "Course 1"
  48      And I follow "Quiz 1"
  49      And I press "Attempt quiz now"
  50      And I click on "True" "radio" in the "First question" "question"
  51      And I click on "False" "radio" in the "Second question" "question"
  52      And I press "Finish attempt"
  53      And I press "Submit all and finish"
  54      And I click on "Submit all and finish" "button" in the "Confirmation" "dialogue"
  55      And I should see "5.00 out of 10.00"
  56      And I log out
  57      And I log in as "teacher1"
  58      And I follow "Course 1"
  59      And I turn editing mode on
  60      And I delete "Quiz 1" activity
  61      And I follow "Recycle bin"
  62      And I should see "Quiz 1"
  63      And I follow "Restore"
  64      And I log out
  65      And I log in as "student1"
  66      And I follow "Course 1"
  67      When I navigate to "Grades" node in "Course administration"
  68      Then "Quiz 1" row "Grade" column of "user-grade" table should contain "5"
  69      And "Quiz 1" row "Percentage" column of "user-grade" table should contain "50"


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