AutorÃa | Ultima modificación | Ver Log |
@block @block_recent_activityFeature: View structural changes in recent activity blockIn order to know when activities were changedAs a userIn need to see the structural changes in recent activity blockBackground:Given the following "courses" exist:| fullname | shortname | category || Course 1 | C1 | 0 |And the following "users" exist:| username | firstname | lastname | email || teacher1 | Terry1 | Teacher1 | teacher1@example.com || assistant1 | Terry2 | Teacher2 | teacher2@example.com || student1 | Sam1 | Student1 | student1@example.com || student2 | Sam2 | Student2 | student2@example.com || student3 | Sam3 | Student3 | student3@example.com |And the following "course enrolments" exist:| user | course | role || teacher1 | C1 | editingteacher || assistant1 | C1 | teacher || student1 | C1 | student || student2 | C1 | student || student3 | C1 | student |And the following "groups" exist:| name | course | idnumber || Group 1 | C1 | G1 || Group 2 | C1 | G2 |And the following "groupings" exist:| name | course | idnumber || Grouping 1 | C1 | GG1 || Grouping 2 | C1 | GG2 || Grouping 3 | C1 | GG3 |And the following "group members" exist:| user | group || student1 | G1 || student2 | G2 || student3 | G1 || student3 | G2 || assistant1 | G1 |And the following "grouping groups" exist:| grouping | group || GG1 | G1 || GG2 | G2 || GG3 | G1 || GG3 | G2 |Scenario: Check that Added module information is displayed respecting view capabilityGiven the following "activities" exist:| activity | course | name | idnumber | groupmode | grouping | visible || forum | C1 | ForumVisibleGroups | forum1 | 2 | | 1 || forum | C1 | ForumSeparateGroups | forum2 | 1 | | 1 || forum | C1 | ForumHidden | forum3 | 1 | | 0 || forum | C1 | ForumNoGroups | forum4 | 0 | | 1 || forum | C1 | ForumVisibleGroupsG1 | forum5 | 2 | GG1 | 1 || forum | C1 | ForumSeparateGroupsG1 | forum6 | 1 | GG1 | 1 || forum | C1 | ForumVisibleGroupsG2 | forum7 | 2 | GG2 | 1 || forum | C1 | ForumSeparateGroupsG2 | forum8 | 1 | GG2 | 1 |And I am on the "ForumVisibleGroupsG1" "forum activity editing" page logged in as teacher1And I set the following fields to these values:| Access restrictions | Grouping: Grouping 1 |And I press "Save and return to course"And I am on the "ForumSeparateGroupsG1" "forum activity editing" pageAnd I set the following fields to these values:| Access restrictions | Grouping: Grouping 1 |And I press "Save and return to course"And I am on the "ForumVisibleGroupsG2" "forum activity editing" pageAnd I set the following fields to these values:| Access restrictions | Grouping: Grouping 2 |And I press "Save and return to course"And I am on the "ForumSeparateGroupsG2" "forum activity editing" pageAnd I set the following fields to these values:| Access restrictions | Grouping: Grouping 2 |And I press "Save and return to course"And I am on "Course 1" course homepage with editing mode onWhen I add the "Recent activity" blockThen I should see "ForumVisibleGroups" in the "Recent activity" "block"And I should see "ForumSeparateGroups" in the "Recent activity" "block"And I should see "ForumNoGroups" in the "Recent activity" "block"And I should see "ForumHidden" in the "Recent activity" "block"And I should see "ForumVisibleGroupsG1" in the "Recent activity" "block"And I should see "ForumSeparateGroupsG1" in the "Recent activity" "block"And I should see "ForumVisibleGroupsG2" in the "Recent activity" "block"And I should see "ForumSeparateGroupsG2" in the "Recent activity" "block"And I am on the "Course 1" course page logged in as student1And I should see "ForumVisibleGroups" in the "Recent activity" "block"And I should see "ForumSeparateGroups" in the "Recent activity" "block"And I should see "ForumNoGroups" in the "Recent activity" "block"And I should not see "ForumHidden" in the "Recent activity" "block"And I should see "ForumVisibleGroupsG1" in the "Recent activity" "block"And I should see "ForumSeparateGroupsG1" in the "Recent activity" "block"And I should not see "ForumVisibleGroupsG2" in the "Recent activity" "block"And I should not see "ForumSeparateGroupsG2" in the "Recent activity" "block"And I am on the "Course 1" course page logged in as student2And I should see "ForumVisibleGroups" in the "Recent activity" "block"And I should see "ForumSeparateGroups" in the "Recent activity" "block"And I should see "ForumNoGroups" in the "Recent activity" "block"And I should not see "ForumHidden" in the "Recent activity" "block"And I should not see "ForumVisibleGroupsG1" in the "Recent activity" "block"And I should not see "ForumSeparateGroupsG1" in the "Recent activity" "block"And I should see "ForumVisibleGroupsG2" in the "Recent activity" "block"And I should see "ForumSeparateGroupsG2" in the "Recent activity" "block"And I am on the "Course 1" course page logged in as student3And I should see "ForumVisibleGroups" in the "Recent activity" "block"And I should see "ForumSeparateGroups" in the "Recent activity" "block"And I should see "ForumNoGroups" in the "Recent activity" "block"And I should not see "ForumHidden" in the "Recent activity" "block"And I should see "ForumVisibleGroupsG1" in the "Recent activity" "block"And I should see "ForumSeparateGroupsG1" in the "Recent activity" "block"And I should see "ForumVisibleGroupsG2" in the "Recent activity" "block"And I should see "ForumSeparateGroupsG2" in the "Recent activity" "block"# Teachers have capability to see all groups and hidden activitiesAnd I am on the "Course 1" course page logged in as assistant1And I should see "ForumHidden" in the "Recent activity" "block"And I should see "ForumVisibleGroupsG1" in the "Recent activity" "block"And I should see "ForumSeparateGroupsG1" in the "Recent activity" "block"And I should see "ForumVisibleGroupsG2" in the "Recent activity" "block"And I should see "ForumSeparateGroupsG2" in the "Recent activity" "block"Scenario: Updates and deletes in recent activity blockGiven the following "activity" exists:| activity | forum || course | C1 || idnumber | forum1 || name | ForumNew |When I log in as "teacher1"And I am on "Course 1" course homepage with editing mode onAnd I add the "Recent activity" blockThen I should see "Added Forum" in the "Recent activity" "block"And I should see "ForumNew" in the "Recent activity" "block"And I log out# Update forum as a teacher after a second to ensure we have a new timestamp for recent activity.And I wait "1" secondsAnd I am on the "Course 1" course page logged in as student1And I should see "Added Forum" in the "Recent activity" "block"And I should see "ForumNew" in the "Recent activity" "block"And I log out# Update forum as a teacher after a second to ensure we have a new timestamp for recent activity.And I wait "1" seconds# Update forum as a teacherAnd I am on the "ForumNew" "forum activity editing" page logged in as teacher1And I set the following fields to these values:| name | ForumUpdated |And I press "Save and return to course"And I log outAnd I wait "1" seconds# Student 1 already saw that forum was created, now he can see that forum was updatedAnd I am on the "Course 1" course page logged in as student1And I should not see "Added Forum" in the "Recent activity" "block"And I should not see "ForumNew" in the "Recent activity" "block"And I should see "Updated Forum" in the "Recent activity" "block"And I should see "ForumUpdated" in the "Recent activity" "block"And I log outAnd I wait "1" seconds# Student 2 has bigger interval and he can see one entry that forum was created but with the new nameAnd I am on the "Course 1" course page logged in as student2And I should see "Added Forum" in the "Recent activity" "block"And I should not see "ForumNew" in the "Recent activity" "block"And I should not see "Updated Forum" in the "Recent activity" "block"And I should see "ForumUpdated" in the "Recent activity" "block"And I log outAnd I wait "1" seconds# Delete forum as a teacherAnd I log in as "teacher1"And I am on "Course 1" course homepage with editing mode onAnd I delete "ForumUpdated" activityAnd I run all adhoc tasksAnd I log outAnd I wait "1" seconds# Students 1 and 2 see that forum was deletedAnd I am on the "Course 1" course page logged in as student1And I should not see "Added Forum" in the "Recent activity" "block"And I should not see "ForumNew" in the "Recent activity" "block"And I should not see "Updated Forum" in the "Recent activity" "block"And I should not see "ForumUpdated" in the "Recent activity" "block"And I should see "Deleted Forum" in the "Recent activity" "block"And I log outAnd I wait "1" seconds# Student 3 never knew that forum was created, so he does not see anythingAnd I am on the "Course 1" course page logged in as student3And I should not see "Added Forum" in the "Recent activity" "block"And I should not see "ForumNew" in the "Recent activity" "block"And I should not see "Updated Forum" in the "Recent activity" "block"And I should not see "ForumUpdated" in the "Recent activity" "block"And I should not see "Deleted Forum" in the "Recent activity" "block"