MDL-63058 core_favourites: add existence checks to the service layer
[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"
68 And I log out