1 |
efrain |
1 |
@block @block_blog_menu
|
|
|
2 |
Feature: Enable Block blog menu in an activity
|
|
|
3 |
In order to enable the blog menu in an activity
|
|
|
4 |
As a teacher
|
|
|
5 |
I can add blog menu block to a course
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email | idnumber |
|
|
|
10 |
| teacher1 | Teacher | 1 | teacher1@example.com | T1 |
|
|
|
11 |
| student1 | Student | 1 | student1@example.com | S1 |
|
|
|
12 |
| student2 | Student | 2 | student2@example.com | S2 |
|
|
|
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 |
Given the following "activity" exists:
|
|
|
22 |
| activity | assign |
|
|
|
23 |
| name | Test assignment 1 |
|
|
|
24 |
| intro | Offline text |
|
|
|
25 |
| course | C1 |
|
|
|
26 |
| idnumber | 0001 |
|
|
|
27 |
| section | 1 |
|
|
|
28 |
| assignsubmission_file_enabled | 0 |
|
|
|
29 |
And the following "blocks" exist:
|
|
|
30 |
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
|
|
31 |
| blog_menu | Activity module | 0001 | mod-assign-view | side-pre |
|
|
|
32 |
|
|
|
33 |
Scenario: Students use the blog menu block to post blogs
|
|
|
34 |
Given I am on the "Test assignment 1" "assign activity" page logged in as student1
|
|
|
35 |
And I follow "Add a new entry"
|
|
|
36 |
When I set the following fields to these values:
|
|
|
37 |
| Entry title | S1 First Blog |
|
|
|
38 |
| Blog entry body | This is my awesome blog! |
|
|
|
39 |
And I press "Save changes"
|
|
|
40 |
Then I should see "S1 First Blog"
|
|
|
41 |
And I should see "This is my awesome blog!"
|
|
|
42 |
And I am on the "Test assignment 1" "assign activity" page
|
|
|
43 |
And I follow "Blog entries"
|
|
|
44 |
And I should see "S1 First Blog"
|
|
|
45 |
And I should see "This is my awesome blog!"
|
|
|
46 |
|
|
|
47 |
Scenario: Students use the blog menu block to view their blogs about the activity
|
|
|
48 |
Given I am on the "Test assignment 1" "assign activity" page logged in as student1
|
|
|
49 |
And I follow "Add an entry about this Assignment"
|
|
|
50 |
And I set the following fields to these values:
|
|
|
51 |
| Entry title | S1 First Blog |
|
|
|
52 |
| Blog entry body | This is my awesome blog about this Assignment! |
|
|
|
53 |
And I press "Save changes"
|
|
|
54 |
And I should see "S1 First Blog"
|
|
|
55 |
And I should see "This is my awesome blog about this Assignment!"
|
|
|
56 |
And I should see "Associated Assignment: Test assignment 1"
|
|
|
57 |
And I am on the "Test assignment 1" "assign activity" page logged in as student2
|
|
|
58 |
And I follow "Add a new entry"
|
|
|
59 |
And I set the following fields to these values:
|
|
|
60 |
| Entry title | S2 Second Blog |
|
|
|
61 |
| Blog entry body | My unrelated blog! |
|
|
|
62 |
And I press "Save changes"
|
|
|
63 |
And I should see "S2 Second Blog"
|
|
|
64 |
And I should see "My unrelated blog!"
|
|
|
65 |
And I should not see "Associated Assignment: Test assignment 1"
|
|
|
66 |
And I am on the "Test assignment 1" "assign activity" page
|
|
|
67 |
And I follow "Add an entry about this Assignment"
|
|
|
68 |
And I set the following fields to these values:
|
|
|
69 |
| Entry title | S2 First Blog |
|
|
|
70 |
| Blog entry body | My course blog is better! |
|
|
|
71 |
And I press "Save changes"
|
|
|
72 |
And I should see "S2 First Blog"
|
|
|
73 |
And I should see "My course blog is better!"
|
|
|
74 |
And I should see "Associated Assignment: Test assignment 1"
|
|
|
75 |
And I am on the "Test assignment 1" "assign activity" page
|
|
|
76 |
When I follow "View my entries about this Assignment"
|
|
|
77 |
Then I should see "S2 First Blog"
|
|
|
78 |
And I should not see "S2 Second Blog"
|
|
|
79 |
And I should not see "S1 First Blog"
|
|
|
80 |
|
|
|
81 |
Scenario: Students use the blog menu block to view all blogs about the assignment
|
|
|
82 |
Given I am on the "Test assignment 1" "assign activity" page logged in as student1
|
|
|
83 |
And I follow "Add an entry about this Assignment"
|
|
|
84 |
And I set the following fields to these values:
|
|
|
85 |
| Entry title | S1 First Blog |
|
|
|
86 |
| Blog entry body | This is my awesome blog about this Assignment! |
|
|
|
87 |
And I press "Save changes"
|
|
|
88 |
And I should see "S1 First Blog"
|
|
|
89 |
And I should see "This is my awesome blog about this Assignment!"
|
|
|
90 |
And I should see "Associated Assignment: Test assignment 1"
|
|
|
91 |
And I am on the "Test assignment 1" "assign activity" page logged in as student2
|
|
|
92 |
And I follow "Add a new entry"
|
|
|
93 |
And I set the following fields to these values:
|
|
|
94 |
| Entry title | S2 Second Blog |
|
|
|
95 |
| Blog entry body | My unrelated blog! |
|
|
|
96 |
And I press "Save changes"
|
|
|
97 |
And I should see "S2 Second Blog"
|
|
|
98 |
And I should see "My unrelated blog!"
|
|
|
99 |
And I should not see "Associated Assignment: Test assignment 1"
|
|
|
100 |
And I am on the "Test assignment 1" "assign activity" page
|
|
|
101 |
And I follow "Add an entry about this Assignment"
|
|
|
102 |
And I set the following fields to these values:
|
|
|
103 |
| Entry title | S2 First Blog |
|
|
|
104 |
| Blog entry body | My course blog is better! |
|
|
|
105 |
And I press "Save changes"
|
|
|
106 |
And I should see "S2 First Blog"
|
|
|
107 |
And I should see "My course blog is better!"
|
|
|
108 |
And I should see "Associated Assignment: Test assignment 1"
|
|
|
109 |
And I am on the "Test assignment 1" "assign activity" page
|
|
|
110 |
When I follow "View all entries about this Assignment"
|
|
|
111 |
Then I should see "S1 First Blog"
|
|
|
112 |
And I should see "S2 First Blog"
|
|
|
113 |
And I should not see "S2 Second Blog"
|
|
|
114 |
|
|
|
115 |
Scenario: Students use the blog menu block to view all their blog entries
|
|
|
116 |
Given I am on the "Test assignment 1" "assign activity" page logged in as student1
|
|
|
117 |
And I follow "Add an entry about this Assignment"
|
|
|
118 |
And I set the following fields to these values:
|
|
|
119 |
| Entry title | S1 First Blog |
|
|
|
120 |
| Blog entry body | This is my awesome blog about this Assignment! |
|
|
|
121 |
And I press "Save changes"
|
|
|
122 |
And I should see "S1 First Blog"
|
|
|
123 |
And I should see "This is my awesome blog about this Assignment!"
|
|
|
124 |
And I should see "Associated Assignment: Test assignment 1"
|
|
|
125 |
And I am on the "Test assignment 1" "assign activity" page logged in as student2
|
|
|
126 |
And I follow "Add a new entry"
|
|
|
127 |
And I set the following fields to these values:
|
|
|
128 |
| Entry title | S2 Second Blog |
|
|
|
129 |
| Blog entry body | My unrelated blog! |
|
|
|
130 |
And I press "Save changes"
|
|
|
131 |
And I should see "S2 Second Blog"
|
|
|
132 |
And I should see "My unrelated blog!"
|
|
|
133 |
And I should not see "Associated Assignment: Test assignment 1"
|
|
|
134 |
And I am on the "Test assignment 1" "assign activity" page
|
|
|
135 |
And I follow "Add an entry about this Assignment"
|
|
|
136 |
And I set the following fields to these values:
|
|
|
137 |
| Entry title | S2 First Blog |
|
|
|
138 |
| Blog entry body | My course blog is better! |
|
|
|
139 |
And I press "Save changes"
|
|
|
140 |
And I should see "S2 First Blog"
|
|
|
141 |
And I should see "My course blog is better!"
|
|
|
142 |
And I should see "Associated Assignment: Test assignment 1"
|
|
|
143 |
And I am on the "Test assignment 1" "assign activity" page
|
|
|
144 |
When I follow "Blog entries"
|
|
|
145 |
Then I should see "S2 First Blog"
|
|
|
146 |
And I should see "S2 Second Blog"
|
|
|
147 |
And I should not see "S1 First Blog"
|
|
|
148 |
|
|
|
149 |
Scenario: Teacher searches for student blogs
|
|
|
150 |
Given I am on the "Test assignment 1" "assign activity" page logged in as student1
|
|
|
151 |
And I follow "Add an entry about this Assignment"
|
|
|
152 |
And I set the following fields to these values:
|
|
|
153 |
| Entry title | S1 First Blog |
|
|
|
154 |
| Blog entry body | This is my awesome blog about this Assignment! |
|
|
|
155 |
And I press "Save changes"
|
|
|
156 |
And I should see "S1 First Blog"
|
|
|
157 |
And I should see "This is my awesome blog about this Assignment!"
|
|
|
158 |
And I should see "Associated Assignment: Test assignment 1"
|
|
|
159 |
And I am on the "Test assignment 1" "assign activity" page logged in as student2
|
|
|
160 |
And I follow "Add a new entry"
|
|
|
161 |
And I set the following fields to these values:
|
|
|
162 |
| Entry title | S2 Second Blog |
|
|
|
163 |
| Blog entry body | My unrelated blog! |
|
|
|
164 |
And I press "Save changes"
|
|
|
165 |
And I should see "S2 Second Blog"
|
|
|
166 |
And I should see "My unrelated blog!"
|
|
|
167 |
And I should not see "Associated Assignment: Test assignment 1"
|
|
|
168 |
And I am on the "Test assignment 1" "assign activity" page
|
|
|
169 |
And I follow "Add an entry about this Assignment"
|
|
|
170 |
And I set the following fields to these values:
|
|
|
171 |
| Entry title | S2 First Blog |
|
|
|
172 |
| Blog entry body | My course blog is better! |
|
|
|
173 |
And I press "Save changes"
|
|
|
174 |
And I should see "S2 First Blog"
|
|
|
175 |
And I should see "My course blog is better!"
|
|
|
176 |
And I should see "Associated Assignment: Test assignment 1"
|
|
|
177 |
When I am on the "Test assignment 1" "assign activity" page logged in as teacher1
|
|
|
178 |
And I set the field "Search" to "First"
|
|
|
179 |
And I press "Search"
|
|
|
180 |
Then I should see "S1 First Blog"
|
|
|
181 |
And I should see "S2 First Blog"
|
|
|
182 |
And I should not see "S2 Second Blog"
|