forum_subscriptions_availability.feature 5.97 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
@mod @mod_forum
Feature: As a teacher I need to see an accurate list of subscribed users
  In order to see who is subscribed to a forum
  As a teacher
  I need to view the list of subscribed users

  Background:
    Given the following "users" exist:
      | username | firstname | lastname | email |
      | teacher  | Teacher   | Teacher  | teacher@example.com |
      | student1 | Student   | 1        | student.1@example.com |
      | student2 | Student   | 2        | student.2@example.com |
      | student3 | Student   | 3        | student.3@example.com |
    And the following "courses" exist:
      | fullname | shortname | category |
      | Course 1 | C1 | 0 |
    And the following "course enrolments" exist:
      | user | course | role |
      | teacher  | C1 | editingteacher |
      | 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 "group members" exist:
      | user        | group |
      | student1    | G1    |
      | student2    | G2    |
    And the following "groupings" exist:
      | name        | course | idnumber |
      | Grouping 1  | C1     | GG1      |
    And the following "grouping groups" exist:
      | grouping | group |
      | GG1      | G1    |
    And I log in as "teacher"
38
    And I am on "Course 1" course homepage with editing mode on
39
40
41
42
43
44
45
46
47

  @javascript
  Scenario: A forced forum lists all subscribers
    When I add a "Forum" to section "1" and I fill the form with:
      | Forum name        | Forced Forum 1 |
      | Forum type        | Standard forum for general use |
      | Description       | Test forum description |
      | Subscription mode | Forced subscription |
    And I follow "Forced Forum 1"
48
    And I navigate to "Show/edit current subscribers" in current page administration
49
50
51
52
    Then I should see "Student 1"
    And I should see "Teacher Teacher"
    And I should see "Student 2"
    And I should see "Student 3"
53
54
    And I follow "Forced Forum 1"
    And I navigate to "Edit settings" in current page administration
55
56
57
58
59
    And I expand all fieldsets
    And I click on "Add restriction..." "button"
    And I click on "Grouping" "button" in the "Add restriction..." "dialogue"
    And I set the field with xpath "//select[@name='id']" to "Grouping 1"
    And I press "Save and display"
60
    And I navigate to "Show/edit current subscribers" in current page administration
61
62
63
64
65
    And I should see "Student 1"
    And I should see "Teacher Teacher"
    And I should not see "Student 2"
    And I should not see "Student 3"

66
  Scenario: A forced forum does not allow to edit the subscribers
ilya's avatar
ilya committed
67
68
69
70
71
72
73
74
75
76
77
78
    Given the following "activity" exists:
      | activity    | forum                          |
      | name        | Forced Forum 2                 |
      | intro       | Test forum description         |
      | type        | general                        |
      | course      | C1                             |
      | idnumber    | 0001                           |
      | section     | 1                              |
    And I am on "Course 1" course homepage
    And I follow "Forced Forum 2"
    And I navigate to "Edit settings" in current page administration
    And I set the following fields to these values:
79
      | Subscription mode | Forced subscription |
80
      | Availability      | Show on course page |
ilya's avatar
ilya committed
81
    And I press "Save and return to course"
82
    And I follow "Forced Forum 2"
83
    And I navigate to "Show/edit current subscribers" in current page administration
84
85
86
87
    Then I should see "Teacher Teacher"
    And I should see "Student 1"
    And I should see "Student 2"
    And I should see "Student 3"
88
    And I should not see "Manage subscribers"
89
90

  Scenario: A forced and hidden forum lists only teachers
ilya's avatar
ilya committed
91
92
93
94
95
96
97
98
99
100
101
102
    Given the following "activity" exists:
      | activity    | forum                          |
      | name        | Forced Forum 2                 |
      | intro       | Test forum description         |
      | type        | general                        |
      | course      | C1                             |
      | idnumber    | 0001                           |
      | section     | 1                              |
    And I am on "Course 1" course homepage
    And I follow "Forced Forum 2"
    And I navigate to "Edit settings" in current page administration
    And I set the following fields to these values:
103
      | Subscription mode | Forced subscription |
104
      | Availability      | Hide from students |
ilya's avatar
ilya committed
105
    And I press "Save and return to course"
106
    And I follow "Forced Forum 2"
107
    And I navigate to "Show/edit current subscribers" in current page administration
108
109
110
111
112
    Then I should see "Teacher Teacher"
    And I should not see "Student 1"
    And I should not see "Student 2"
    And I should not see "Student 3"

113
114
115
116
117
118
119
120
  @javascript
  Scenario: An automatic forum lists all subscribers
    When I add a "Forum" to section "1" and I fill the form with:
      | Forum name        | Forced Forum 1 |
      | Forum type        | Standard forum for general use |
      | Description       | Test forum description |
      | Subscription mode | Auto subscription |
    And I follow "Forced Forum 1"
121
    And I navigate to "Show/edit current subscribers" in current page administration
122
123
124
125
    Then I should see "Student 1"
    And I should see "Teacher Teacher"
    And I should see "Student 2"
    And I should see "Student 3"
126
127
    And I follow "Forced Forum 1"
    And I navigate to "Edit settings" in current page administration
128
129
130
131
132
    And I expand all fieldsets
    And I click on "Add restriction..." "button"
    And I click on "Grouping" "button" in the "Add restriction..." "dialogue"
    And I set the field with xpath "//select[@name='id']" to "Grouping 1"
    And I press "Save and display"
133
    And I navigate to "Show/edit current subscribers" in current page administration
134
135
136
137
    And I should see "Student 1"
    And I should see "Teacher Teacher"
    And I should not see "Student 2"
    And I should not see "Student 3"