1 |
efrain |
1 |
@block @block_badges @core_badges @_file_upload @javascript
|
|
|
2 |
Feature: Enable Block Badges on the frontpage and view awarded badges
|
|
|
3 |
In order to enable the badges block on the frontpage
|
|
|
4 |
As a admin
|
|
|
5 |
I can add badges block to the frontpage
|
|
|
6 |
|
|
|
7 |
Scenario: Add the recent badges block on the frontpage and view recent badges
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email | idnumber |
|
|
|
10 |
| teacher1 | Teacher | 1 | teacher1@example.com | T1 |
|
|
|
11 |
And the following "courses" exist:
|
|
|
12 |
| fullname | shortname | category |
|
|
|
13 |
| Course 1 | C1 | 0 |
|
|
|
14 |
And the following "course enrolments" exist:
|
|
|
15 |
| user | course | role |
|
|
|
16 |
| teacher1 | C1 | editingteacher |
|
|
|
17 |
And the following "blocks" exist:
|
|
|
18 |
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
|
|
19 |
| badges | System | 1 | site-index | side-pre |
|
|
|
20 |
And I am on the "Course 1" course page logged in as teacher1
|
|
|
21 |
# Issue badge 1 of 2
|
|
|
22 |
And I navigate to "Badges > Add a new badge" in current page administration
|
|
|
23 |
And I set the following fields to these values:
|
|
|
24 |
| id_name | Badge 1 |
|
|
|
25 |
| id_description | Badge 1 |
|
|
|
26 |
And I upload "blocks/badges/tests/fixtures/badge.png" file to "Image" filemanager
|
|
|
27 |
And I press "Create badge"
|
|
|
28 |
And I select "Manual issue by role" from the "Add badge criteria" singleselect
|
|
|
29 |
And I set the field "Teacher" to "1"
|
|
|
30 |
And I press "Save"
|
|
|
31 |
And I press "Enable access"
|
|
|
32 |
And I press "Continue"
|
|
|
33 |
And I select "Recipients (0)" from the "jump" singleselect
|
|
|
34 |
And I press "Award badge"
|
|
|
35 |
And I set the field "potentialrecipients[]" to "Teacher 1 (teacher1@example.com)"
|
|
|
36 |
And I press "Award badge"
|
|
|
37 |
When I am on site homepage
|
|
|
38 |
Then I should see "Badge 1" in the "Latest badges" "block"
|