1441 |
ariadna |
1 |
@core @core_backup
|
|
|
2 |
Feature: Schema form selectors
|
|
|
3 |
In order to quickly select schema elements
|
|
|
4 |
As an admin
|
|
|
5 |
I need to use the selectors UI to toggle selection of schema elements
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "courses" exist:
|
|
|
9 |
| fullname | shortname | category | numsections | initsections |
|
|
|
10 |
| Course 1 | C1 | 0 | 2 | 1 |
|
|
|
11 |
And the following "activities" exist:
|
|
|
12 |
| activity | course | idnumber | name | intro | section |
|
|
|
13 |
| assign | C1 | assign1 | Test assign 1 | Assign description | 1 |
|
|
|
14 |
| data | C1 | data1 | Test data 1 | Database description | 1 |
|
|
|
15 |
| assign | C1 | assign2 | Test assign 2 | Assign description | 2 |
|
|
|
16 |
| data | C1 | data2 | Test data 2 | Database description | 2 |
|
|
|
17 |
And I am on the "C1" "Course" page logged in as "admin"
|
|
|
18 |
And I navigate to "Course reuse" in current page administration
|
|
|
19 |
And I follow "Backup"
|
|
|
20 |
And I click on "Next" "button" in the "page-content" "region"
|
|
|
21 |
|
|
|
22 |
@javascript
|
|
|
23 |
Scenario: Select all and none should toggle backup schema checkboxes
|
|
|
24 |
Given the field "Section 1" matches value "1"
|
|
|
25 |
And the field "Test assign 1" matches value "1"
|
|
|
26 |
And the field "Test data 1" matches value "1"
|
|
|
27 |
And the field "Section 2" matches value "1"
|
|
|
28 |
And the field "Test assign 2" matches value "1"
|
|
|
29 |
And the field "Test data 2" matches value "1"
|
|
|
30 |
And the "Section 1: User data" "checkbox" should be enabled
|
|
|
31 |
And the "Include Test assign 1 user data" "checkbox" should be enabled
|
|
|
32 |
And the "Include Test data 1 user data" "checkbox" should be enabled
|
|
|
33 |
And the "Section 2: User data" "checkbox" should be enabled
|
|
|
34 |
And the "Include Test assign 2 user data" "checkbox" should be enabled
|
|
|
35 |
And the "Include Test data 2 user data" "checkbox" should be enabled
|
|
|
36 |
# Test select none.
|
|
|
37 |
When I click on "None" "link" in the "backup_selectors_included" "region"
|
|
|
38 |
Then the field "Section 1" matches value ""
|
|
|
39 |
And the field "Test assign 1" matches value ""
|
|
|
40 |
And the field "Test data 1" matches value ""
|
|
|
41 |
And the field "Section 2" matches value ""
|
|
|
42 |
And the field "Test assign 2" matches value ""
|
|
|
43 |
And the field "Test data 2" matches value ""
|
|
|
44 |
And the "Section 1: User data" "checkbox" should be disabled
|
|
|
45 |
And the "Include Test assign 1 user data" "checkbox" should be disabled
|
|
|
46 |
And the "Include Test data 1 user data" "checkbox" should be disabled
|
|
|
47 |
And the "Section 2: User data" "checkbox" should be disabled
|
|
|
48 |
And the "Include Test assign 2 user data" "checkbox" should be disabled
|
|
|
49 |
And the "Include Test data 2 user data" "checkbox" should be disabled
|
|
|
50 |
# Test select all.
|
|
|
51 |
And I click on "All" "link" in the "backup_selectors_included" "region"
|
|
|
52 |
And the field "Section 1" matches value "1"
|
|
|
53 |
And the field "Test assign 1" matches value "1"
|
|
|
54 |
And the field "Test data 1" matches value "1"
|
|
|
55 |
And the field "Section 2" matches value "1"
|
|
|
56 |
And the field "Test assign 2" matches value "1"
|
|
|
57 |
And the field "Test data 2" matches value "1"
|
|
|
58 |
And the "Section 1: User data" "checkbox" should be enabled
|
|
|
59 |
And the "Include Test assign 1 user data" "checkbox" should be enabled
|
|
|
60 |
And the "Include Test data 1 user data" "checkbox" should be enabled
|
|
|
61 |
And the "Section 2: User data" "checkbox" should be enabled
|
|
|
62 |
And the "Include Test assign 2 user data" "checkbox" should be enabled
|
|
|
63 |
And the "Include Test data 2 user data" "checkbox" should be enabled
|
|
|
64 |
|
|
|
65 |
@javascript
|
|
|
66 |
Scenario: The type options panell allow to select all and none of one activity type
|
|
|
67 |
Given the field "Section 1" matches value "1"
|
|
|
68 |
And the field "Test assign 1" matches value "1"
|
|
|
69 |
And the field "Test data 1" matches value "1"
|
|
|
70 |
And the field "Section 2" matches value "1"
|
|
|
71 |
And the field "Test assign 2" matches value "1"
|
|
|
72 |
And the field "Test data 2" matches value "1"
|
|
|
73 |
And the "Section 1: User data" "checkbox" should be enabled
|
|
|
74 |
And the "Include Test assign 1 user data" "checkbox" should be enabled
|
|
|
75 |
And the "Include Test data 1 user data" "checkbox" should be enabled
|
|
|
76 |
And the "Section 2: User data" "checkbox" should be enabled
|
|
|
77 |
And the "Include Test assign 2 user data" "checkbox" should be enabled
|
|
|
78 |
And the "Include Test data 2 user data" "checkbox" should be enabled
|
|
|
79 |
# Test select none assignment.
|
|
|
80 |
When I click on "Show type options" "link" in the "backup_selectors_included" "region"
|
|
|
81 |
And I click on "None" "link" in the "backup_selectors_mod_assign" "region"
|
|
|
82 |
Then the field "Section 1" matches value "1"
|
|
|
83 |
And the field "Test assign 1" matches value ""
|
|
|
84 |
And the field "Test data 1" matches value "1"
|
|
|
85 |
And the field "Section 2" matches value "1"
|
|
|
86 |
And the field "Test assign 2" matches value ""
|
|
|
87 |
And the field "Test data 2" matches value "1"
|
|
|
88 |
And the "Section 1: User data" "checkbox" should be enabled
|
|
|
89 |
And the "Include Test assign 1 user data" "checkbox" should be disabled
|
|
|
90 |
And the "Include Test data 1 user data" "checkbox" should be enabled
|
|
|
91 |
And the "Section 2: User data" "checkbox" should be enabled
|
|
|
92 |
And the "Include Test assign 2 user data" "checkbox" should be disabled
|
|
|
93 |
And the "Include Test data 2 user data" "checkbox" should be enabled
|
|
|
94 |
# Test select all assignments.
|
|
|
95 |
And I click on "All" "link" in the "backup_selectors_mod_assign" "region"
|
|
|
96 |
And the field "Section 1" matches value "1"
|
|
|
97 |
And the field "Test assign 1" matches value "1"
|
|
|
98 |
And the field "Test data 1" matches value "1"
|
|
|
99 |
And the field "Section 2" matches value "1"
|
|
|
100 |
And the field "Test assign 2" matches value "1"
|
|
|
101 |
And the field "Test data 2" matches value "1"
|
|
|
102 |
And the "Section 1: User data" "checkbox" should be enabled
|
|
|
103 |
And the "Include Test assign 1 user data" "checkbox" should be enabled
|
|
|
104 |
And the "Include Test data 1 user data" "checkbox" should be enabled
|
|
|
105 |
And the "Section 2: User data" "checkbox" should be enabled
|
|
|
106 |
And the "Include Test assign 2 user data" "checkbox" should be enabled
|
|
|
107 |
And the "Include Test data 2 user data" "checkbox" should be enabled
|
|
|
108 |
|
|
|
109 |
@javascript
|
|
|
110 |
Scenario: Select all or none in user data should toggle backup schema checkboxes
|
|
|
111 |
Given the field "Section 1" matches value "1"
|
|
|
112 |
And the field "Test assign 1" matches value "1"
|
|
|
113 |
And the field "Test data 1" matches value "1"
|
|
|
114 |
And the field "Section 2" matches value "1"
|
|
|
115 |
And the field "Test assign 2" matches value "1"
|
|
|
116 |
And the field "Test data 2" matches value "1"
|
|
|
117 |
And the field "Section 1: User data" matches value "1"
|
|
|
118 |
And the field "Include Test assign 1 user data" matches value "1"
|
|
|
119 |
And the field "Include Test data 1 user data" matches value "1"
|
|
|
120 |
And the field "Section 2: User data" matches value "1"
|
|
|
121 |
And the field "Include Test assign 2 user data" matches value "1"
|
|
|
122 |
And the field "Include Test data 2 user data" matches value "1"
|
|
|
123 |
# Test select none.
|
|
|
124 |
When I click on "None" "link" in the "backup_selectors_userdata" "region"
|
|
|
125 |
Then the field "Section 1" matches value "1"
|
|
|
126 |
And the field "Test assign 1" matches value "1"
|
|
|
127 |
And the field "Test data 1" matches value "1"
|
|
|
128 |
And the field "Section 2" matches value "1"
|
|
|
129 |
And the field "Test assign 2" matches value "1"
|
|
|
130 |
And the field "Test data 2" matches value "1"
|
|
|
131 |
And the field "Section 1: User data" matches value ""
|
|
|
132 |
And the field "Include Test assign 1 user data" matches value ""
|
|
|
133 |
And the field "Include Test data 1 user data" matches value ""
|
|
|
134 |
And the field "Section 2: User data" matches value ""
|
|
|
135 |
And the field "Include Test assign 2 user data" matches value ""
|
|
|
136 |
And the field "Include Test data 2 user data" matches value ""
|
|
|
137 |
# Test select all.
|
|
|
138 |
And I click on "All" "link" in the "backup_selectors_userdata" "region"
|
|
|
139 |
And the field "Section 1" matches value "1"
|
|
|
140 |
And the field "Test assign 1" matches value "1"
|
|
|
141 |
And the field "Test data 1" matches value "1"
|
|
|
142 |
And the field "Section 2" matches value "1"
|
|
|
143 |
And the field "Test assign 2" matches value "1"
|
|
|
144 |
And the field "Test data 2" matches value "1"
|
|
|
145 |
And the field "Section 1: User data" matches value "1"
|
|
|
146 |
And the field "Include Test assign 1 user data" matches value "1"
|
|
|
147 |
And the field "Include Test data 1 user data" matches value "1"
|
|
|
148 |
And the field "Section 2: User data" matches value "1"
|
|
|
149 |
And the field "Include Test assign 2 user data" matches value "1"
|
|
|
150 |
And the field "Include Test data 2 user data" matches value "1"
|
|
|
151 |
|
|
|
152 |
@javascript
|
|
|
153 |
Scenario: The type options panell allow to select all and none user data for an activity type
|
|
|
154 |
Given the field "Section 1" matches value "1"
|
|
|
155 |
And the field "Test assign 1" matches value "1"
|
|
|
156 |
And the field "Test data 1" matches value "1"
|
|
|
157 |
And the field "Section 2" matches value "1"
|
|
|
158 |
And the field "Test assign 2" matches value "1"
|
|
|
159 |
And the field "Test data 2" matches value "1"
|
|
|
160 |
And the field "Section 1: User data" matches value "1"
|
|
|
161 |
And the field "Include Test assign 1 user data" matches value "1"
|
|
|
162 |
And the field "Include Test data 1 user data" matches value "1"
|
|
|
163 |
And the field "Section 2: User data" matches value "1"
|
|
|
164 |
And the field "Include Test assign 2 user data" matches value "1"
|
|
|
165 |
And the field "Include Test data 2 user data" matches value "1"
|
|
|
166 |
# Test select none assignment.
|
|
|
167 |
When I click on "Show type options" "link" in the "backup_selectors_included" "region"
|
|
|
168 |
And I click on "None" "link" in the "backup_selectors_userdata-mod_assign" "region"
|
|
|
169 |
Then the field "Section 1" matches value "1"
|
|
|
170 |
And the field "Test assign 1" matches value "1"
|
|
|
171 |
And the field "Test data 1" matches value "1"
|
|
|
172 |
And the field "Section 2" matches value "1"
|
|
|
173 |
And the field "Test assign 2" matches value "1"
|
|
|
174 |
And the field "Test data 2" matches value "1"
|
|
|
175 |
And the field "Section 1: User data" matches value "1"
|
|
|
176 |
And the field "Include Test assign 1 user data" matches value ""
|
|
|
177 |
And the field "Include Test data 1 user data" matches value "1"
|
|
|
178 |
And the field "Section 2: User data" matches value "1"
|
|
|
179 |
And the field "Include Test assign 2 user data" matches value ""
|
|
|
180 |
And the field "Include Test data 2 user data" matches value "1"
|
|
|
181 |
# Test select all assignments.
|
|
|
182 |
And I click on "All" "link" in the "backup_selectors_userdata-mod_assign" "region"
|
|
|
183 |
And the field "Section 1" matches value "1"
|
|
|
184 |
And the field "Test assign 1" matches value "1"
|
|
|
185 |
And the field "Test data 1" matches value "1"
|
|
|
186 |
And the field "Section 2" matches value "1"
|
|
|
187 |
And the field "Test assign 2" matches value "1"
|
|
|
188 |
And the field "Test data 2" matches value "1"
|
|
|
189 |
And the field "Section 1: User data" matches value "1"
|
|
|
190 |
And the field "Include Test assign 1 user data" matches value "1"
|
|
|
191 |
And the field "Include Test data 1 user data" matches value "1"
|
|
|
192 |
And the field "Section 2: User data" matches value "1"
|
|
|
193 |
And the field "Include Test assign 2 user data" matches value "1"
|
|
|
194 |
And the field "Include Test data 2 user data" matches value "1"
|
|
|
195 |
|
|
|
196 |
@javascript
|
|
|
197 |
Scenario: Select or unselect a section schema disable the activities checkboxes
|
|
|
198 |
Given the field "Section 1" matches value "1"
|
|
|
199 |
And the field "Test assign 1" matches value "1"
|
|
|
200 |
And the field "Test data 1" matches value "1"
|
|
|
201 |
And the field "Section 2" matches value "1"
|
|
|
202 |
And the field "Test assign 2" matches value "1"
|
|
|
203 |
And the field "Test data 2" matches value "1"
|
|
|
204 |
And the "Section 1: User data" "checkbox" should be enabled
|
|
|
205 |
And the "Include Test assign 1 user data" "checkbox" should be enabled
|
|
|
206 |
And the "Include Test data 1 user data" "checkbox" should be enabled
|
|
|
207 |
And the "Section 2: User data" "checkbox" should be enabled
|
|
|
208 |
And the "Include Test assign 2 user data" "checkbox" should be enabled
|
|
|
209 |
And the "Include Test data 2 user data" "checkbox" should be enabled
|
|
|
210 |
# Test unselect section 1.
|
|
|
211 |
When I set the field "Section 1" to ""
|
|
|
212 |
Then the field "Section 1" matches value ""
|
|
|
213 |
And the "Test assign 1" "checkbox" should be disabled
|
|
|
214 |
And the "Test data 1" "checkbox" should be disabled
|
|
|
215 |
And the "Section 2" "checkbox" should be enabled
|
|
|
216 |
And the "Test assign 2" "checkbox" should be enabled
|
|
|
217 |
And the "Test data 2" "checkbox" should be enabled
|
|
|
218 |
And the "Section 1: User data" "checkbox" should be disabled
|
|
|
219 |
And the "Include Test assign 1 user data" "checkbox" should be disabled
|
|
|
220 |
And the "Include Test data 1 user data" "checkbox" should be disabled
|
|
|
221 |
And the "Section 2: User data" "checkbox" should be enabled
|
|
|
222 |
And the "Include Test assign 2 user data" "checkbox" should be enabled
|
|
|
223 |
And the "Include Test data 2 user data" "checkbox" should be enabled
|
|
|
224 |
# Test select section 1.
|
|
|
225 |
And I set the field "Section 1" to "1"
|
|
|
226 |
And the field "Section 1" matches value "1"
|
|
|
227 |
And the "Test assign 1" "checkbox" should be enabled
|
|
|
228 |
And the "Test data 1" "checkbox" should be enabled
|
|
|
229 |
And the "Section 2" "checkbox" should be enabled
|
|
|
230 |
And the "Test assign 2" "checkbox" should be enabled
|
|
|
231 |
And the "Test data 2" "checkbox" should be enabled
|
|
|
232 |
And the "Section 1: User data" "checkbox" should be enabled
|
|
|
233 |
And the "Include Test assign 1 user data" "checkbox" should be enabled
|
|
|
234 |
And the "Include Test data 1 user data" "checkbox" should be enabled
|
|
|
235 |
And the "Section 2: User data" "checkbox" should be enabled
|
|
|
236 |
And the "Include Test assign 2 user data" "checkbox" should be enabled
|
|
|
237 |
And the "Include Test data 2 user data" "checkbox" should be enabled
|
|
|
238 |
|
|
|
239 |
@javascript
|
|
|
240 |
Scenario: Select or unselect a section user data disable the activities checkboxes
|
|
|
241 |
Given the "Section 1" "checkbox" should be enabled
|
|
|
242 |
And the "Test assign 1" "checkbox" should be enabled
|
|
|
243 |
And the "Test data 1" "checkbox" should be enabled
|
|
|
244 |
And the "Section 2" "checkbox" should be enabled
|
|
|
245 |
And the "Test assign 2" "checkbox" should be enabled
|
|
|
246 |
And the "Test data 2" "checkbox" should be enabled
|
|
|
247 |
And the "Section 1: User data" "checkbox" should be enabled
|
|
|
248 |
And the "Include Test assign 1 user data" "checkbox" should be enabled
|
|
|
249 |
And the "Include Test data 1 user data" "checkbox" should be enabled
|
|
|
250 |
And the "Section 2: User data" "checkbox" should be enabled
|
|
|
251 |
And the "Include Test assign 2 user data" "checkbox" should be enabled
|
|
|
252 |
And the "Include Test data 2 user data" "checkbox" should be enabled
|
|
|
253 |
# Test unselect section 1.
|
|
|
254 |
When I set the field "Section 1: User data" to ""
|
|
|
255 |
Then the "Section 1" "checkbox" should be enabled
|
|
|
256 |
And the "Test assign 1" "checkbox" should be enabled
|
|
|
257 |
And the "Test data 1" "checkbox" should be enabled
|
|
|
258 |
And the "Section 2" "checkbox" should be enabled
|
|
|
259 |
And the "Test assign 2" "checkbox" should be enabled
|
|
|
260 |
And the "Test data 2" "checkbox" should be enabled
|
|
|
261 |
And the "Section 1: User data" "checkbox" should be enabled
|
|
|
262 |
And the "Include Test assign 1 user data" "checkbox" should be disabled
|
|
|
263 |
And the "Include Test data 1 user data" "checkbox" should be disabled
|
|
|
264 |
And the "Section 2: User data" "checkbox" should be enabled
|
|
|
265 |
And the "Include Test assign 2 user data" "checkbox" should be enabled
|
|
|
266 |
And the "Include Test data 2 user data" "checkbox" should be enabled
|
|
|
267 |
# Test select section 1.
|
|
|
268 |
And I set the field "Section 1: User data" to "1"
|
|
|
269 |
And the "Section 1" "checkbox" should be enabled
|
|
|
270 |
And the "Test assign 1" "checkbox" should be enabled
|
|
|
271 |
And the "Test data 1" "checkbox" should be enabled
|
|
|
272 |
And the "Section 2" "checkbox" should be enabled
|
|
|
273 |
And the "Test assign 2" "checkbox" should be enabled
|
|
|
274 |
And the "Test data 2" "checkbox" should be enabled
|
|
|
275 |
And the "Section 1: User data" "checkbox" should be enabled
|
|
|
276 |
And the "Include Test assign 1 user data" "checkbox" should be enabled
|
|
|
277 |
And the "Include Test data 1 user data" "checkbox" should be enabled
|
|
|
278 |
And the "Section 2: User data" "checkbox" should be enabled
|
|
|
279 |
And the "Include Test assign 2 user data" "checkbox" should be enabled
|
|
|
280 |
And the "Include Test data 2 user data" "checkbox" should be enabled
|