1 |
efrain |
1 |
@block @block_featured_courses
|
|
|
2 |
Feature: Add a featured block on the dashboard
|
|
|
3 |
I can add completion block to the dashboard and set the courses as featured
|
|
|
4 |
|
|
|
5 |
Background:
|
|
|
6 |
And the following "courses" exist:
|
|
|
7 |
| fullname | shortname | category | enablecompletion |
|
|
|
8 |
| Course 1 | C1 | 0 | 1 |
|
|
|
9 |
| Course 2 | C2 | 0 | 1 |
|
|
|
10 |
| Course 3 | C3 | 0 | 1 |
|
|
|
11 |
| Course 4 | C4 | 0 | 1 |
|
|
|
12 |
|
|
|
13 |
@javascript
|
|
|
14 |
Scenario: Add the block, set 4 featured courses and remove one after, only two should display
|
|
|
15 |
Given I log in as "admin"
|
|
|
16 |
And I set editing mode on
|
|
|
17 |
And I add the "Featured courses" block
|
|
|
18 |
And I configure the "Featured courses" block
|
|
|
19 |
And I expand all fieldsets
|
|
|
20 |
And I should see "Title"
|
|
|
21 |
And I set the field "Title" to "My featured courses"
|
|
|
22 |
And I press "Add 3 more courses"
|
|
|
23 |
Then I set the following fields to these values:
|
|
|
24 |
| Selected course 1 | Course 1 |
|
|
|
25 |
| Selected course 2 | Course 2 |
|
|
|
26 |
| Selected course 3 | Course 3 |
|
|
|
27 |
| Selected course 4 | Course 4 |
|
|
|
28 |
And I set the field "Region" to "content"
|
|
|
29 |
And I press "Save changes"
|
|
|
30 |
Then I should see "Course 1" in the "My featured courses" "block"
|
|
|
31 |
Then I should see "Course 2" in the "My featured courses" "block"
|
|
|
32 |
Then I should see "Course 3" in the "My featured courses" "block"
|
|
|
33 |
Then I should see "Course 4" in the "My featured courses" "block"
|
|
|
34 |
Then I configure the "My featured courses" block
|
|
|
35 |
And I press "Remove last course"
|
|
|
36 |
And I press "Save changes"
|
|
|
37 |
Then I should see "Course 1" in the "My featured courses" "block"
|
|
|
38 |
Then I should see "Course 2" in the "My featured courses" "block"
|
|
|
39 |
Then I should see "Course 3" in the "My featured courses" "block"
|
|
|
40 |
Then I should not see "Course 4" in the "My featured courses" "block"
|