1 |
efrain |
1 |
@enrol @enrol_fee
|
|
|
2 |
Feature: Signing up for a course with a fee enrolment method
|
|
|
3 |
|
|
|
4 |
Background:
|
|
|
5 |
Given the following "users" exist:
|
|
|
6 |
| username | firstname | lastname | email |
|
|
|
7 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
8 |
| student1 | Student | 1 | student1@example.com |
|
|
|
9 |
| manager1 | Manager | 1 | manager1@example.com |
|
|
|
10 |
And the following "courses" exist:
|
|
|
11 |
| fullname | shortname | format | summary |
|
|
|
12 |
| Course 1 | C1 | topics | |
|
|
|
13 |
And the following "course enrolments" exist:
|
|
|
14 |
| user | course | role |
|
|
|
15 |
| teacher1 | C1 | editingteacher |
|
|
|
16 |
| manager1 | C1 | manager |
|
|
|
17 |
And the following "core_payment > payment accounts" exist:
|
|
|
18 |
| name | gateways |
|
|
|
19 |
| Account1 | paypal |
|
|
|
20 |
And I log in as "admin"
|
|
|
21 |
And I navigate to "Plugins > Enrolments > Manage enrol plugins" in site administration
|
|
|
22 |
And I click on "Enable" "link" in the "Enrolment on payment" "table_row"
|
|
|
23 |
And I log out
|
|
|
24 |
And I log in as "manager1"
|
|
|
25 |
And I am on the "Course 1" "enrolment methods" page
|
|
|
26 |
And I select "Enrolment on payment" from the "Add method" singleselect
|
|
|
27 |
And I set the following fields to these values:
|
|
|
28 |
| Payment account | Account1 |
|
|
|
29 |
| Enrolment fee | 123.45 |
|
|
|
30 |
| Currency | Euro |
|
|
|
31 |
And I press "Add method"
|
|
|
32 |
And I log out
|
|
|
33 |
|
|
|
34 |
@javascript
|
|
|
35 |
Scenario: Student can see the payment prompt on the course enrolment page
|
|
|
36 |
When I log in as "student1"
|
|
|
37 |
And I am on course index
|
|
|
38 |
And I follow "Course 1"
|
|
|
39 |
Then I should see "This course requires a payment for entry."
|
|
|
40 |
And I should see "123.45"
|
|
|
41 |
And I press "Select payment type"
|
|
|
42 |
And I should see "PayPal" in the "Select payment type" "dialogue"
|
|
|
43 |
And I click on "Cancel" "button" in the "Select payment type" "dialogue"
|
|
|
44 |
|
|
|
45 |
Scenario: Guest can see the login prompt on the course enrolment page
|
|
|
46 |
When I log in as "guest"
|
|
|
47 |
And I am on course index
|
|
|
48 |
And I follow "Course 1"
|
|
|
49 |
Then I should see "This course requires a payment for entry."
|
|
|
50 |
And I should see "123.45"
|
|
|
51 |
And I should see "Log in to the site"
|