[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

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

   1  @tool @tool_recyclebin
   2  Feature: Basic recycle bin functionality
   3    As a teacher
   4    I want be able to recover deleted content and manage the recycle bin content
   5    So that I can fix an accidental deletion and clean the recycle bin
   6  
   7    Background: Course with teacher exists.
   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        | Course 2 | C2 |
  16      And the following "course enrolments" exist:
  17        | user | course | role |
  18        | teacher1 | C1 | editingteacher |
  19      And the following config values are set as admin:
  20        | coursebinenable | 1 | tool_recyclebin |
  21        | categorybinenable | 1 | tool_recyclebin |
  22        | coursebinexpiry | 604800 | tool_recyclebin |
  23        | categorybinexpiry | 1209600 | tool_recyclebin |
  24        | autohide | 0 | tool_recyclebin |
  25  
  26    Scenario: Restore a deleted assignment
  27      Given I log in as "teacher1"
  28      And I follow "Course 1"
  29      And I turn editing mode on
  30      And I add a "Assignment" to section "1" and I fill the form with:
  31        | Assignment name | Test assign |
  32        | Description | Test |
  33      And I delete "Test assign" activity
  34      When I follow "Recycle bin"
  35      Then I should see "Test assign"
  36      And I should see "Contents will be permanently deleted after 7 days"
  37      And I follow "Restore"
  38      And I should see "'Test assign' has been restored"
  39      And I wait to be redirected
  40      And I am on homepage
  41      And I follow "Course 1"
  42      And I should see "Test assign" in the "Topic 1" "section"
  43  
  44    Scenario: Restore a deleted course
  45      Given I log in as "admin"
  46      And I go to the courses management page
  47      And I click on "delete" action for "Course 2" in management course listing
  48      And I press "Delete"
  49      And I should see "Deleting C2"
  50      And I should see "C2 has been completely deleted"
  51      And I press "Continue"
  52      And I go to the courses management page
  53      And I should not see "Course 2" in the "#course-listing" "css_element"
  54      When I follow "Recycle bin"
  55      Then I should see "Course 2"
  56      And I should see "Contents will be permanently deleted after 14 days"
  57      And I follow "Restore"
  58      And I should see "'Course 2' has been restored"
  59      And I wait to be redirected
  60      And I go to the courses management page
  61      And I should see "Course 2" in the "#course-listing" "css_element"
  62  
  63    @javascript
  64    Scenario: Deleting a single item from the recycle bin
  65      Given I log in as "teacher1"
  66      And I follow "Course 1"
  67      And I turn editing mode on
  68      And I add a "Assignment" to section "1" and I fill the form with:
  69        | Assignment name | Test assign |
  70        | Description | Test |
  71      And I delete "Test assign" activity
  72      And I follow "Recycle bin"
  73      When I click on "Delete" "link"
  74      Then I should see "Are you sure you want to delete the selected item from the recycle bin?"
  75      And I press "Cancel"
  76      And I should see "Test assign"
  77      And I click on "Delete" "link"
  78      And I press "Yes"
  79      And I should see "'Test assign' has been deleted"
  80      And I should see "There are no items in the recycle bin."
  81  
  82    @javascript
  83    Scenario: Deleting all the items from the recycle bin
  84      Given I log in as "teacher1"
  85      And I follow "Course 1"
  86      And I turn editing mode on
  87      And I add a "Assignment" to section "1" and I fill the form with:
  88        | Assignment name | Test assign 1 |
  89        | Description | Test 1 |
  90      And I add a "Assignment" to section "1" and I fill the form with:
  91        | Assignment name | Test assign 2 |
  92        | Description | Test 2 |
  93      And I delete "Test assign 1" activity
  94      And I delete "Test assign 2" activity
  95      And I follow "Recycle bin"
  96      And I should see "Test assign 1"
  97      And I should see "Test assign 2"
  98      When I click on "Delete all" "link"
  99      Then I should see "Are you sure you want to delete all items from the recycle bin?"
 100      And I press "Cancel"
 101      And I should see "Test assign 1"
 102      And I should see "Test assign 2"
 103      And I click on "Delete all" "link"
 104      And I press "Yes"
 105      And I should see "Recycle bin has been emptied"
 106      And I should see "There are no items in the recycle bin."


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