1 |
efrain |
1 |
@core @core_my
|
|
|
2 |
Feature: Reset all personalised pages to default
|
|
|
3 |
In order to reset everyone's personalised pages
|
|
|
4 |
As an admin
|
|
|
5 |
I need to press a button on the pages to customise the default pages
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| student1 | Student | 1 | student1@example.com |
|
|
|
11 |
| student2 | Student | 2 | student2@example.com |
|
|
|
12 |
| student3 | Student | 3 | student3@example.com |
|
|
|
13 |
And the following "role capability" exists:
|
|
|
14 |
| role | user |
|
|
|
15 |
| moodle/block:edit | allow |
|
|
|
16 |
| block/myprofile:addinstance | allow |
|
|
|
17 |
And the following "blocks" exist:
|
|
|
18 |
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
|
|
19 |
| comments | User | student1 | my-index | side-pre |
|
|
|
20 |
| myprofile | User | student2 | user-profile | side-pre |
|
|
|
21 |
|
|
|
22 |
And I log in as "student1"
|
|
|
23 |
And I should see "Comments"
|
|
|
24 |
And I log out
|
|
|
25 |
|
|
|
26 |
And I log in as "student2"
|
|
|
27 |
And I follow "Profile" in the user menu
|
|
|
28 |
And I should see "Logged in user"
|
|
|
29 |
And I log out
|
|
|
30 |
|
|
|
31 |
And I log in as "student3"
|
|
|
32 |
And I should not see "Comments"
|
|
|
33 |
And I follow "Profile" in the user menu
|
|
|
34 |
And I should not see "Logged in user"
|
|
|
35 |
And I log out
|
|
|
36 |
|
|
|
37 |
Scenario: Reset Dashboard for all users
|
|
|
38 |
Given I log in as "admin"
|
|
|
39 |
And I navigate to "Appearance > Default Dashboard page" in site administration
|
|
|
40 |
And I turn editing mode on
|
|
|
41 |
And I add the "Latest announcements" block
|
|
|
42 |
And I open the "Timeline" blocks action menu
|
|
|
43 |
And I follow "Delete Timeline block"
|
|
|
44 |
And I press "Yes"
|
|
|
45 |
And I turn editing mode off
|
|
|
46 |
And I log out
|
|
|
47 |
|
|
|
48 |
And I log in as "student1"
|
|
|
49 |
And I should not see "Latest announcements"
|
|
|
50 |
And I should see "Timeline"
|
|
|
51 |
And I log out
|
|
|
52 |
|
|
|
53 |
And I log in as "student3"
|
|
|
54 |
And I should not see "Latest announcements"
|
|
|
55 |
And I should see "Timeline"
|
|
|
56 |
And I log out
|
|
|
57 |
|
|
|
58 |
And I log in as "admin"
|
|
|
59 |
And I navigate to "Appearance > Default Dashboard page" in site administration
|
|
|
60 |
When I press "Reset Dashboard for all users"
|
|
|
61 |
And I should see "All Dashboard pages have been reset to default."
|
|
|
62 |
And I log out
|
|
|
63 |
|
|
|
64 |
And I log in as "student1"
|
|
|
65 |
Then I should see "Latest announcements"
|
|
|
66 |
And I should not see "Comments"
|
|
|
67 |
And I should not see "Timeline"
|
|
|
68 |
And I log out
|
|
|
69 |
|
|
|
70 |
And I log in as "student3"
|
|
|
71 |
And I should see "Latest announcements"
|
|
|
72 |
And I should not see "Timeline"
|
|
|
73 |
And I log out
|
|
|
74 |
|
|
|
75 |
# Check that this did not affect the customised profiles.
|
|
|
76 |
And I am on the "student2" "user > profile" page logged in as student2
|
|
|
77 |
And I should see "Logged in user"
|
|
|
78 |
And I should not see "Latest announcements"
|
|
|
79 |
|
|
|
80 |
Scenario: Reset profile for all users
|
|
|
81 |
Given I log in as "admin"
|
|
|
82 |
And I navigate to "Appearance > Default profile page" in site administration
|
|
|
83 |
And I turn editing mode on
|
|
|
84 |
And I add the "Latest announcements" block
|
|
|
85 |
And I log out
|
|
|
86 |
|
|
|
87 |
And I am on the "student2" "user > profile" page logged in as student2
|
|
|
88 |
And I should not see "Latest announcements"
|
|
|
89 |
And I log out
|
|
|
90 |
|
|
|
91 |
And I am on the "student3" "user > profile" page logged in as student3
|
|
|
92 |
And I should not see "Latest announcements"
|
|
|
93 |
And I log out
|
|
|
94 |
|
|
|
95 |
And I log in as "admin"
|
|
|
96 |
And I navigate to "Appearance > Default profile page" in site administration
|
|
|
97 |
When I press "Reset profile for all users"
|
|
|
98 |
And I should see "All profile pages have been reset to default."
|
|
|
99 |
And I log out
|
|
|
100 |
|
|
|
101 |
And I am on the "student2" "user > profile" page logged in as student2
|
|
|
102 |
Then I should see "Latest announcements"
|
|
|
103 |
And I should not see "Logged in user"
|
|
|
104 |
And I log out
|
|
|
105 |
|
|
|
106 |
And I am on the "student3" "user > profile" page logged in as student3
|
|
|
107 |
And I should see "Latest announcements"
|
|
|
108 |
And I log out
|
|
|
109 |
|
|
|
110 |
# Check that this did not affect the customised dashboards.
|
|
|
111 |
And I log in as "student1"
|
|
|
112 |
And I should see "Comments"
|
|
|
113 |
And I should not see "Latest announcements"
|