Ir a la última revisión | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |
@tool @tool_recyclebinFeature: Basic recycle bin functionalityAs a teacherI want be able to recover deleted content and manage the recycle bin contentSo that I can fix an accidental deletion and clean the recycle binBackground: Course with teacher exists.Given the following "users" exist:| username | firstname | lastname | email || teacher1 | Teacher | 1 | teacher@asd.com || student1 | Student | 1 | student@asd.com || student2 | Student | 2 | student2@asd.com |And the following "courses" exist:| fullname | shortname | initsections || Course 1 | C1 | 1 || Course 2 | C2 | 0 |And the following "activities" exist:| activity | course | section | name | intro || assign | C1 | 1 | Test assign 1 | Test 1 || assign | C1 | 1 | Test assign 2 | Test 2 |And the following "course enrolments" exist:| user | course | role || teacher1 | C1 | editingteacher || student1 | C1 | student || student2 | C1 | student || teacher1 | C2 | editingteacher || student1 | C2 | student || student2 | C2 | student |And the following "groups" exist:| name | course | idnumber || Group A | C2 | G1 || Group B | C2 | G2 || Group C | C2 | G3 |And the following "group members" exist:| user | group || teacher1 | G1 || teacher1 | G2 || student1 | G1 || student2 | G1 || student2 | G2 |And the following config values are set as admin:| coursebinenable | 1 | tool_recyclebin || categorybinenable | 1 | tool_recyclebin || coursebinexpiry | 604800 | tool_recyclebin || categorybinexpiry | 1209600 | tool_recyclebin || autohide | 0 | tool_recyclebin |Scenario: Restore a deleted assignmentGiven I log in as "teacher1"And I am on "Course 1" course homepage with editing mode onAnd I delete "Test assign 1" activityWhen I navigate to "Recycle bin" in current page administrationThen I should see "Test assign 1"And I should see "Contents will be permanently deleted after 7 days"And I click on "Restore" "link" in the "region-main" "region"And I should see "'Test assign 1' has been restored"And I wait to be redirectedAnd I am on "Course 1" course homepageAnd I should see "Test assign 1" in the "Section 1" "section"@javascriptScenario: Restore a deleted courseGiven I log in as "admin"And I go to the courses management pageAnd I click on "delete" action for "Course 2" in management course listingAnd I press "Delete"And I should see "Deleting C2"And I should see "C2 has been completely deleted"And I press "Continue"And I am on course indexAnd I should see "Course 1"And I should not see "Course 2"When I navigate to "Recycle bin" in current page administrationThen I should see "Course 2"And I should see "Contents will be permanently deleted after 14 days"And I click on "Restore" "link" in the "region-main" "region"And I should see "'Course 2' has been restored"And I wait to be redirectedAnd I go to the courses management pageAnd I should see "Course 2" in the "#course-listing" "css_element"And I am on the "Course 2" "groups overview" pageAnd "Student 1" "text" should exist in the "Group A" "table_row"And "Student 2" "text" should exist in the "Group A" "table_row"And "Student 2" "text" should exist in the "Group B" "table_row"@javascriptScenario: Deleting a single item from the recycle binGiven I log in as "teacher1"And I am on "Course 1" course homepage with editing mode onAnd I delete "Test assign 1" activityAnd I run all adhoc tasksAnd I navigate to "Recycle bin" in current page administrationWhen I click on "Delete" "link"Then I should see "Are you sure you want to delete the selected item from the recycle bin?"And I click on "Cancel" "button" in the "Confirmation" "dialogue"And I should see "Test assign 1"And I click on "Delete" "link"And I press "Yes"And I should see "'Test assign 1' has been deleted"And I should see "There are no items in the recycle bin."@javascriptScenario: Deleting all the items from the recycle binGiven I log in as "teacher1"And I am on "Course 1" course homepage with editing mode onAnd I delete "Test assign 1" activityAnd I delete "Test assign 2" activityAnd I run all adhoc tasksAnd I navigate to "Recycle bin" in current page administrationAnd I should see "Test assign 1"And I should see "Test assign 2"When I click on "Delete all" "link"Then I should see "Are you sure you want to delete all items from the recycle bin?"And I click on "Cancel" "button" in the "Confirmation" "dialogue"And I should see "Test assign 1"And I should see "Test assign 2"And I click on "Delete all" "link"And I press "Yes"And I should see "Recycle bin has been emptied"And I should see "There are no items in the recycle bin."@javascriptScenario: Show recycle bin on category action menuGiven I log in as "admin"And I navigate to "Courses > Manage courses and categories" in site administrationAnd I navigate to "Recycle bin" in current page administrationThen I should see "There are no items in the recycle bin."@javascriptScenario: Not show recycle bin empty on category action menu whit autohide enableGiven I log in as "admin"And the following config values are set as admin:| categorybinenable | 0 | tool_recyclebin |And I navigate to "Courses > Manage courses and categories" in site administrationAnd I click on "Actions menu" "link"Then I should not see "Recycle bin"@javascriptScenario: Show recycle bin not empty on category action menu whit autohide enableGiven I log in as "admin"And the following config values are set as admin:| autohide | 1 | tool_recyclebin |And I navigate to "Courses > Manage courses and categories" in site administrationAnd I click on "Actions menu" "link"Then I should not see "Recycle bin"And I click on "delete" action for "Course 2" in management course listingAnd I press "Delete"And I should see "Deleting C2"And I should see "C2 has been completely deleted"And I press "Continue"When I click on "Actions menu" "link"Then I should see "Recycle bin"