weekly release 5.0dev
[moodle.git] / user / tests / behat / edit_profile_notification.feature
blob93568c758e6e5d17abb1383a85b966c54ca96aa0
1 @core @core_user
2 Feature: Notification shown when user edit profile or preferences
3   In order to show notification
4   As a user
5   I press update profile button after make some changes in edit profile page
7   Background:
8     Given the following "users" exist:
9       | username | firstname | lastname | email               |
10       | unicorn  | Unicorn   | 1        | unicorn@example.com |
11     And the following "courses" exist:
12       | fullname | shortname | category | groupmode |
13       | Course 1 | C1        | 0        | 1         |
14     And the following "course enrolments" exist:
15       | user    | course | role    |
16       | unicorn | C1     | student |
18   @javascript
19   Scenario: Change own profile and has notification shown
20     Given I log in as "unicorn"
21     And I open my profile in edit mode
22     And I should see "Unicorn"
23     And I should see "1"
24     Then I set the field "Last name" to "Lil"
25     And I click on "Update profile" "button"
26     And I should see "Changes saved"
27     And I press "Dismiss this notification"
28     And I should not see "Changes saved"
29     And I follow "Preferences" in the user menu
30     And I follow "Preferred language"
31     And I click on "Save changes" "button"
32     And I should see "Changes saved"
33     And I follow "Forum preferences"
34     And I set the field "Use experimental nested discussion view" to "Yes"
35     And I click on "Save changes" "button"
36     And I should see "Changes saved"
38   @javascript
39   Scenario: Do not show notification when cancel profile change
40     Given I log in as "unicorn"
41     And I open my profile in edit mode
42     And I should see "Unicorn"
43     And I should see "1"
44     Then I set the field "Last name" to "Lil"
45     And I click on "Cancel" "button"
46     And I should not see "Changes saved"
48   @javascript
49   Scenario: Show notification after admin edited profile of another user
50     Given I am on the "unicorn" "user > editing" page logged in as "admin"
51     And I expand all fieldsets
52     Then I set the field "Last name" to "Lil"
53     And I click on "Update profile" "button"
54     And I should see "Changes saved"