AutorÃa | Ultima modificación | Ver Log |
@mod @mod_forum @forumreport @forumreport_summaryFeature: Report relevant content availabilityIn order to view the appropriate report contentAs a teacher or studentI need to have the associated capabilitiesBackground:Given the following "users" exist:| username | firstname | lastname | email || teacher1 | Teacher | 1 | teacher1@example.com || student1 | Student | 1 | student1@example.com || student2 | Student | 2 | student1@example.com |And the following "courses" exist:| fullname | shortname | category || Course 1 | C1 | 0 |And the following "course enrolments" exist:| user | course | role || teacher1 | C1 | editingteacher || student1 | C1 | student || student2 | C1 | student |And the following "activities" exist:| activity | name | course | idnumber || forum | forum1 | C1 | forum1 |And the following forum discussions exist in course "Course 1":| user | forum | name | message | attachments | inlineattachments || teacher1 | forum1 | discussion1 | message 1 | | || student1 | forum1 | discussion2 | message 3 | att1.jpg | in1.jpg || student2 | forum1 | discussion3 | message 4 | att3.jpg | |And the following forum replies exist in course "Course 1":| user | forum | discussion | message | attachments | inlineattachments || student1 | forum1 | discussion1 | reply1 | att4.jpg, att5.jpg | in2.jpg || student2 | forum1 | discussion2 | reply2 | | |@javascriptScenario: Teachers can access report data about other users by defaultGiven I am on the "forum1" "forum activity" page logged in as teacher1And I navigate to "Reports" in current page administrationThen the following should exist in the "forumreport_summary_table" table:| -2- | -3- | -4- | -5- | -6- | -7- | -8- || Student 1 | 1 | 1 | 5 | 0 | 3 | 14 || Student 2 | 1 | 1 | 1 | 0 | 3 | 14 || Teacher 1 | 1 | 0 | 0 | 1 | 2 | 8 |And "select-all-users" "checkbox" should be visibleAnd "First name" "link" should be visibleAnd "Last name" "link" should be visibleAnd "Number of discussions posted" "link" should be visibleAnd "Number of replies posted" "link" should be visibleAnd "Number of attachments" "link" should be visibleAnd "Number of views" "link" should be visibleAnd "Word count" "link" should be visibleAnd "Character count" "link" should be visibleAnd "Earliest post" "link" should be visibleAnd "Most recent post" "link" should be visibleAnd I should see "Export posts"And "Export posts" "link" should not existScenario: Students cannot access the summary report by defaultGiven I am on the "forum1" "forum activity" page logged in as student1Then "Forum summary report" "link" should not exist in current page administration@javascriptScenario: Students given the view capability can only view their own report dataGiven the following "permission overrides" exist:| capability | permission | role | contextlevel | reference || forumreport/summary:view | Allow | student | Course | C1 |When I am on the "forum1" "forum activity" page logged in as student1And I navigate to "Reports" in current page administrationThen the following should exist in the "forumreport_summary_table" table:| -1- | -2- | -3- | -4- | -5- | -6- | -7- || Student 1 | 1 | 1 | 5 | 1 | 3 | 14 |And the following should not exist in the "forumreport_summary_table" table:| -1- || Student 2 || Teacher 1 |And "select-all-users" "checkbox" should not existAnd "First name" "link" should be visibleAnd "Last name" "link" should be visibleAnd "Number of discussions posted" "link" should be visibleAnd "Number of replies posted" "link" should be visibleAnd "Number of attachments" "link" should be visibleAnd "Number of views" "link" should be visibleAnd "Word count" "link" should be visibleAnd "Character count" "link" should be visibleAnd "Earliest post" "link" should be visibleAnd "Most recent post" "link" should be visibleAnd I should not see "Export posts"