@@ -27,31 +27,60 @@ This is done by using the `<remove>` action and specifying a `stepKey` of the ac
27
27
## Merging in Tests
28
28
29
29
### Add a test
30
-
31
- ``` xml
32
- base
33
- ```
34
-
35
- ``` xml
36
- update
37
- ```
38
-
39
- ``` xml
40
- Result
41
- ```
30
+ Adding of a ` <test> ` is done by creating a new file, or adding a ` <test> ` node to an existing ` *test.xml ` file.
42
31
43
32
### Remove a test
44
-
45
- ``` xml
46
- base
33
+ Tests cannot be removed by deltas. If a test must be skipped due to a module completely invalidating a functionality, you can add the test to the ` skip ` group.
34
+
35
+ ``` xml
36
+ <test name =" AdminLoginTest" >
37
+ <annotations >
38
+ <features value =" Admin Login" />
39
+ <stories value =" Login on the Admin Login page" />
40
+ <title value =" You should be able to log into the Magento Admin backend." />
41
+ <description value =" You should be able to log into the Magento Admin backend." />
42
+ <severity value =" CRITICAL" />
43
+ <testCaseId value =" MAGETWO-71572" />
44
+ <group value =" example" />
45
+ <group value =" login" />
46
+ </annotations >
47
+ <amOnPage url =" {{AdminLoginPage.url}}" stepKey =" amOnAdminLoginPage" />
48
+ <fillField selector =" {{AdminLoginFormSection.username}}" userInput =" {{_ENV.MAGENTO_ADMIN_USERNAME}}" stepKey =" fillUsername" />
49
+ <fillField selector =" {{AdminLoginFormSection.password}}" userInput =" {{_ENV.MAGENTO_ADMIN_PASSWORD}}" stepKey =" fillPassword" />
50
+ <click selector =" {{AdminLoginFormSection.signIn}}" stepKey =" clickOnSignIn" />
51
+ <closeAdminNotification stepKey =" closeAdminNotification" />
52
+ <seeInCurrentUrl url =" {{AdminLoginPage.url}}" stepKey =" seeAdminLoginUrl" />
53
+ </test >
47
54
```
48
55
49
56
``` xml
50
- update
57
+ <test name =" AdminLoginTest" >
58
+ <annotations >
59
+ <group value =" skip" />
60
+ </annotations >
61
+ </test >
51
62
```
52
63
53
64
``` xml
54
- Result
65
+ <test name =" AdminLoginTest" >
66
+ <annotations >
67
+ <features value =" Admin Login" />
68
+ <stories value =" Login on the Admin Login page" />
69
+ <title value =" You should be able to log into the Magento Admin backend." />
70
+ <description value =" You should be able to log into the Magento Admin backend." />
71
+ <severity value =" CRITICAL" />
72
+ <testCaseId value =" MAGETWO-71572" />
73
+ <group value =" example" />
74
+ <group value =" login" />
75
+ <group value =" skip" />
76
+ </annotations >
77
+ <amOnPage url =" {{AdminLoginPage.url}}" stepKey =" amOnAdminLoginPage" />
78
+ <fillField selector =" {{AdminLoginFormSection.username}}" userInput =" {{_ENV.MAGENTO_ADMIN_USERNAME}}" stepKey =" fillUsername" />
79
+ <fillField selector =" {{AdminLoginFormSection.password}}" userInput =" {{_ENV.MAGENTO_ADMIN_PASSWORD}}" stepKey =" fillPassword" />
80
+ <click selector =" {{AdminLoginFormSection.signIn}}" stepKey =" clickOnSignIn" />
81
+ <closeAdminNotification stepKey =" closeAdminNotification" />
82
+ <seeInCurrentUrl url =" {{AdminLoginPage.url}}" stepKey =" seeAdminLoginUrl" />
83
+ </test >
55
84
```
56
85
57
86
### Update a test
@@ -171,117 +200,168 @@ Result
171
200
### Add a section
172
201
173
202
``` xml
174
- base
203
+ <page name =" BaseBackendPage" url =" admin" area =" admin" module =" Magento_Backend" >
204
+ <section name =" BaseBackendSection" />
205
+ <section name =" AnotherBackendSection" />
206
+ </page >
175
207
```
176
208
177
209
``` xml
178
- update
210
+ <page name =" BaseBackendPage" url =" admin" area =" admin" module =" Magento_Backend" >
211
+ <section name =" NewExtensionSection" />
212
+ </page >
179
213
```
180
214
181
215
``` xml
182
- Result
216
+ <page name =" BaseBackendPage" url =" admin" area =" admin" module =" Magento_Backend" >
217
+ <section name =" BaseBackendSection" />
218
+ <section name =" AnotherBackendSection" />
219
+ <section name =" NewExtensionSection" />
220
+ </page >
183
221
```
184
222
185
223
### Remove a section
186
224
187
225
``` xml
188
- base
226
+ <page name =" BaseBackendPage" url =" admin" area =" admin" module =" Magento_Backend" >
227
+ <section name =" BaseBackendSection" />
228
+ <section name =" AnotherBackendSection" />
229
+ </page >
189
230
```
190
231
191
232
``` xml
192
- update
233
+ <page name =" BaseBackendPage" url =" admin" area =" admin" module =" Magento_Backend" >
234
+ <section name =" AnotherBackendSection" remove =" true" />
235
+ </page >
193
236
```
194
237
195
238
``` xml
196
- Result
239
+ <page name =" BaseBackendPage" url =" admin" area =" admin" module =" Magento_Backend" >
240
+ <section name =" BaseBackendSection" />
241
+ </page >
197
242
```
198
243
199
244
## Sections merging
200
245
201
246
### Add an element
202
247
203
248
``` xml
204
- base
249
+ <section name =" AdminLoginFormSection" >
250
+ <element name =" username" type =" input" selector =" #username" />
251
+ <element name =" password" type =" input" selector =" #login" />
252
+ <element name =" signIn" type =" button" selector =" .actions .action-primary" timeout =" 30" />
253
+ </section >
205
254
```
206
255
207
256
``` xml
208
- update
257
+ <section name =" AdminLoginFormSection" >
258
+ <element name =" mergeElement" type =" input" selector =" #selector" />
259
+ </section >
209
260
```
210
261
211
262
``` xml
212
- Result
263
+ <section name =" AdminLoginFormSection" >
264
+ <element name =" username" type =" input" selector =" #username" />
265
+ <element name =" password" type =" input" selector =" #login" />
266
+ <element name =" signIn" type =" button" selector =" .actions .action-primary" timeout =" 30" />
267
+ <element name =" mergeElement" type =" input" selector =" #selector" />
268
+ </section >
213
269
```
214
270
215
271
### Remove an element
216
272
217
273
``` xml
218
- base
274
+ <section name =" AdminLoginFormSection" >
275
+ <element name =" username" type =" input" selector =" #username" />
276
+ <element name =" password" type =" input" selector =" #login" />
277
+ <element name =" signIn" type =" button" selector =" .actions .action-primary" timeout =" 30" />
278
+ </section >
219
279
```
220
280
221
281
``` xml
222
- update
282
+ <section name =" AdminLoginFormSection" >
283
+ <element name =" username" type =" input" remove =" true" />
284
+ </section >
223
285
```
224
286
225
287
``` xml
226
- Result
288
+ <section name =" AdminLoginFormSection" >
289
+ <element name =" password" type =" input" selector =" #login" />
290
+ <element name =" signIn" type =" button" selector =" .actions .action-primary" timeout =" 30" />
291
+ </section >
227
292
```
228
293
229
294
### Update an element
230
295
231
296
``` xml
232
- base
297
+ <section name =" AdminLoginFormSection" >
298
+ <element name =" username" type =" input" selector =" #username" />
299
+ <element name =" password" type =" input" selector =" #login" />
300
+ <element name =" signIn" type =" button" selector =" .actions .action-primary" timeout =" 30" />
301
+ </section >
233
302
```
234
303
235
304
``` xml
236
- update
305
+ <section name =" AdminLoginFormSection" >
306
+ <element name =" username" type =" input" selector =" #newSelector" />
307
+ </section >
237
308
```
238
309
239
310
``` xml
240
- Result
311
+ <section name =" AdminLoginFormSection" >
312
+ <element name =" username" type =" input" selector =" #newSelector" />
313
+ <element name =" password" type =" input" selector =" #login" />
314
+ <element name =" signIn" type =" button" selector =" .actions .action-primary" timeout =" 30" />
315
+ </section >
241
316
```
242
317
243
318
## Data merging
244
319
245
- ### Add data
320
+ ` <data> ` elements within an entity are additive; removal of individual ` < data> ` tags is not supported.
246
321
247
- ``` xml
248
- base
249
- ```
250
-
251
- ``` xml
252
- update
253
- ```
254
-
255
- ``` xml
256
- Result
257
- ```
258
-
259
- ### Remove data
322
+ ### Add data
260
323
261
324
``` xml
262
- base
325
+ <entity name =" sampleData" type =" testData" >
326
+ <data key =" firstField" >field1</data >
327
+ <data key =" secondField" >field2</data >
328
+ </entity >
263
329
```
264
330
265
331
``` xml
266
- update
332
+ <entity name =" sampleData" type =" testData" >
333
+ <data key =" thirdField" >field3</data >
334
+ </entity >
267
335
```
268
336
269
337
``` xml
270
- Result
338
+ <entity name =" sampleData" type =" testData" >
339
+ <data key =" firstField" >field1</data >
340
+ <data key =" secondField" >field2</data >
341
+ <data key =" thirdField" >field3</data >
342
+ </entity >
271
343
```
272
344
273
345
### Update data
274
346
275
347
``` xml
276
- base
348
+ <entity name =" sampleData" type =" testData" >
349
+ <data key =" firstField" >field1</data >
350
+ <data key =" secondField" >field2</data >
351
+ </entity >
277
352
```
278
353
279
354
``` xml
280
- update
355
+ <entity name =" sampleData" type =" testData" >
356
+ <data key =" firstField" >overrideField</data >
357
+ </entity >
281
358
```
282
359
283
360
``` xml
284
- Result
361
+ <entity name =" sampleData" type =" testData" >
362
+ <data key =" firstField" >overrideField</data >
363
+ <data key =" secondField" >field2</data >
364
+ </entity >
285
365
```
286
366
287
367
@@ -290,4 +370,4 @@ Result
290
370
[ Tests ] : ./test.html
291
371
[ Pages ] : ./page.html
292
372
[ Sections ] : ./section.html
293
- [ Data ] : ./data.html
373
+ [ Data ] : ./data.html
0 commit comments