MDL-41254 backup Raise time and memory limit in precheck.
[moodle.git] / completion / tests / behat / restrict_section_availability.feature
CommitLineData
550d842e 1@core @core_completion
4569bc7c
DM
2Feature: Restrict sections availability through completion conditions
3 In order to control section's contents access through activities completion
5d7b6307 4 As a teacher
4569bc7c
DM
5 I need to restrict sections availability using different conditions
6
7 @javascript
8 Scenario: Show section greyed-out to students when completion conditions are not satisfied
9 Given the following "courses" exists:
10 | fullname | shortname | category |
11 | Course 1 | C1 | 0 |
12 And the following "users" exists:
13 | username | firstname | lastname | email |
14 | teacher1 | Teacher | Frist | teacher1@asd.com |
15 | student1 | Student | First | student1@asd.com |
16 And the following "course enrolments" exists:
17 | user | course | role |
18 | teacher1 | C1 | editingteacher |
19 | student1 | C1 | student |
20 And I log in as "admin"
21 And I set the following administration settings values:
22 | Enable completion tracking | 1 |
23 | Enable conditional access | 1 |
24 And I log out
25 And I log in as "teacher1"
26 And I follow "Course 1"
27 And I turn editing mode on
28 And I follow "Edit settings"
29 And I fill the moodle form with:
5bc7cd92 30 | Enable completion tracking | Yes |
4569bc7c
DM
31 And I press "Save changes"
32 And I add a "Label" to section "1" and I fill the form with:
33 | Label text | Test label |
34 | Completion tracking | Students can manually mark the activity as completed |
35 And I add a "Page" to section "2" and I fill the form with:
36 | Name | Test page name |
37 | Description | Test page description |
38 | Page content | Test page contents |
39 When I click on "Edit summary" "link" in the "#section-2" "css_element"
40 And I fill the moodle form with:
41 | id_conditioncompletiongroup_0_conditionsourcecmid | Test label |
42 | id_conditioncompletiongroup_0_conditionrequiredcompletion | must be marked complete |
43 | Before section can be accessed | Show section greyed-out, with restriction information |
44 And I press "Save changes"
45 And I log out
46 And I log in as "student1"
47 And I follow "Course 1"
48 Then I should see "Not available until the activity Test label is marked complete."
49 And I should not see "Test page name"
50 And I press "Not completed: Test label. Select to mark as complete."
51 And I should see "Test page name"
52 And I should not see "Not available until the activity Test label is marked complete."