on-demand release 4.2dev+
[moodle.git] / message / tests / behat / message_preferences.feature
blobb7df3ba9129aa874e01d107442b07dad9eb7c606
1 @core @core_message
2 Feature: To be able to see and save user message preferences as admin
3   As an admin
4   I need to be able to view and edit message preferences for other users
6   Background:
7     Given the following "users" exist:
8       | username | firstname | lastname | email                |
9       | student1 | Student   | 1        | student1@emample.com |
10     And the following "user preferences" exist:
11       | user      | preference                                        | value |
12       | student1  | message_provider_moodle_instantmessage_enabled    | email |
14   @javascript
15   Scenario: As an admin I can view and edit message preferences for a user
16     Given I log in as "admin"
17     And I navigate to "Messaging > Notification settings" in site administration
18     And I set the field "email" to "1"
19     And I press "Save changes"
20     And I am on the "student1" "user > profile" page
21     And I click on "Preferences" "link" in the "#region-main-box" "css_element"
22     And I click on "Message preferences" "link" in the "#region-main-box" "css_element"
23     And I should not see "Enabled" in the "Email" "table_row"
24     And I click on "//div[@class='preference-state']" "xpath_element"
25     And I log out
26     And I log in as "student1"
27     And I follow "Preferences" in the user menu
28     And I click on "Message preferences" "link"
29     And the field "Email" matches value "0"