1 |
efrain |
1 |
@mod @mod_customcert
|
|
|
2 |
Feature: Being able to view the certificates you have been issued
|
|
|
3 |
In order to ensure that a user can view the certificates they have been issued
|
|
|
4 |
As a student
|
|
|
5 |
I need to view the certificates I have been issued
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "courses" exist:
|
|
|
9 |
| fullname | shortname | category |
|
|
|
10 |
| Course 1 | C1 | 0 |
|
|
|
11 |
| Course 2 | C2 | 0 |
|
|
|
12 |
And the following "users" exist:
|
|
|
13 |
| username | firstname | lastname | email |
|
|
|
14 |
| student1 | Student | 1 | student1@example.com |
|
|
|
15 |
| student2 | Student | 2 | student2@example.com |
|
|
|
16 |
And the following "course enrolments" exist:
|
|
|
17 |
| user | course | role |
|
|
|
18 |
| student1 | C1 | student |
|
|
|
19 |
| student2 | C1 | student |
|
|
|
20 |
| student1 | C2 | student |
|
|
|
21 |
And the following "activities" exist:
|
|
|
22 |
| activity | name | intro | course | idnumber |
|
|
|
23 |
| customcert | Custom certificate 1 | Custom certificate 1 intro | C1 | customcert1 |
|
|
|
24 |
| customcert | Custom certificate 2 | Custom certificate 2 intro | C2 | customcert2 |
|
|
|
25 |
|
|
|
26 |
Scenario: View your issued certificates on the my certificates page
|
|
|
27 |
And I log in as "student1"
|
|
|
28 |
And I am on "Course 1" course homepage
|
|
|
29 |
And I follow "Custom certificate 1"
|
|
|
30 |
And I press "View certificate"
|
|
|
31 |
And I follow "Profile" in the user menu
|
|
|
32 |
And I follow "My certificates"
|
|
|
33 |
And I should see "Custom certificate 1"
|
|
|
34 |
And I should not see "Custom certificate 2"
|
|
|
35 |
And I am on "Course 2" course homepage
|
|
|
36 |
And I follow "Custom certificate 2"
|
|
|
37 |
And I press "View certificate"
|
|
|
38 |
And I follow "Profile" in the user menu
|
|
|
39 |
And I follow "My certificates"
|
|
|
40 |
And I should see "Custom certificate 1"
|
|
|
41 |
And I should see "Custom certificate 2"
|
|
|
42 |
|
|
|
43 |
Scenario: User does not see link for another user's certificates
|
|
|
44 |
And I log in as "student1"
|
|
|
45 |
And I am on "Course 1" course homepage
|
|
|
46 |
And I follow "Custom certificate 1"
|
|
|
47 |
And I press "View certificate"
|
|
|
48 |
And I log in as "student2"
|
|
|
49 |
And I am on "Course 1" course homepage
|
|
|
50 |
And I follow "Participants"
|
|
|
51 |
And I follow "Student 1"
|
|
|
52 |
And I should not see "My certificates"
|