1 |
efrain |
1 |
@enrol @enrol_guest
|
|
|
2 |
Feature: Guest users can auto-enrol themself in courses where guest access is allowed
|
|
|
3 |
In order to access courses contents
|
|
|
4 |
As a guest
|
|
|
5 |
I need to access courses as a guest
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
11 |
| student1 | Student | 1 | student1@example.com |
|
|
|
12 |
And the following "courses" exist:
|
|
|
13 |
| fullname | shortname | format |
|
|
|
14 |
| Course 1 | C1 | topics |
|
|
|
15 |
And the following "course enrolments" exist:
|
|
|
16 |
| user | course | role |
|
|
|
17 |
| teacher1 | C1 | editingteacher |
|
|
|
18 |
And the following "activity" exists:
|
|
|
19 |
| activity | forum |
|
|
|
20 |
| course | C1 |
|
|
|
21 |
| idnumber | 0001 |
|
|
|
22 |
| name | Test forum name |
|
|
|
23 |
And I am on the "Course 1" "enrolment methods" page logged in as teacher1
|
|
|
24 |
|
|
|
25 |
Scenario: Allow guest access without password
|
|
|
26 |
Given I click on "Edit" "link" in the "Guest access" "table_row"
|
|
|
27 |
And I set the following fields to these values:
|
|
|
28 |
| Allow guest access | Yes |
|
|
|
29 |
And I press "Save changes"
|
|
|
30 |
When I am on the "Test forum name" "forum activity" page logged in as student1
|
|
|
31 |
Then I should not see "Subscribe to this forum"
|
|
|
32 |
|
|
|
33 |
Scenario: Allow guest access with password
|
|
|
34 |
Given I click on "Edit" "link" in the "Guest access" "table_row"
|
|
|
35 |
And I set the following fields to these values:
|
|
|
36 |
| Allow guest access | Yes |
|
|
|
37 |
| Password | moodle_rules |
|
|
|
38 |
And I press "Save changes"
|
|
|
39 |
When I am on the "Course 1" course page logged in as student1
|
|
|
40 |
Then I should see "Guest access"
|
|
|
41 |
And I set the following fields to these values:
|
|
|
42 |
| Password | moodle_rules |
|
|
|
43 |
And I press "Submit"
|
|
|
44 |
And I should see "Test forum name"
|