1 |
efrain |
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
|
|
|
6 |
|
|
|
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 |
|
|
|
17 |
|
|
|
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"
|
|
|
37 |
|
|
|
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"
|
|
|
47 |
|
|
|
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"
|