MDL-44711 block_navigation: fixed typo in behat tests
[moodle.git] / blocks / navigation / tests / behat / view_my_courses.feature
CommitLineData
112f1ab9
EL
1@block @block_navigation
2Feature: View my courses in navigation block
3 In order to navigate to my courses
4 As a student
5 I need my courses displayed in the navigation block
6
7 Background:
759b323e 8 Given the following "users" exist:
112f1ab9
EL
9 | username | firstname | lastname | email |
10 | student1 | Student | 1 | student1@asd.com |
759b323e 11 And the following "categories" exist:
112f1ab9
EL
12 | name | category | idnumber |
13 | cat1 | 0 | cat1 |
14 | cat2 | 0 | cat2 |
15 | cat3 | 0 | cat3 |
16 | cat31 | cat3 | cat31 |
17 | cat32 | cat3 | cat32 |
18 | cat33 | cat3 | cat33 |
759b323e 19 And the following "courses" exist:
112f1ab9
EL
20 | fullname | shortname | category |
21 | Course1 | c1 | cat1 |
22 | Course2 | c2 | cat2 |
23 | Course31 | c31 | cat31 |
24 | Course32 | c32 | cat32 |
25 | Course331| c331 | cat33 |
26 | Course332| c332 | cat33 |
759b323e 27 And the following "course enrolments" exist:
112f1ab9
EL
28 | user | course | role |
29 | student1 | c1 | student |
30 | student1 | c31 | student |
31 | student1 | c331 | student |
32 And I log in as "admin"
33
34 @javascript
35 Scenario: The plain list of enrolled courses is shown
36 Given I set the following administration settings values:
37 | Show my course categories | 0 |
38 And I log out
39 And I log in as "student1"
40 When I follow "My home"
fcc0b5b9
DM
41 Then I should not see "cat1" in the "Navigation" "block"
42 And I should not see "cat2" in the "Navigation" "block"
43 And I should see "c1" in the "Navigation" "block"
44 And I should see "c31" in the "Navigation" "block"
45 And I should see "c331" in the "Navigation" "block"
46 And I should not see "c2" in the "Navigation" "block"
47 And I should not see "c32" in the "Navigation" "block"
48 And I should not see "c332" in the "Navigation" "block"
112f1ab9
EL
49
50 @javascript
51 Scenario: The nested list of enrolled courses is shown
52 Given I set the following administration settings values:
53 | Show my course categories | 1 |
54 And I log out
55 And I log in as "student1"
56 When I follow "My home"
fcc0b5b9
DM
57 Then I should see "cat1" in the "Navigation" "block"
58 And I should see "cat3" in the "Navigation" "block"
59 And I should not see "cat2" in the "Navigation" "block"
b8335fd5 60 And I expand "cat3" node
fcc0b5b9
DM
61 And I should see "cat31" in the "Navigation" "block"
62 And I should see "cat33" in the "Navigation" "block"
63 And I should not see "cat32" in the "Navigation" "block"
b8335fd5 64 And I expand "cat31" node
fcc0b5b9 65 And I should see "c31" in the "Navigation" "block"
b8335fd5 66 And I expand "cat33" node
fcc0b5b9
DM
67 And I should see "c331" in the "Navigation" "block"
68 And I should not see "c332" in the "Navigation" "block"
817d39b8
SH
69
70 @javascript
71 Scenario: I can expand categories and courses as guest
72 Given I set the following administration settings values:
73 | Show my course categories | 1 |
74 | Show all courses | 1 |
75 And I log out
76 And I expand "Courses" node
77 And I should see "cat1" in the "Navigation" "block"
78 And I should see "cat2" in the "Navigation" "block"
79 And I should see "cat3" in the "Navigation" "block"
80 And I should not see "cat31" in the "Navigation" "block"
81 And I should not see "cat32" in the "Navigation" "block"
82 And I should not see "cat331" in the "Navigation" "block"
83 And I should not see "c1" in the "Navigation" "block"
84 And I should not see "c2" in the "Navigation" "block"
85 And I should not see "c31" in the "Navigation" "block"
86 And I should not see "c32" in the "Navigation" "block"
87 When I expand "cat3" node
88 And I expand "cat31" node
89 And I expand "cat1" node
90 And I should see "c1" in the "Navigation" "block"
91 And I expand "c1" node
487e68b4 92 Then I should see "cat1" in the "Navigation" "block"
817d39b8
SH
93 And I should see "cat2" in the "Navigation" "block"
94 And I should see "cat3" in the "Navigation" "block"
95 And I should see "cat31" in the "Navigation" "block"
96 And I should see "cat32" in the "Navigation" "block"
97 And I should not see "cat331" in the "Navigation" "block"
98 And I should see "c1" in the "Navigation" "block"
99 And I should not see "c2" in the "Navigation" "block"
100 And I should see "c31" in the "Navigation" "block"
487e68b4 101 And I should not see "c32" in the "Navigation" "block"