MDL-59983 lang: Fix Forum behat scenarios to use the new strings
[moodle.git] / mod / forum / tests / behat / forum_subscriptions_availability.feature
CommitLineData
c87b87e6
AN
1@mod @mod_forum
2Feature: As a teacher I need to see an accurate list of subscribed users
3 In order to see who is subscribed to a forum
4 As a teacher
5 I need to view the list of subscribed users
6
7 Background:
8 Given the following "users" exist:
9 | username | firstname | lastname | email |
10 | teacher | Teacher | Teacher | teacher@example.com |
11 | student1 | Student | 1 | student.1@example.com |
12 | student2 | Student | 2 | student.2@example.com |
13 | student3 | Student | 3 | student.3@example.com |
14 And the following "courses" exist:
15 | fullname | shortname | category |
16 | Course 1 | C1 | 0 |
17 And the following "course enrolments" exist:
18 | user | course | role |
19 | teacher | C1 | editingteacher |
20 | student1 | C1 | student |
21 | student2 | C1 | student |
22 | student3 | C1 | student |
23 And the following "groups" exist:
24 | name | course | idnumber |
25 | Group 1 | C1 | G1 |
26 | Group 2 | C1 | G2 |
27 And the following "group members" exist:
28 | user | group |
29 | student1 | G1 |
30 | student2 | G2 |
31 And the following "groupings" exist:
32 | name | course | idnumber |
33 | Grouping 1 | C1 | GG1 |
34 And the following "grouping groups" exist:
35 | grouping | group |
36 | GG1 | G1 |
c87b87e6 37 And I log in as "teacher"
fdeeaff9 38 And I am on "Course 1" course homepage with editing mode on
c87b87e6
AN
39
40 @javascript
41 Scenario: A forced forum lists all subscribers
42 When I add a "Forum" to section "1" and I fill the form with:
43 | Forum name | Forced Forum 1 |
44 | Forum type | Standard forum for general use |
45 | Description | Test forum description |
46 | Subscription mode | Forced subscription |
47 And I follow "Forced Forum 1"
e5287f9b 48 And I navigate to "Show/edit current subscribers" in current page administration
c87b87e6
AN
49 Then I should see "Student 1"
50 And I should see "Teacher Teacher"
51 And I should see "Student 2"
52 And I should see "Student 3"
e5287f9b
MG
53 And I follow "Forced Forum 1"
54 And I navigate to "Edit settings" in current page administration
c87b87e6
AN
55 And I expand all fieldsets
56 And I click on "Add restriction..." "button"
57 And I click on "Grouping" "button" in the "Add restriction..." "dialogue"
58 And I set the field with xpath "//select[@name='id']" to "Grouping 1"
59 And I press "Save and display"
e5287f9b 60 And I navigate to "Show/edit current subscribers" in current page administration
c87b87e6
AN
61 And I should see "Student 1"
62 And I should see "Teacher Teacher"
63 And I should not see "Student 2"
64 And I should not see "Student 3"
65
ad9a7604
EL
66 Scenario: A forced forum does not allow to edit the subscribers
67 When I add a "Forum" to section "1" and I fill the form with:
68 | Forum name | Forced Forum 2 |
69 | Forum type | Standard forum for general use |
70 | Description | Test forum description |
71 | Subscription mode | Forced subscription |
125c4c4c 72 | Availability | Show on course page |
ad9a7604 73 And I follow "Forced Forum 2"
e5287f9b 74 And I navigate to "Show/edit current subscribers" in current page administration
ad9a7604
EL
75 Then I should see "Teacher Teacher"
76 And I should see "Student 1"
77 And I should see "Student 2"
78 And I should see "Student 3"
6806a373 79 And I should not see "Manage subscribers"
ad9a7604
EL
80
81 Scenario: A forced and hidden forum lists only teachers
e143918f
HB
82 When I add a "Forum" to section "1" and I fill the form with:
83 | Forum name | Forced Forum 2 |
84 | Forum type | Standard forum for general use |
85 | Description | Test forum description |
86 | Subscription mode | Forced subscription |
125c4c4c 87 | Availability | Hide from students |
e143918f 88 And I follow "Forced Forum 2"
e5287f9b 89 And I navigate to "Show/edit current subscribers" in current page administration
e143918f
HB
90 Then I should see "Teacher Teacher"
91 And I should not see "Student 1"
92 And I should not see "Student 2"
93 And I should not see "Student 3"
94
c87b87e6
AN
95 @javascript
96 Scenario: An automatic forum lists all subscribers
97 When I add a "Forum" to section "1" and I fill the form with:
98 | Forum name | Forced Forum 1 |
99 | Forum type | Standard forum for general use |
100 | Description | Test forum description |
101 | Subscription mode | Auto subscription |
102 And I follow "Forced Forum 1"
e5287f9b 103 And I navigate to "Show/edit current subscribers" in current page administration
c87b87e6
AN
104 Then I should see "Student 1"
105 And I should see "Teacher Teacher"
106 And I should see "Student 2"
107 And I should see "Student 3"
e5287f9b
MG
108 And I follow "Forced Forum 1"
109 And I navigate to "Edit settings" in current page administration
c87b87e6
AN
110 And I expand all fieldsets
111 And I click on "Add restriction..." "button"
112 And I click on "Grouping" "button" in the "Add restriction..." "dialogue"
113 And I set the field with xpath "//select[@name='id']" to "Grouping 1"
114 And I press "Save and display"
e5287f9b 115 And I navigate to "Show/edit current subscribers" in current page administration
c87b87e6
AN
116 And I should see "Student 1"
117 And I should see "Teacher Teacher"
118 And I should not see "Student 2"
119 And I should not see "Student 3"