MDL-64943 lang: Import fixed English strings (en_fix)
[moodle.git] / blocks / myoverview / tests / behat / block_myoverview_dashboard.feature
CommitLineData
1dc764a6 1@block @block_myoverview @javascript
44eb44e4 2Feature: The my overview block allows users to easily access their courses
1dc764a6
SL
3 In order to enable the my overview block in a course
4 As a student
5 I can add the my overview block to my dashboard
6
7 Background:
8 Given the following "users" exist:
9 | username | firstname | lastname | email | idnumber |
e4b4b9e7 10 | student1 | Student | X | student1@example.com | S1 |
d657d80d
MG
11 And the following "categories" exist:
12 | name | category | idnumber |
13 | Category 1 | 0 | CAT1 |
1dc764a6
SL
14 And the following "courses" exist:
15 | fullname | shortname | category | startdate | enddate |
16 | Course 1 | C1 | 0 | ##1 month ago## | ##15 days ago## |
17 | Course 2 | C2 | 0 | ##yesterday## | ##tomorrow## |
e4b4b9e7 18 | Course 3 | C3 | 0 | ##yesterday## | ##tomorrow## |
d657d80d 19 | Course 4 | C4 | CAT1 | ##yesterday## | ##tomorrow## |
e4b4b9e7 20 | Course 5 | C5 | 0 | ##first day of next month## | ##last day of next month## |
1dc764a6
SL
21 And the following "course enrolments" exist:
22 | user | course | role |
23 | student1 | C1 | student |
24 | student1 | C2 | student |
25 | student1 | C3 | student |
e4b4b9e7
BB
26 | student1 | C4 | student |
27 | student1 | C5 | student |
1dc764a6 28
e4b4b9e7 29 Scenario: View past courses
1dc764a6 30 Given I log in as "student1"
e4b4b9e7 31 And I click on "All" "button" in the "Course overview" "block"
4671ae63
RW
32 When I click on "Past" "link" in the "Course overview" "block"
33 Then I should see "Course 1" in the "Course overview" "block"
34 And I should not see "Course 2" in the "Course overview" "block"
35 And I should not see "Course 3" in the "Course overview" "block"
e4b4b9e7
BB
36 And I should not see "Course 4" in the "Course overview" "block"
37 And I should not see "Course 5" in the "Course overview" "block"
38 And I log out
39
40 Scenario: View future courses
41 Given I log in as "student1"
42 And I click on "All" "button" in the "Course overview" "block"
43 When I click on "Future" "link" in the "Course overview" "block"
44 Then I should see "Course 5" in the "Course overview" "block"
45 And I should not see "Course 1" in the "Course overview" "block"
46 And I should not see "Course 2" in the "Course overview" "block"
47 And I should not see "Course 3" in the "Course overview" "block"
48 And I should not see "Course 4" in the "Course overview" "block"
1dc764a6 49 And I log out
e4b4b9e7
BB
50
51 Scenario: View inprogress courses
52 Given I log in as "student1"
53 And I click on "All" "button" in the "Course overview" "block"
54 When I click on "In progress" "link" in the "Course overview" "block"
55 Then I should see "Course 2" in the "Course overview" "block"
56 Then I should see "Course 3" in the "Course overview" "block"
57 Then I should see "Course 4" in the "Course overview" "block"
58 And I should not see "Course 1" in the "Course overview" "block"
59 And I should not see "Course 5" in the "Course overview" "block"
60 And I log out
61
62 Scenario: View all courses
63 Given I log in as "student1"
64 And I click on "All" "button" in the "Course overview" "block"
65 When I click on "All" "link" in the "Course overview" "block"
66 Then I should see "Course 1" in the "Course overview" "block"
67 Then I should see "Course 2" in the "Course overview" "block"
68 Then I should see "Course 3" in the "Course overview" "block"
69 Then I should see "Course 4" in the "Course overview" "block"
70 Then I should see "Course 5" in the "Course overview" "block"
3cfff885
BB
71 And I log out
72
73 Scenario: View inprogress courses - test persistence
74 Given I log in as "student1"
75 And I click on "All" "button" in the "Course overview" "block"
76 And I click on "In progress" "link" in the "Course overview" "block"
77 And I reload the page
78 Then I should see "In progress" in the "Course overview" "block"
79 Then I should see "Course 2" in the "Course overview" "block"
80 Then I should see "Course 3" in the "Course overview" "block"
81 Then I should see "Course 4" in the "Course overview" "block"
82 And I should not see "Course 1" in the "Course overview" "block"
83 And I should not see "Course 5" in the "Course overview" "block"
84 And I log out
85
86 Scenario: View all courses - w/ persistence
87 Given I log in as "student1"
88 And I click on "All" "button" in the "Course overview" "block"
89 When I click on "All" "link" in the "Course overview" "block"
90 And I reload the page
91 Then I should see "All" in the "Course overview" "block"
92 Then I should see "Course 1" in the "Course overview" "block"
93 Then I should see "Course 2" in the "Course overview" "block"
94 Then I should see "Course 3" in the "Course overview" "block"
95 Then I should see "Course 4" in the "Course overview" "block"
96 Then I should see "Course 5" in the "Course overview" "block"
97 And I log out
98
99 Scenario: View past courses - w/ persistence
100 Given I log in as "student1"
101 And I click on "All" "button" in the "Course overview" "block"
102 When I click on "Past" "link" in the "Course overview" "block"
103 And I reload the page
104 Then I should see "Past" in the "Course overview" "block"
105 Then I should see "Course 1" in the "Course overview" "block"
106 And I should not see "Course 2" in the "Course overview" "block"
107 And I should not see "Course 3" in the "Course overview" "block"
108 And I should not see "Course 4" in the "Course overview" "block"
109 And I should not see "Course 5" in the "Course overview" "block"
110 And I log out
111
112 Scenario: View future courses - w/ persistence
113 Given I log in as "student1"
114 And I click on "All" "button" in the "Course overview" "block"
115 When I click on "Future" "link" in the "Course overview" "block"
116 And I reload the page
117 Then I should see "Future" in the "Course overview" "block"
118 Then I should see "Course 5" in the "Course overview" "block"
119 And I should not see "Course 1" in the "Course overview" "block"
120 And I should not see "Course 2" in the "Course overview" "block"
121 And I should not see "Course 3" in the "Course overview" "block"
122 And I should not see "Course 4" in the "Course overview" "block"
123 And I log out
124
125 Scenario: List display persistence
126 Given I log in as "student1"
127 And I click on "Display dropdown" "button" in the "Course overview" "block"
128 And I click on "List" "link" in the "Course overview" "block"
129 And I reload the page
130 Then I should see "List" in the "Course overview" "block"
131 And "[data-display='list']" "css_element" in the "Course overview" "block" should be visible
132
133 Scenario: Cards display persistence
134 Given I log in as "student1"
135 And I click on "Display dropdown" "button" in the "Course overview" "block"
136 And I click on "Card" "link" in the "Course overview" "block"
137 And I reload the page
138 Then I should see "Card" in the "Course overview" "block"
139 And "[data-display='cards']" "css_element" in the "Course overview" "block" should be visible
140
141 Scenario: Summary display persistence
142 Given I log in as "student1"
143 And I click on "Display dropdown" "button" in the "Course overview" "block"
144 And I click on "Summary" "link" in the "Course overview" "block"
145 And I reload the page
146 Then I should see "Summary" in the "Course overview" "block"
147 And "[data-display='summary']" "css_element" in the "Course overview" "block" should be visible
148
d82cc9f2 149 Scenario: Course name sort persistence
3cfff885
BB
150 Given I log in as "student1"
151 And I click on "sortingdropdown" "button" in the "Course overview" "block"
d82cc9f2 152 And I click on "Course name" "link" in the "Course overview" "block"
3cfff885 153 And I reload the page
d82cc9f2 154 Then I should see "Course name" in the "Course overview" "block"
3cfff885
BB
155 And "[data-sort='fullname']" "css_element" in the "Course overview" "block" should be visible
156
157 Scenario: Last accessed sort persistence
158 Given I log in as "student1"
159 And I click on "sortingdropdown" "button" in the "Course overview" "block"
160 And I click on "Last accessed" "link" in the "Course overview" "block"
161 And I reload the page
162 Then I should see "Last accessed" in the "Course overview" "block"
e6f03948
P
163 And "[data-sort='ul.timeaccess desc']" "css_element" in the "Course overview" "block" should be visible
164
165 Scenario: View inprogress courses with hide persistent functionality
166 Given I log in as "student1"
167 And I click on "All" "button" in the "Course overview" "block"
168 When I click on "In progress" "link" in the "Course overview" "block"
c896546c
P
169 And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
170 And I click on "Hide from view" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
e6f03948
P
171 And I reload the page
172 Then I should see "Course 3" in the "Course overview" "block"
173 Then I should see "Course 4" in the "Course overview" "block"
174 And I should not see "Course 2" in the "Course overview" "block"
175 And I should not see "Course 1" in the "Course overview" "block"
176 And I should not see "Course 5" in the "Course overview" "block"
177 And I log out
178
179 Scenario: View past courses with hide persistent functionality
180 Given I log in as "student1"
181 And I click on "All" "button" in the "Course overview" "block"
182 When I click on "Past" "link" in the "Course overview" "block"
c896546c
P
183 And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 1')]" "xpath_element"
184 And I click on "Hide from view" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 1')]" "xpath_element"
e6f03948
P
185 And I reload the page
186 Then I should not see "Course 1" in the "Course overview" "block"
187 And I should not see "Course 2" in the "Course overview" "block"
188 And I should not see "Course 3" in the "Course overview" "block"
189 And I should not see "Course 4" in the "Course overview" "block"
190 And I should not see "Course 5" in the "Course overview" "block"
191 And I log out
192
193 Scenario: View future courses with hide persistent functionality
194 Given I log in as "student1"
195 And I click on "All" "button" in the "Course overview" "block"
196 When I click on "Future" "link" in the "Course overview" "block"
c896546c
P
197 And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 5')]" "xpath_element"
198 And I click on "Hide from view" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 5')]" "xpath_element"
e6f03948
P
199 And I reload the page
200 Then I should not see "Course 5" in the "Course overview" "block"
201 And I should not see "Course 1" in the "Course overview" "block"
202 And I should not see "Course 2" in the "Course overview" "block"
203 And I should not see "Course 3" in the "Course overview" "block"
204 And I should not see "Course 4" in the "Course overview" "block"
205 And I log out
d657d80d
MG
206
207 Scenario: Show course category in cards display
208 Given I log in as "student1"
209 And I click on "Display dropdown" "button" in the "Course overview" "block"
210 When I click on "Card" "link" in the "Course overview" "block"
211 Then I should see "Category 1" in the "Course overview" "block"
212
213 Scenario: Show course category in list display
214 Given I log in as "student1"
215 And I click on "Display dropdown" "button" in the "Course overview" "block"
216 When I click on "List" "link" in the "Course overview" "block"
217 Then I should see "Category 1" in the "Course overview" "block"
218
219 Scenario: Show course category in summary display
220 Given I log in as "student1"
221 And I click on "Display dropdown" "button" in the "Course overview" "block"
222 When I click on "Summary" "link" in the "Course overview" "block"
223 Then I should see "Category 1" in the "Course overview" "block"