|
| 1 | +@core_enrol @app @enrol @enrol_self @javascript @lms_upto5.1 |
| 2 | +Feature: Users can auto-enrol themself in courses where self enrolment is allowed |
| 3 | + In order to participate in courses while using the mobile app |
| 4 | + As a user |
| 5 | + I need to auto enrol me in courses |
| 6 | + |
| 7 | + Background: |
| 8 | + Given the Moodle site is compatible with this feature |
| 9 | + And the following "users" exist: |
| 10 | + | username | firstname | lastname | email | |
| 11 | + | teacher1 | Teacher | 1 | teacher1@example.com | |
| 12 | + | student1 | Student | 1 | student1@example.com | |
| 13 | + | student2 | Student | 2 | student2@example.com | |
| 14 | + And the following "courses" exist: |
| 15 | + | fullname | shortname | format | initsections | |
| 16 | + | Course 1 | C1 | topics | 1 | |
| 17 | + And the following "course enrolments" exist: |
| 18 | + | user | course | role | |
| 19 | + | teacher1 | C1 | editingteacher | |
| 20 | + |
| 21 | + Scenario: Self-enrolment enabled with simultaneous guest access |
| 22 | + Given I log in as "teacher1" |
| 23 | + And I am on the "Course 1" "enrolment methods" page |
| 24 | + And I add "Self enrolment" enrolment method in "Course 1" with: |
| 25 | + | Custom instance name | Self enrolment (Student with password) | |
| 26 | + | Enrolment key | moodle_rules | |
| 27 | + And I click on "Enable" "link" in the "Self enrolment (Student)" "table_row" |
| 28 | + And I click on "Edit" "link" in the "Guest access" "table_row" |
| 29 | + And I set the following fields to these values: |
| 30 | + | Allow guest access | Yes | |
| 31 | + And I press "Save changes" |
| 32 | + |
| 33 | + When I entered the app as "student1" |
| 34 | + And I press "Site home" in the app |
| 35 | + And I press "Available courses" in the app |
| 36 | + And I press "Course 1" in the app |
| 37 | + Then I should find "Course summary" in the app |
| 38 | + And I should find "Course" in the app |
| 39 | + And I should find "Enrol me" in the app |
| 40 | + And I should find "View course" in the app |
| 41 | + |
| 42 | + When I press "Enrol me" in the app |
| 43 | + Then I should find "Self enrolment (Student)" in the app |
| 44 | + And I should find "Self enrolment (Student with password)" in the app |
| 45 | + |
| 46 | + When I press "Self enrolment (Student)" in the app |
| 47 | + Then I should find "Self enrolment (Student)" in the app |
| 48 | + Then I should not find "Self enrolment (Student with password)" in the app |
0 commit comments