on-demand release 3.6dev+
[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 |
1dc764a6
SL
11 And the following "courses" exist:
12 | fullname | shortname | category | startdate | enddate |
13 | Course 1 | C1 | 0 | ##1 month ago## | ##15 days ago## |
14 | Course 2 | C2 | 0 | ##yesterday## | ##tomorrow## |
e4b4b9e7
BB
15 | Course 3 | C3 | 0 | ##yesterday## | ##tomorrow## |
16 | Course 4 | C4 | 0 | ##yesterday## | ##tomorrow## |
17 | Course 5 | C5 | 0 | ##first day of next month## | ##last day of next month## |
1dc764a6
SL
18 And the following "course enrolments" exist:
19 | user | course | role |
20 | student1 | C1 | student |
21 | student1 | C2 | student |
22 | student1 | C3 | student |
e4b4b9e7
BB
23 | student1 | C4 | student |
24 | student1 | C5 | student |
1dc764a6 25
e4b4b9e7 26 Scenario: View past courses
1dc764a6 27 Given I log in as "student1"
e4b4b9e7 28 And I click on "All" "button" in the "Course overview" "block"
4671ae63
RW
29 When I click on "Past" "link" in the "Course overview" "block"
30 Then I should see "Course 1" in the "Course overview" "block"
31 And I should not see "Course 2" in the "Course overview" "block"
32 And I should not see "Course 3" in the "Course overview" "block"
e4b4b9e7
BB
33 And I should not see "Course 4" in the "Course overview" "block"
34 And I should not see "Course 5" in the "Course overview" "block"
35 And I log out
36
37 Scenario: View future courses
38 Given I log in as "student1"
39 And I click on "All" "button" in the "Course overview" "block"
40 When I click on "Future" "link" in the "Course overview" "block"
41 Then I should see "Course 5" in the "Course overview" "block"
42 And I should not see "Course 1" in the "Course overview" "block"
43 And I should not see "Course 2" in the "Course overview" "block"
44 And I should not see "Course 3" in the "Course overview" "block"
45 And I should not see "Course 4" in the "Course overview" "block"
1dc764a6 46 And I log out
e4b4b9e7
BB
47
48 Scenario: View inprogress courses
49 Given I log in as "student1"
50 And I click on "All" "button" in the "Course overview" "block"
51 When I click on "In progress" "link" in the "Course overview" "block"
52 Then I should see "Course 2" in the "Course overview" "block"
53 Then I should see "Course 3" in the "Course overview" "block"
54 Then I should see "Course 4" in the "Course overview" "block"
55 And I should not see "Course 1" in the "Course overview" "block"
56 And I should not see "Course 5" in the "Course overview" "block"
57 And I log out
58
59 Scenario: View all courses
60 Given I log in as "student1"
61 And I click on "All" "button" in the "Course overview" "block"
62 When I click on "All" "link" in the "Course overview" "block"
63 Then I should see "Course 1" in the "Course overview" "block"
64 Then I should see "Course 2" in the "Course overview" "block"
65 Then I should see "Course 3" in the "Course overview" "block"
66 Then I should see "Course 4" in the "Course overview" "block"
67 Then I should see "Course 5" in the "Course overview" "block"
3cfff885
BB
68 And I log out
69
70 Scenario: View inprogress courses - test persistence
71 Given I log in as "student1"
72 And I click on "All" "button" in the "Course overview" "block"
73 And I click on "In progress" "link" in the "Course overview" "block"
74 And I reload the page
75 Then I should see "In progress" in the "Course overview" "block"
76 Then I should see "Course 2" in the "Course overview" "block"
77 Then I should see "Course 3" in the "Course overview" "block"
78 Then I should see "Course 4" in the "Course overview" "block"
79 And I should not see "Course 1" in the "Course overview" "block"
80 And I should not see "Course 5" in the "Course overview" "block"
81 And I log out
82
83 Scenario: View all courses - w/ persistence
84 Given I log in as "student1"
85 And I click on "All" "button" in the "Course overview" "block"
86 When I click on "All" "link" in the "Course overview" "block"
87 And I reload the page
88 Then I should see "All" in the "Course overview" "block"
89 Then I should see "Course 1" in the "Course overview" "block"
90 Then I should see "Course 2" in the "Course overview" "block"
91 Then I should see "Course 3" in the "Course overview" "block"
92 Then I should see "Course 4" in the "Course overview" "block"
93 Then I should see "Course 5" in the "Course overview" "block"
94 And I log out
95
96 Scenario: View past courses - w/ persistence
97 Given I log in as "student1"
98 And I click on "All" "button" in the "Course overview" "block"
99 When I click on "Past" "link" in the "Course overview" "block"
100 And I reload the page
101 Then I should see "Past" in the "Course overview" "block"
102 Then I should see "Course 1" in the "Course overview" "block"
103 And I should not see "Course 2" in the "Course overview" "block"
104 And I should not see "Course 3" in the "Course overview" "block"
105 And I should not see "Course 4" in the "Course overview" "block"
106 And I should not see "Course 5" in the "Course overview" "block"
107 And I log out
108
109 Scenario: View future courses - w/ persistence
110 Given I log in as "student1"
111 And I click on "All" "button" in the "Course overview" "block"
112 When I click on "Future" "link" in the "Course overview" "block"
113 And I reload the page
114 Then I should see "Future" in the "Course overview" "block"
115 Then I should see "Course 5" in the "Course overview" "block"
116 And I should not see "Course 1" in the "Course overview" "block"
117 And I should not see "Course 2" in the "Course overview" "block"
118 And I should not see "Course 3" in the "Course overview" "block"
119 And I should not see "Course 4" in the "Course overview" "block"
120 And I log out
121
122 Scenario: List display persistence
123 Given I log in as "student1"
124 And I click on "Display dropdown" "button" in the "Course overview" "block"
125 And I click on "List" "link" in the "Course overview" "block"
126 And I reload the page
127 Then I should see "List" in the "Course overview" "block"
128 And "[data-display='list']" "css_element" in the "Course overview" "block" should be visible
129
130 Scenario: Cards display persistence
131 Given I log in as "student1"
132 And I click on "Display dropdown" "button" in the "Course overview" "block"
133 And I click on "Card" "link" in the "Course overview" "block"
134 And I reload the page
135 Then I should see "Card" in the "Course overview" "block"
136 And "[data-display='cards']" "css_element" in the "Course overview" "block" should be visible
137
138 Scenario: Summary display persistence
139 Given I log in as "student1"
140 And I click on "Display dropdown" "button" in the "Course overview" "block"
141 And I click on "Summary" "link" in the "Course overview" "block"
142 And I reload the page
143 Then I should see "Summary" in the "Course overview" "block"
144 And "[data-display='summary']" "css_element" in the "Course overview" "block" should be visible
145
146 Scenario: Title sort persistence
147 Given I log in as "student1"
148 And I click on "sortingdropdown" "button" in the "Course overview" "block"
149 And I click on "Title" "link" in the "Course overview" "block"
150 And I reload the page
151 Then I should see "Title" in the "Course overview" "block"
152 And "[data-sort='fullname']" "css_element" in the "Course overview" "block" should be visible
153
154 Scenario: Last accessed sort persistence
155 Given I log in as "student1"
156 And I click on "sortingdropdown" "button" in the "Course overview" "block"
157 And I click on "Last accessed" "link" in the "Course overview" "block"
158 And I reload the page
159 Then I should see "Last accessed" in the "Course overview" "block"
160 And "[data-sort='ul.timeaccess desc']" "css_element" in the "Course overview" "block" should be visible