Merge branch 'MDL-53140-master' of git://github.com/rezaies/moodle
[moodle.git] / completion / tests / behat / completion_no_calendar_capabilities.feature
CommitLineData
3f560e80
NM
1@core @core_completion
2Feature: Completion with no calendar capabilites
3 In order to allow work effectively
4 As a teacher
5 I need to be able to create activities with completion enabled without calendar capabilities
6
7 Background:
8 Given the following "courses" exist:
9 | fullname | shortname | category | groupmode | enablecompletion |
10 | Course 1 | C1 | 0 | 1 | 1 |
11 And the following "users" exist:
12 | username | firstname | lastname | email |
13 | teacher1 | Teacher | 1 | teacher1@example.com |
14 And the following "course enrolments" exist:
15 | user | course | role |
16 | teacher1 | C1 | editingteacher |
17 And I log in as "admin"
18 And I am on "Course 1" course homepage
19 And I navigate to "Users > Permissions" in current page administration
20 And I override the system permissions of "Teacher" role with:
21 | capability | permission |
22 | moodle/calendar:manageentries | Prohibit |
23 And I log out
24
25 Scenario: Editing completion date
26 Given I log in as "admin"
27 And I am on "Course 1" course homepage with editing mode on
28 When I add a "Forum" to section "1" and I fill the form with:
29 | Forum name | Test forum name |
30 | Description | Test forum description |
31 | Completion tracking | Show activity as complete when conditions are met |
32 | id_completionexpected_enabled | 1 |
33 | id_completionexpected_day | 1 |
34 | id_completionexpected_month | 1 |
35 | id_completionexpected_year | 2017 |
36 And I log out
37 When I log in as "teacher1"
38 And I am on "Course 1" course homepage with editing mode on
39 And I follow "Test forum name"
40 And I navigate to "Edit settings" in current page administration
41 And I set the following fields to these values:
42 | id_completionexpected_year | 2018 |
43 And I press "Save and return to course"
44 Then I should see "Test forum name"