1 |
efrain |
1 |
@core @core_badges
|
|
|
2 |
Feature: Delete course badge already awarded
|
|
|
3 |
As a teacher
|
|
|
4 |
I can delete awarded course badge
|
|
|
5 |
|
|
|
6 |
Background:
|
|
|
7 |
Given the following "users" exist:
|
|
|
8 |
| username | firstname | lastname | email |
|
|
|
9 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
10 |
| student1 | Student | 1 | student1@example.com |
|
|
|
11 |
And the following "courses" exist:
|
|
|
12 |
| fullname | shortname |
|
|
|
13 |
| Course 1 | C1 |
|
|
|
14 |
And the following "course enrolments" exist:
|
|
|
15 |
| user | course | role |
|
|
|
16 |
| teacher1 | C1 | editingteacher |
|
|
|
17 |
| student1 | C1 | student |
|
|
|
18 |
|
|
|
19 |
@javascript
|
|
|
20 |
Scenario Outline: Delete course badge already awarded to student
|
|
|
21 |
Given the following "core_badges > Badges" exist:
|
|
|
22 |
| name | course | description | image | status | type |
|
|
|
23 |
| <badgename> | C1 | <badgename> description | badges/tests/behat/badge.png | active | 2 |
|
|
|
24 |
And the following "core_badges > Criterias" exist:
|
|
|
25 |
| badge | role |
|
|
|
26 |
| <badgename> | editingteacher |
|
|
|
27 |
And the following "core_badges > Issued badges" exist:
|
|
|
28 |
| badge | user |
|
|
|
29 |
| <badgename> | student1 |
|
|
|
30 |
When I am on the "Course 1" "enrolled users" page logged in as "teacher1"
|
|
|
31 |
And I click on "Student 1" "link"
|
|
|
32 |
Then I should see "<badgename>"
|
|
|
33 |
And I am on the "Course 1" course page
|
|
|
34 |
# Navigate to Manage Badges page in order to delete the badge
|
|
|
35 |
And I navigate to "Badges > Manage badges" in current page administration
|
|
|
36 |
# Delete the badge
|
|
|
37 |
And I press "Delete" action in the "<badgename>" report row
|
|
|
38 |
And I press "<deleteoption>"
|
|
|
39 |
And I am on the "Course 1" "enrolled users" page
|
|
|
40 |
And I click on "Student 1" "link"
|
|
|
41 |
# Confirm that Badge 1 is retained as awarded badge but Badge 2 is not
|
|
|
42 |
And I <visibility> see "<badgename>"
|
|
|
43 |
And I am on the "Course 1" course page
|
|
|
44 |
# Navigate to Badges page to confirm that no badges exist, hence, Manage badges would not exist
|
|
|
45 |
And I navigate to "Badges" in current page administration
|
|
|
46 |
# Confirm that badges are sucessfully deleted
|
|
|
47 |
And I should see "There are currently no badges available for users to earn."
|
|
|
48 |
|
|
|
49 |
Examples:
|
|
|
50 |
| badgename | deleteoption | visibility |
|
|
|
51 |
| Badge 1 | Delete and keep existing issued badges | should |
|
|
|
52 |
| Badge 2 | Delete and remove existing issued badges | should not |
|