1 |
efrain |
1 |
@block @block_course_list
|
|
|
2 |
Feature: Enable the course_list block on the frontpage and view it's contents
|
|
|
3 |
In order to enable the course list block on the frontpage
|
|
|
4 |
As an admin
|
|
|
5 |
I can add the course list block to the frontpage
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "categories" exist:
|
|
|
9 |
| name | category | idnumber |
|
|
|
10 |
| Category A | 0 | CATA |
|
|
|
11 |
| Category B | 0 | CATB |
|
|
|
12 |
| Category C | CATB | CATC |
|
|
|
13 |
And the following "courses" exist:
|
|
|
14 |
| fullname | shortname | category |
|
|
|
15 |
| Course 1 | C1 | 0 |
|
|
|
16 |
| Course 2 | C2 | CATA |
|
|
|
17 |
| Course 3 | C3 | CATB |
|
|
|
18 |
| Course 4 | C4 | CATC |
|
|
|
19 |
And the following "users" exist:
|
|
|
20 |
| username | firstname | lastname | email |
|
|
|
21 |
| teacher1 | Teacher | First | teacher1@example.com |
|
|
|
22 |
And the following "course enrolments" exist:
|
|
|
23 |
| user | course | role |
|
|
|
24 |
| teacher1 | C1 | editingteacher |
|
|
|
25 |
| teacher1 | C2 | editingteacher |
|
|
|
26 |
| teacher1 | C3 | editingteacher |
|
|
|
27 |
|
|
|
28 |
Scenario: Add the course list block on the frontpage and navigate to the course listing
|
|
|
29 |
Given I log in as "admin"
|
|
|
30 |
And I am on site homepage
|
|
|
31 |
And I turn editing mode on
|
|
|
32 |
And the following config values are set as admin:
|
|
|
33 |
| unaddableblocks | | theme_boost|
|
|
|
34 |
And I add the "Courses" block
|
|
|
35 |
And I log out
|
|
|
36 |
When I log in as "teacher1"
|
|
|
37 |
And I am on site homepage
|
|
|
38 |
Then I should see "Course 1" in the "My courses" "block"
|
|
|
39 |
And I should see "Course 2" in the "My courses" "block"
|
|
|
40 |
And I should see "Course 3" in the "My courses" "block"
|
|
|
41 |
And I should not see "Course 4" in the "My courses" "block"
|
|
|
42 |
And I follow "All courses"
|
|
|
43 |
And I should see "Category 1"
|
|
|
44 |
|
|
|
45 |
Scenario: Add the course list block on the frontpage page and navigate to another course
|
|
|
46 |
Given I log in as "admin"
|
|
|
47 |
And I am on site homepage
|
|
|
48 |
And I turn editing mode on
|
|
|
49 |
And the following config values are set as admin:
|
|
|
50 |
| unaddableblocks | | theme_boost|
|
|
|
51 |
And I add the "Courses" block
|
|
|
52 |
And I log out
|
|
|
53 |
When I log in as "teacher1"
|
|
|
54 |
And I am on site homepage
|
|
|
55 |
Then I should see "Course 1" in the "My courses" "block"
|
|
|
56 |
And I should see "Course 2" in the "My courses" "block"
|
|
|
57 |
And I should see "Course 3" in the "My courses" "block"
|
|
|
58 |
And I should not see "Course 4" in the "My courses" "block"
|
|
|
59 |
And I am on "Course 3" course homepage
|
|
|
60 |
And I should see "Course 3"
|
|
|
61 |
|
|
|
62 |
Scenario: Add the course list block on the frontpage page and view as an admin
|
|
|
63 |
Given I log in as "admin"
|
|
|
64 |
And I am on site homepage
|
|
|
65 |
And I turn editing mode on
|
|
|
66 |
And the following config values are set as admin:
|
|
|
67 |
| unaddableblocks | | theme_boost|
|
|
|
68 |
When I add the "Courses" block
|
|
|
69 |
Then I should see "Category 1" in the "Course categories" "block"
|
|
|
70 |
And I should see "Category A" in the "Course categories" "block"
|
|
|
71 |
And I should see "Category B" in the "Course categories" "block"
|
|
|
72 |
And I should not see "Category C" in the "Course categories" "block"
|
|
|
73 |
And I should not see "Course 1" in the "Course categories" "block"
|
|
|
74 |
And I should not see "Course 2" in the "Course categories" "block"
|
|
|
75 |
And I follow "All courses"
|
|
|
76 |
And I should see "Category 1"
|
|
|
77 |
|
|
|
78 |
Scenario: Add the course list block on the frontpage page and view as a guest
|
|
|
79 |
Given I log in as "admin"
|
|
|
80 |
And I am on site homepage
|
|
|
81 |
And I turn editing mode on
|
|
|
82 |
And the following config values are set as admin:
|
|
|
83 |
| unaddableblocks | | theme_boost|
|
|
|
84 |
And I add the "Courses" block
|
|
|
85 |
And I log out
|
|
|
86 |
When I log in as "guest"
|
|
|
87 |
Then I should see "Category 1" in the "Course categories" "block"
|
|
|
88 |
And I should see "Category A" in the "Course categories" "block"
|
|
|
89 |
And I should see "Category B" in the "Course categories" "block"
|
|
|
90 |
And I should not see "Category C" in the "Course categories" "block"
|
|
|
91 |
And I should not see "Course 1" in the "Course categories" "block"
|
|
|
92 |
And I should not see "Course 2" in the "Course categories" "block"
|
|
|
93 |
And I follow "All courses"
|
|
|
94 |
And I should see "Category 1"
|