Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

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