Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@mod @mod_forum @forumreport @forumreport_summary
2
Feature: Report relevant content availability
3
  In order to view the appropriate report content
4
  As a teacher or student
5
  I need to have the associated capabilities
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname | email                |
10
      | teacher1 | Teacher   | 1        | teacher1@example.com |
11
      | student1 | Student   | 1        | student1@example.com |
12
      | student2 | Student   | 2        | student1@example.com |
13
    And the following "courses" exist:
14
      | fullname | shortname | category |
15
      | Course 1 | C1        | 0        |
16
    And the following "course enrolments" exist:
17
      | user     | course | role           |
18
      | teacher1 | C1     | editingteacher |
19
      | student1 | C1     | student        |
20
      | student2 | C1     | student        |
21
    And the following "activities" exist:
22
      | activity | name   | course | idnumber |
23
      | forum    | forum1 | C1     | forum1   |
24
    And the following forum discussions exist in course "Course 1":
25
      | user     | forum  | name        | message   | attachments | inlineattachments |
26
      | teacher1 | forum1 | discussion1 | message 1 |             |                   |
27
      | student1 | forum1 | discussion2 | message 3 | att1.jpg    | in1.jpg           |
28
      | student2 | forum1 | discussion3 | message 4 | att3.jpg    |                   |
29
    And the following forum replies exist in course "Course 1":
30
      | user     | forum  | discussion  | message | attachments        | inlineattachments |
31
      | student1 | forum1 | discussion1 | reply1  | att4.jpg, att5.jpg | in2.jpg           |
32
      | student2 | forum1 | discussion2 | reply2  |                    |                   |
33
 
34
  @javascript
35
  Scenario: Teachers can access report data about other users by default
36
    Given I am on the "forum1" "forum activity" page logged in as teacher1
37
    And I navigate to "Reports" in current page administration
38
    Then the following should exist in the "forumreport_summary_table" table:
39
      | -2-       | -3- | -4- | -5- | -6- | -7- | -8- |
40
      | Student 1 | 1   | 1   | 5   | 0   | 3   | 14  |
41
      | Student 2 | 1   | 1   | 1   | 0   | 3   | 14  |
42
      | Teacher 1 | 1   | 0   | 0   | 1   | 2   | 8   |
43
    And "select-all-users" "checkbox" should be visible
44
    And "First name" "link" should be visible
45
    And "Last name" "link" should be visible
46
    And "Number of discussions posted" "link" should be visible
47
    And "Number of replies posted" "link" should be visible
48
    And "Number of attachments" "link" should be visible
49
    And "Number of views" "link" should be visible
50
    And "Word count" "link" should be visible
51
    And "Character count" "link" should be visible
52
    And "Earliest post" "link" should be visible
53
    And "Most recent post" "link" should be visible
54
    And I should see "Export posts"
55
    And "Export posts" "link" should not exist
56
 
57
  Scenario: Students cannot access the summary report by default
58
    Given I am on the "forum1" "forum activity" page logged in as student1
59
    Then "Forum summary report" "link" should not exist in current page administration
60
 
61
  @javascript
62
  Scenario: Students given the view capability can only view their own report data
63
    Given the following "permission overrides" exist:
64
      | capability               | permission | role    | contextlevel | reference |
65
      | forumreport/summary:view | Allow      | student | Course       | C1        |
66
    When I am on the "forum1" "forum activity" page logged in as student1
67
    And I navigate to "Reports" in current page administration
68
    Then the following should exist in the "forumreport_summary_table" table:
69
      | -1-       | -2- | -3- | -4- | -5- | -6- | -7- |
70
      | Student 1 | 1   | 1   | 5   | 1   | 3   | 14  |
71
    And the following should not exist in the "forumreport_summary_table" table:
72
      | -1-       |
73
      | Student 2 |
74
      | Teacher 1 |
75
    And "select-all-users" "checkbox" should not exist
76
    And "First name" "link" should be visible
77
    And "Last name" "link" should be visible
78
    And "Number of discussions posted" "link" should be visible
79
    And "Number of replies posted" "link" should be visible
80
    And "Number of attachments" "link" should be visible
81
    And "Number of views" "link" should be visible
82
    And "Word count" "link" should be visible
83
    And "Character count" "link" should be visible
84
    And "Earliest post" "link" should be visible
85
    And "Most recent post" "link" should be visible
86
    And I should not see "Export posts"