|
| 1 | +@mod @mod_customcert |
| 2 | +Feature: Being able to verify a certificate with an expiry element |
| 3 | + In order to ensure expiry elements are working as expected |
| 4 | + As a teacher |
| 5 | + I need to verify a certificate with an expiry element |
| 6 | + |
| 7 | + Background: |
| 8 | + Given the following "courses" exist: |
| 9 | + | fullname | shortname | category | |
| 10 | + | Course 1 | C1 | 0 | |
| 11 | + And the following "users" exist: |
| 12 | + | username | firstname | lastname | email | |
| 13 | + | teacher1 | Teacher | 1 | teacher1@example.com | |
| 14 | + | student1 | Student | 1 | student1@example.com | |
| 15 | + And the following "course enrolments" exist: |
| 16 | + | user | course | role | |
| 17 | + | teacher1 | C1 | editingteacher | |
| 18 | + | student1 | C1 | student | |
| 19 | + And the following "activities" exist: |
| 20 | + | activity | name | intro | course | idnumber | verifyany | |
| 21 | + | customcert | Custom certificate 1 | Custom certificate 1 intro | C1 | customcert1 | 0 | |
| 22 | + And I log in as "teacher1" |
| 23 | + And I am on "Course 1" course homepage |
| 24 | + And I follow "Custom certificate 1" |
| 25 | + And I navigate to "Edit certificate" in current page administration |
| 26 | + And I add the element "Code" to page "1" of the "Custom certificate 1" certificate template |
| 27 | + And I set the following fields to these values: |
| 28 | + | Font | Helvetica | |
| 29 | + | Size | 20 | |
| 30 | + | Colour | #045ECD | |
| 31 | + | Width | 20 | |
| 32 | + | Reference point location | Top left | |
| 33 | + And I press "Save changes" |
| 34 | + And I add the element "Expiry" to page "1" of the "Custom certificate 1" certificate template |
| 35 | + And I set the following fields to these values: |
| 36 | + | Date item | Expiry date (1 year) | |
| 37 | + | Date format | 2 | |
| 38 | + | Start date | award | |
| 39 | + | Font | Helvetica | |
| 40 | + | Size | 20 | |
| 41 | + | Colour | #045ECD | |
| 42 | + | Width | 20 | |
| 43 | + | Reference point location | Top left | |
| 44 | + And I press "Save changes" |
| 45 | + |
| 46 | + Scenario: Verify a certificate with an expiry element |
| 47 | + Given I log in as "student1" |
| 48 | + And I am on "Course 1" course homepage |
| 49 | + When I follow "Custom certificate 1" |
| 50 | + And I press "View certificate" |
| 51 | + And I log out |
| 52 | + And I log in as "teacher1" |
| 53 | + And I visit the verification url for the "Custom certificate 1" certificate |
| 54 | + Then I verify the "Custom certificate 1" certificate for the user "student1" |
0 commit comments