1 |
efrain |
1 |
@block @block_blog_recent
|
|
|
2 |
Feature: Feature: Students can use the recent blog entries block to view recent entries on the frontpage
|
|
|
3 |
In order to enable the recent blog entries block on the frontpage
|
|
|
4 |
As an admin
|
|
|
5 |
I can add the recent blog entries block to the frontpage
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email | idnumber |
|
|
|
10 |
| student1 | Student | 1 | student1@example.com | S1 |
|
|
|
11 |
And the following "blocks" exist:
|
|
|
12 |
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
|
|
13 |
| blog_recent | System | 1 | site-index | side-pre |
|
|
|
14 |
And the following config values are set as admin:
|
|
|
15 |
| unaddableblocks | | theme_boost|
|
|
|
16 |
And I log in as "admin"
|
|
|
17 |
And I am on site homepage
|
|
|
18 |
And I turn editing mode on
|
|
|
19 |
# TODO MDL-57120 site "Blogs" link not accessible without navigation block.
|
|
|
20 |
And I add the "Navigation" block if not present
|
|
|
21 |
And I log out
|
|
|
22 |
|
|
|
23 |
Scenario: Students use the recent blog entries block to view blogs
|
|
|
24 |
Given I log in as "student1"
|
|
|
25 |
And I am on site homepage
|
|
|
26 |
And I click on "Site blogs" "link" in the "Navigation" "block"
|
|
|
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 site homepage
|
|
|
35 |
And I should see "S1 First Blog"
|
|
|
36 |
And I follow "S1 First Blog"
|
|
|
37 |
And I should see "This is my awesome blog!"
|
|
|
38 |
|
|
|
39 |
Scenario: Students only see a few entries in the recent blog entries block
|
|
|
40 |
Given I log in as "student1"
|
|
|
41 |
And I am on site homepage
|
|
|
42 |
And I click on "Site blogs" "link" in the "Navigation" "block"
|
|
|
43 |
And I follow "Add a new entry"
|
|
|
44 |
# Blog 1 of 5
|
|
|
45 |
And I set the following fields to these values:
|
|
|
46 |
| Entry title | S1 First Blog |
|
|
|
47 |
| Blog entry body | This is my awesome blog! |
|
|
|
48 |
And I press "Save changes"
|
|
|
49 |
And I wait "1" seconds
|
|
|
50 |
And I follow "Add a new entry"
|
|
|
51 |
# Blog 2 of 5
|
|
|
52 |
And I set the following fields to these values:
|
|
|
53 |
| Entry title | S1 Second Blog |
|
|
|
54 |
| Blog entry body | This is my awesome blog! |
|
|
|
55 |
And I press "Save changes"
|
|
|
56 |
And I wait "1" seconds
|
|
|
57 |
And I should see "S1 Second Blog"
|
|
|
58 |
And I should see "This is my awesome blog!"
|
|
|
59 |
And I follow "Add a new entry"
|
|
|
60 |
# Blog 3 of 5
|
|
|
61 |
And I set the following fields to these values:
|
|
|
62 |
| Entry title | S1 Third Blog |
|
|
|
63 |
| Blog entry body | This is my awesome blog! |
|
|
|
64 |
And I press "Save changes"
|
|
|
65 |
And I wait "1" seconds
|
|
|
66 |
And I should see "S1 Third Blog"
|
|
|
67 |
And I should see "This is my awesome blog!"
|
|
|
68 |
And I follow "Add a new entry"
|
|
|
69 |
# Blog 4 of 5
|
|
|
70 |
And I set the following fields to these values:
|
|
|
71 |
| Entry title | S1 Fourth Blog |
|
|
|
72 |
| Blog entry body | This is my awesome blog! |
|
|
|
73 |
And I press "Save changes"
|
|
|
74 |
And I wait "1" seconds
|
|
|
75 |
And I should see "S1 Fourth Blog"
|
|
|
76 |
And I should see "This is my awesome blog!"
|
|
|
77 |
And I follow "Add a new entry"
|
|
|
78 |
# Blog 5 of 5
|
|
|
79 |
And I set the following fields to these values:
|
|
|
80 |
| Entry title | S1 Fifth Blog |
|
|
|
81 |
| Blog entry body | This is my awesome blog! |
|
|
|
82 |
And I press "Save changes"
|
|
|
83 |
And I should see "S1 Fifth Blog"
|
|
|
84 |
And I should see "This is my awesome blog!"
|
|
|
85 |
When I am on site homepage
|
|
|
86 |
And I should not see "S1 First Blog"
|
|
|
87 |
And I should see "S1 Second Blog"
|
|
|
88 |
And I should see "S1 Third Blog"
|
|
|
89 |
And I should see "S1 Fourth Blog"
|
|
|
90 |
And I should see "S1 Fifth Blog"
|
|
|
91 |
And I follow "S1 Fifth Blog"
|
|
|
92 |
And I should see "This is my awesome blog!"
|
|
|
93 |
Then I log out
|
|
|
94 |
And I log in as "admin"
|
|
|
95 |
And I am on site homepage
|
|
|
96 |
And I turn editing mode on
|
|
|
97 |
And I configure the "Recent blog entries" block
|
|
|
98 |
And I set the following fields to these values:
|
|
|
99 |
| config_numberofrecentblogentries | 2 |
|
|
|
100 |
And I press "Save changes"
|
|
|
101 |
And I should see "S1 Fourth Blog"
|
|
|
102 |
And I should see "S1 Fifth Blog"
|