1 |
efrain |
1 |
@block @block_navigation
|
|
|
2 |
Feature: Expand the courses nodes within the navigation block
|
|
|
3 |
In order to navigate the site
|
|
|
4 |
As an anonymous user, a guest, a student, and an admin
|
|
|
5 |
I need to expand the courses node in the navigation block and check the display of courses and categories.
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
11 |
| student1 | Student | 1 | student1@example.com |
|
|
|
12 |
And the following "categories" exist:
|
|
|
13 |
| name | category | idnumber | visible |
|
|
|
14 |
| cat1 | 0 | cat1 | 1 |
|
|
|
15 |
| cat2 | 0 | cat2 | 1 |
|
|
|
16 |
| cat21 | cat2 | cat21 | 1 |
|
|
|
17 |
| cat211 | cat21 | cat211 | 1 |
|
|
|
18 |
| cat3 | 0 | cat3 | 0 |
|
|
|
19 |
And the following "courses" exist:
|
|
|
20 |
| fullname | shortname | category | visible |
|
|
|
21 |
| Course 1 | c1 | cat1 | 1 |
|
|
|
22 |
| Course 2 | c2 | cat2 | 1 |
|
|
|
23 |
| Course 3 | c3 | cat21 | 1 |
|
|
|
24 |
| Course 4 | c4 | cat211 | 1 |
|
|
|
25 |
| Course 5 | c5 | cat211 | 0 |
|
|
|
26 |
| Course 6 | c6 | cat211 | 0 |
|
|
|
27 |
| Course 7 | c7 | cat3 | 1 |
|
|
|
28 |
| Course 8 | c8 | cat3 | 0 |
|
|
|
29 |
And the following "course enrolments" exist:
|
|
|
30 |
| user | course | role |
|
|
|
31 |
| teacher1 | c1 | teacher |
|
|
|
32 |
| teacher1 | c3 | teacher |
|
|
|
33 |
| teacher1 | c5 | teacher |
|
|
|
34 |
| student1 | c1 | student |
|
|
|
35 |
| student1 | c2 | student |
|
|
|
36 |
| student1 | c4 | student |
|
|
|
37 |
And the following config values are set as admin:
|
|
|
38 |
| navshowallcourses | 1 |
|
|
|
39 |
And I log in as "admin"
|
|
|
40 |
And I am on site homepage
|
|
|
41 |
And I turn editing mode on
|
|
|
42 |
And the following config values are set as admin:
|
|
|
43 |
| unaddableblocks | | theme_boost|
|
|
|
44 |
And I add the "Navigation" block if not present
|
|
|
45 |
And I configure the "Navigation" block
|
|
|
46 |
And I set the following fields to these values:
|
|
|
47 |
| Page contexts | Display throughout the entire site |
|
|
|
48 |
And I press "Save changes"
|
|
|
49 |
And I turn editing mode off
|
|
|
50 |
And I am on the "Course 2" "enrolment methods" page
|
|
|
51 |
And I click on "Edit" "link" in the "Guest access" "table_row"
|
|
|
52 |
And I set the following fields to these values:
|
|
|
53 |
| Allow guest access | Yes |
|
|
|
54 |
And I press "Save changes"
|
|
|
55 |
And I log out
|
|
|
56 |
|
|
|
57 |
@javascript
|
|
|
58 |
Scenario: As an anonymous user I expand the courses node to see courses.
|
|
|
59 |
When I should see "You are not logged in." in the ".logininfo" "css_element"
|
|
|
60 |
And I should see "Home" in the "Navigation" "block"
|
|
|
61 |
And I should see "Courses" in the "Navigation" "block"
|
|
|
62 |
And I expand "Courses" node
|
|
|
63 |
And I should see "cat1" in the "Navigation" "block"
|
|
|
64 |
And I should see "cat2" in the "Navigation" "block"
|
|
|
65 |
And I should not see "cat3" in the "Navigation" "block"
|
|
|
66 |
And I expand "cat1" node
|
|
|
67 |
And I expand "cat2" node
|
|
|
68 |
And I should see "cat21" in the "Navigation" "block"
|
|
|
69 |
And I expand "cat21" node
|
|
|
70 |
And I should see "cat211" in the "Navigation" "block"
|
|
|
71 |
And I expand "cat211" node
|
|
|
72 |
Then I should see "c1" in the "Navigation" "block"
|
|
|
73 |
And I should see "c2" in the "Navigation" "block"
|
|
|
74 |
And I should see "c3" in the "Navigation" "block"
|
|
|
75 |
And I should see "c4" in the "Navigation" "block"
|
|
|
76 |
And I should not see "c5" in the "Navigation" "block"
|
|
|
77 |
And I should not see "c6" in the "Navigation" "block"
|
|
|
78 |
And navigation node "c1" should not be expandable
|
|
|
79 |
And navigation node "c2" should not be expandable
|
|
|
80 |
And navigation node "c3" should not be expandable
|
|
|
81 |
And navigation node "c4" should not be expandable
|
|
|
82 |
|
|
|
83 |
@javascript
|
|
|
84 |
Scenario: As the admin user I expand the courses and category nodes to see courses.
|
|
|
85 |
When I log in as "admin"
|
|
|
86 |
And I am on site homepage
|
|
|
87 |
And I should see "Site home" in the "Navigation" "block"
|
|
|
88 |
And I should see "Courses" in the "Navigation" "block"
|
|
|
89 |
And I expand "Courses" node
|
|
|
90 |
And I should see "cat1" in the "Navigation" "block"
|
|
|
91 |
And I should see "cat2" in the "Navigation" "block"
|
|
|
92 |
And I should see "cat3" in the "Navigation" "block"
|
|
|
93 |
And I expand "cat1" node
|
|
|
94 |
And I expand "cat2" node
|
|
|
95 |
And I expand "cat3" node
|
|
|
96 |
And I should see "cat21" in the "Navigation" "block"
|
|
|
97 |
And I expand "cat21" node
|
|
|
98 |
And I should see "cat211" in the "Navigation" "block"
|
|
|
99 |
And I expand "cat211" node
|
|
|
100 |
Then I should see "c1" in the "Navigation" "block"
|
|
|
101 |
And I should see "c2" in the "Navigation" "block"
|
|
|
102 |
And I should see "c3" in the "Navigation" "block"
|
|
|
103 |
And I should see "c4" in the "Navigation" "block"
|
|
|
104 |
And I should see "c5" in the "Navigation" "block"
|
|
|
105 |
And I should see "c6" in the "Navigation" "block"
|
|
|
106 |
And I should see "c7" in the "Navigation" "block"
|
|
|
107 |
And I should see "c8" in the "Navigation" "block"
|
|
|
108 |
And navigation node "c1" should be expandable
|
|
|
109 |
And navigation node "c2" should be expandable
|
|
|
110 |
And navigation node "c3" should be expandable
|
|
|
111 |
And navigation node "c4" should be expandable
|
|
|
112 |
And navigation node "c5" should be expandable
|
|
|
113 |
And navigation node "c6" should be expandable
|
|
|
114 |
And navigation node "c7" should be expandable
|
|
|
115 |
And navigation node "c8" should be expandable
|
|
|
116 |
|
|
|
117 |
@javascript
|
|
|
118 |
Scenario: As teacher1 I expand the courses and category nodes to see courses.
|
|
|
119 |
When I log in as "teacher1"
|
|
|
120 |
And I am on site homepage
|
|
|
121 |
And I should see "Site home" in the "Navigation" "block"
|
|
|
122 |
And I should see "Courses" in the "Navigation" "block"
|
|
|
123 |
And I expand "Courses" node
|
|
|
124 |
And I should see "cat1" in the "Navigation" "block"
|
|
|
125 |
And I should see "cat2" in the "Navigation" "block"
|
|
|
126 |
And I should not see "cat3" in the "Navigation" "block"
|
|
|
127 |
And I expand "cat1" node
|
|
|
128 |
And I expand "cat2" node
|
|
|
129 |
And I should see "cat21" in the "Navigation" "block"
|
|
|
130 |
And I expand "cat21" node
|
|
|
131 |
And I should see "cat211" in the "Navigation" "block"
|
|
|
132 |
And I expand "cat211" node
|
|
|
133 |
Then I should see "c1" in the "Navigation" "block"
|
|
|
134 |
And I should see "c2" in the "Navigation" "block"
|
|
|
135 |
And I should see "c3" in the "Navigation" "block"
|
|
|
136 |
And I should see "c4" in the "Navigation" "block"
|
|
|
137 |
And I should see "c5" in the "Navigation" "block"
|
|
|
138 |
And I should not see "c6" in the "Navigation" "block"
|
|
|
139 |
And I should not see "c7" in the "Navigation" "block"
|
|
|
140 |
And I should not see "c8" in the "Navigation" "block"
|
|
|
141 |
And navigation node "c1" should be expandable
|
|
|
142 |
And navigation node "c2" should be expandable
|
|
|
143 |
And navigation node "c3" should be expandable
|
|
|
144 |
And navigation node "c4" should not be expandable
|
|
|
145 |
And navigation node "c5" should be expandable
|
|
|
146 |
|
|
|
147 |
@javascript
|
|
|
148 |
Scenario: As student1 I expand the courses and category nodes to see courses.
|
|
|
149 |
When I log in as "student1"
|
|
|
150 |
And I am on site homepage
|
|
|
151 |
And I should see "Site home" in the "Navigation" "block"
|
|
|
152 |
And I should see "Courses" in the "Navigation" "block"
|
|
|
153 |
And I expand "Courses" node
|
|
|
154 |
And I should see "cat1" in the "Navigation" "block"
|
|
|
155 |
And I should see "cat2" in the "Navigation" "block"
|
|
|
156 |
And I should not see "cat3" in the "Navigation" "block"
|
|
|
157 |
And I expand "cat1" node
|
|
|
158 |
And I expand "cat2" node
|
|
|
159 |
And I should see "cat21" in the "Navigation" "block"
|
|
|
160 |
And I expand "cat21" node
|
|
|
161 |
And I should see "cat211" in the "Navigation" "block"
|
|
|
162 |
And I expand "cat211" node
|
|
|
163 |
Then I should see "c1" in the "Navigation" "block"
|
|
|
164 |
And I should see "c2" in the "Navigation" "block"
|
|
|
165 |
And I should see "c3" in the "Navigation" "block"
|
|
|
166 |
And I should see "c4" in the "Navigation" "block"
|
|
|
167 |
And I should not see "c5" in the "Navigation" "block"
|
|
|
168 |
And I should not see "c6" in the "Navigation" "block"
|
|
|
169 |
And I should not see "c7" in the "Navigation" "block"
|
|
|
170 |
And I should not see "c8" in the "Navigation" "block"
|
|
|
171 |
And navigation node "c1" should be expandable
|
|
|
172 |
And navigation node "c2" should be expandable
|
|
|
173 |
And navigation node "c3" should not be expandable
|
|
|
174 |
And navigation node "c4" should be expandable
|
|
|
175 |
|
|
|
176 |
@javascript
|
|
|
177 |
Scenario: As guest I expand the courses and category nodes to see courses.
|
|
|
178 |
When I log in as "guest"
|
|
|
179 |
And I am on site homepage
|
|
|
180 |
And I should see "Home" in the "Navigation" "block"
|
|
|
181 |
And I should see "Courses" in the "Navigation" "block"
|
|
|
182 |
And I expand "Courses" node
|
|
|
183 |
And I should see "cat1" in the "Navigation" "block"
|
|
|
184 |
And I should see "cat2" in the "Navigation" "block"
|
|
|
185 |
And I should not see "cat3" in the "Navigation" "block"
|
|
|
186 |
And I expand "cat1" node
|
|
|
187 |
And I expand "cat2" node
|
|
|
188 |
And I should see "cat21" in the "Navigation" "block"
|
|
|
189 |
And I expand "cat21" node
|
|
|
190 |
And I should see "cat211" in the "Navigation" "block"
|
|
|
191 |
And I expand "cat211" node
|
|
|
192 |
Then I should see "c1" in the "Navigation" "block"
|
|
|
193 |
And I should see "c2" in the "Navigation" "block"
|
|
|
194 |
And I should see "c3" in the "Navigation" "block"
|
|
|
195 |
And I should see "c4" in the "Navigation" "block"
|
|
|
196 |
And I should not see "c5" in the "Navigation" "block"
|
|
|
197 |
And I should not see "c6" in the "Navigation" "block"
|
|
|
198 |
And I should not see "c7" in the "Navigation" "block"
|
|
|
199 |
And I should not see "c8" in the "Navigation" "block"
|
|
|
200 |
And navigation node "c1" should not be expandable
|
|
|
201 |
And navigation node "c2" should be expandable
|
|
|
202 |
And navigation node "c3" should not be expandable
|
|
|
203 |
And navigation node "c4" should not be expandable
|