MDL-68661 core_lang: Roll back addresourceoractivity
[moodle.git] / user / tests / behat / course_preference.feature
CommitLineData
fdac806a
JA
1@core @core_user
2Feature: As a user, "Course preferences" allows me to set my course preference(s).
3 Background:
4 Given I log in as "admin"
5 And the following "courses" exist:
6 | fullname | shortname | format |
7 | Course 1 | C1 | topics |
8 And the following "course enrolments" exist:
9 | user | course | role |
10 | admin | C1 | editingteacher |
11 And I am on site homepage
12 And I follow "Preferences" in the user menu
fdeeaff9 13 And I follow "Course preferences"
fdac806a
JA
14
15 @javascript
16 Scenario: As a user, "activity chooser" should be the default.
17 # See that the "activity chooser" is enabled by default.
18 Given the field "enableactivitychooser" matches value "1"
19 # See that the "activity chooser" is actually shown by default in course page.
197e2bca 20 When I am on "Course 1" course homepage
7f864552 21 And I should not see "Add an activity or resource" in the "Topic 1" "section"
fdac806a 22 And I turn editing mode on
7f864552 23 Then I should see "Add an activity or resource" in the "Topic 1" "section"
fdac806a
JA
24 And I should not see "Add a resource..." in the "Topic 1" "section"
25
26 @javascript
27 Scenario: As a user, "activity chooser" should be disabled when I uncheck it in "Course preferences"
28 Given I set the field "enableactivitychooser" to "0"
29 And I press "Save changes"
197e2bca 30 When I am on "Course 1" course homepage
fdac806a
JA
31 And I should not see "Add a resource..." in the "Topic 1" "section"
32 And I turn editing mode on
7afd16ad 33 Then I should see "Add a resource..." in the "Topic 1" "section"