-
Notifications
You must be signed in to change notification settings - Fork 785
Expand file tree
/
Copy pathcontent_assertions.robot
More file actions
433 lines (387 loc) · 21.3 KB
/
content_assertions.robot
File metadata and controls
433 lines (387 loc) · 21.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
*** Settings ***
Documentation Tests contents
Test Setup Go To Front Page
Default Tags assertions
Resource ../resource.robot
*** Test Cases ***
Title Should Be
[Tags] NoGrid
[Documentation] LOG 1:5 Page title is '(root)/index.html'.
Title Should Be (root)/index.html
Run Keyword And Expect Error
... Title should have been 'not a title' but was '(root)/index.html'.
... Title Should Be not a title
Run Keyword And Expect Error
... Page title was not expected
... Title Should Be not a title message=Page title was not expected
Page Should Contain
[Tags] NoGrid
[Documentation] The last step fails and doesn't contain the html content.
... FAIL Page should have contained text 'non existing text' but did not.
... LOG 1:9 Current page contains text 'needle'.
... LOG 2:9 INFO Current page contains text 'This is the haystack'.
... LOG 3:18 FAIL Page should have contained text 'non existing text' but did not.
Page Should Contain needle
Page Should Contain This is the haystack
Page Should Contain non existing text
Page Should Contain Using Default Custom Log Level
[Tags] NoGrid
[Documentation] The Page Should Contains using default custom log level (that being
... 'TRACE' - noting the excluded second argument for the `Page Should Contain`
... keyword) fails and the log contains the html content.
... FAIL Page should have contained text 'non existing text' but did not.
... LOG 2:19 TRACE REGEXP: <html.*</html>
... LOG 2:20 FAIL Page should have contained text 'non existing text' but did not.
${old_level}= Set Log Level TRACE
Page Should Contain non existing text
[Teardown] Set Log Level ${old_level}
Page Should Contain Numbers And String Should Be Same
Log Source
Page Should Contain 1
Page Should Contain ${1}
Page Should Contain With Text Having Internal Elements
Page Should Contain This is the haystack and somewhere on this page is a needle.
Go to page "links.html"
Page Should Contain Relative with text after
Page Should Contain With Custom Log Level INFO
[Tags] NoGrid
[Documentation] Html content is shown at the explicitly specified INFO level.
... FAIL Page should have contained text 'non existing text' but did not.
... LOG 1:18 INFO REGEXP: <html.*</html>
... LOG 1:19 FAIL Page should have contained text 'non existing text' but did not.
Page Should Contain non existing text INFO
Page Should Contain With Custom Log Level WARN
[Tags] NoGrid
[Documentation] Html content is shown at the explicitly specified WARN level.
... FAIL Page should have contained text 'non existing text' but did not.
... LOG 1:18 WARN REGEXP: <html.*</html>
... LOG 1:19 FAIL Page should have contained text 'non existing text' but did not.
Page Should Contain non existing text WARN
Page Should Contain With Custom Log Level DEBUG
[Tags] NoGrid
[Documentation] Html content is shown at the explicitly specified DEBUG level.
... FAIL Page should have contained text 'non existing text' but did not.
... LOG 1:18 DEBUG REGEXP: <html.*</html>
... LOG 1:19 FAIL Page should have contained text 'non existing text' but did not.
Page Should Contain non existing text DEBUG
Page Should Contain With Custom Log Level TRACE
[Tags] NoGrid
[Documentation] Html content is shown at the explicitly specified TRACE level.
... FAIL Page should have contained text 'non existing text' but did not.
... LOG 2:19 TRACE REGEXP: <html.*</html>
... LOG 2:20 FAIL Page should have contained text 'non existing text' but did not.
Set Log Level TRACE
Page Should Contain non existing text TRACE
[Teardown] Set Log Level DEBUG
Page Should Contain With Custom Log Level NONE
[Tags] NoGrid
[Documentation] Html content is not shown because the loglevel is set to NONE.
... FAIL Page should have contained text 'non existing text' but did not.
... LOG 1:18 FAIL Page should have contained text 'non existing text' but did not.
Page Should Contain non existing text NONE
Page Should Contain With Custom Log Level Below Current Log Level
[Tags] NoGrid
[Documentation] Html content is not shown when custom log level is below curent log level.
... FAIL Page should have contained text 'non existing text' but did not.
... LOG 2:18 FAIL Page should have contained text 'non existing text' but did not.
${old_level}= Set Log Level DEBUG
Page Should Contain non existing text TRACE
[Teardown] Set Log Level ${old_level}
Page Should Contain With Disabling Source Logging
[Documentation] LOG TEARDOWN:2 NONE
Set Log Level INFO
Run Keyword And Expect Error
... Page should have contained text 'non existing text' but did not.
... Page Should Contain non existing text loglevel=NONE
[Teardown] Set Log Level DEBUG
Page Should Contain With Frames
[Setup] Go To Page "frames/frameset.html"
Page Should Contain You're looking at right.
Page Should Not Contain
[Tags] NoGrid
[Documentation] Default log level does not have html output.
... FAIL Page should not have contained text 'needle'.
... LOG 1:14 Current page does not contain text 'non existing text'.
... LOG 2:13 FAIL Page should not have contained text 'needle'.
Page Should Not Contain non existing text
Page Should Not Contain needle
Page Should Not Contain With Custom Log Level
[Tags] NoGrid
[Documentation] LOG 1.1:13 DEBUG REGEXP: <html.*</html>
Run Keyword And Expect Error
... Page should not have contained text 'needle'.
... Page Should Not Contain needle DEBUG
Page Should Not Contain With Disabling Source Logging
[Documentation] LOG TEARDOWN:2 NONE
Set Log Level INFO
Run Keyword And Expect Error
... Page should not have contained text 'needle'.
... Page Should Not Contain needle loglevel=NONE
[Teardown] Set Log Level DEBUG
Page Should Contain Element
Page Should Contain Element some_id
Run Keyword And Expect Error
... Page should have contained element 'non-existent' but did not.
... Page Should Contain Element non-existent
Page Should Contain Element With Custom Message
Run Keyword And Expect Error
... Custom error message
... Page Should Contain Element invalid Custom error message
Page Should Contain Element With Disabling Source Logging
[Documentation] LOG TEARDOWN:2 NONE
Set Log Level INFO
Run Keyword And Expect Error
... Page should have contained element 'non-existent' but did not.
... Page Should Contain Element non-existent loglevel=NONE
[Teardown] Set Log Level DEBUG
Page Should Not Contain Element
Page Should Not Contain Element non-existent
Run Keyword And Expect Error
... Page should not have contained element 'some_id'.
... Page Should Not Contain Element some_id
Page Should Not Contain Element With Disabling Source Logging
[Documentation] LOG TEARDOWN:2 NONE
Set Log Level INFO
Run Keyword And Expect Error
... Page should not have contained element 'some_id'.
... Page Should Not Contain Element some_id loglevel=NONE
[Teardown] Set Log Level DEBUG
Element Should Contain
Element Should Contain some_id This text is inside an identified element
Element Should Contain some_id THIS TEXT IS INSIDE AN IDENTIFIED ELEMENT ignore_case=True
Element Should Contain some_id This text is inside an identified element ignore_case=False
Run Keyword And Expect Error
... Element 'some_id' should have contained text 'non existing text' but its text was 'This text is inside an identified element'.
... Element Should Contain some_id non existing text
Run Keyword And Expect Error
... Element with locator 'missing_id' not found.
... Element Should Contain missing_id This should report missing element.
Run Keyword And Expect Error
... Element 'some_id' should have contained text 'THIS TEXT' but its text was 'This text is inside an identified element'.
... Element Should Contain some_id THIS TEXT ignore_case=False
Run Keyword And Expect Error
... Element 'some_id' should have contained text 'foobar' but its text was 'This text is inside an identified element'.
... Element Should Contain some_id foobar ignore_case=True
Element Should Not Contain
Element Should Not Contain some_id This text is not inside an identified element
Element Should Not Contain some_id This text is not inside an identified element ignore_case=False
Element Should Not Contain some_id THIS TEXT is not inside an identified element ignore_case=True
Element Should Not Contain some_id elementypo
Run Keyword And Expect Error
... Element 'some_id' should not contain text 'This text is inside an identified element' but it did.
... Element Should Not Contain some_id This text is inside an identified element
Run Keyword And Expect Error
... Element 'some_id' should not contain text 'TEXT' but it did.
... Element Should Not Contain some_id TEXT ignore_case=True
Run Keyword And Expect Error
... Element 'some_id' should not contain text 'text' but it did.
... Element Should Not Contain some_id text ignore_case=False
Run Keyword And Expect Error
... Element with locator 'missing_id' not found.
... Element Should Not Contain missing_id This should report missing element.
Element Text Should Be
Element Text Should Be some_id This text is inside an identified element
Element Text Should Be some_id This TEXT IS INSIDE AN IDENTIFIED ELEMENT ignore_case=True
Element Text Should Be some_id This text is inside an identified element${SPACE} strip_spaces=True
Element Text Should Be some_id ${SPACE}This text is inside an identified element strip_spaces=LEADING
Element Text Should Be some_id This text is inside an identified element${SPACE} strip_spaces=TRAILING
Element Text Should Be some_id This${SPACE}${SPACE} text is inside an identified element collapse_spaces=True
Run Keyword And Expect Error
... The text of element 'some_id' should have been 'inside' but it was 'This text is inside an identified element'.
... Element Text Should Be some_id inside
Run Keyword And Expect Error
... The text of element 'some_id' should have been 'This text is inside an identified element ' but it was 'This text is inside an identified element'.
... Element Text Should Be some_id This text is inside an identified element${SPACE} strip_spaces=False
Run Keyword And Expect Error
... The text of element 'some_id' should have been 'This${SPACE}${SPACE} text is inside an identified element' but it was 'This text is inside an identified element'.
... Element Text Should Be some_id This${SPACE}${SPACE} text is inside an identified element collapse_spaces=False
Element Text Should Not Be
Element Text Should Not Be some_id Foo This text is inside an identified element
Element Text Should Not Be some_id This TEXT IS INSIDE AN IDENTIFIED ELEMENT ignore_case=False
Element Text Should Not Be some_id FOO This text is inside an identified element ignore_case=True
Element Text Should Not Be some_id This text is inside an identified element${SPACE} strip_spaces=False
Element Text Should Not Be some_id This text${SPACE}${SPACE} is inside an identified element collapse_spaces=False
Run Keyword And Expect Error
... The text of element 'some_id' was not supposed to be 'This text is inside an identified element'.
... Element Text Should Not Be some_id This text is inside an identified element
Run Keyword And Expect Error
... The text of element 'some_id' was not supposed to be 'This text is inside an identified element'.
... Element Text Should Not Be some_id This text is inside an identified element ignore_case=False
Run Keyword And Expect Error
... The text of element 'some_id' was not supposed to be 'THIS TEXT is inside an identified element'.
... Element Text Should Not Be some_id THIS TEXT is inside an identified element ignore_case=True
Run Keyword And Expect Error
... The text of element 'some_id' was not supposed to be 'This text is inside an identified element '.
... Element Text Should Not Be some_id This text is inside an identified element${SPACE} strip_spaces=True
Run Keyword And Expect Error
... The text of element 'some_id' was not supposed to be 'This text${SPACE}${SPACE} is inside an identified element'.
... Element Text Should Not Be some_id This text${SPACE}${SPACE} is inside an identified element collapse_spaces=True
Get Text
${str} = Get Text some_id
Should Match ${str} This text is inside an identified element
Run Keyword And Expect Error
... Element with locator 'missing_id' not found.
... Get Text missing_id
Page Should Contain Checkbox
[Tags] NoGrid
[Documentation] LOG 1:9 Current page contains checkbox 'can_send_email'.
[Setup] Go To Page "forms/prefilled_email_form.html"
Page Should Contain Checkbox can_send_email
Page Should Contain Checkbox xpath=//input[@type='checkbox' and @name='can_send_sms']
Run Keyword And Expect Error
... Page should have contained checkbox 'non-existing' but did not.
... Page Should Contain Checkbox non-existing
Page Should Not Contain Checkbox
[Tags] NoGrid
[Documentation] LOG 1:9 Current page does not contain checkbox 'non-existing'.
[Setup] Go To Page "forms/prefilled_email_form.html"
Page Should Not Contain Checkbox non-existing
Run Keyword And Expect Error
... Page should not have contained checkbox 'can_send_email'.
... Page Should Not Contain Checkbox can_send_email
Page Should Contain Radio Button
[Setup] Go To Page "forms/prefilled_email_form.html"
Page Should Contain Radio Button sex
Page Should Contain Radio Button xpath=//input[@type="radio" and @value="male"]
Run Keyword And Expect Error
... Page should have contained radio button 'non-existing' but did not.
... Page Should Contain Radio Button non-existing
Page Should Not Contain Radio Button
[Setup] Go To Page "forms/prefilled_email_form.html"
Page Should Not Contain Radio Button non-existing
Run Keyword And Expect Error
... Page should not have contained radio button 'sex'.
... Page Should Not Contain Radio Button sex
Page Should Contain Image
[Setup] Go To Page "links.html"
Page Should contain Image image.jpg
Run Keyword And Expect Error
... Page should have contained image 'non-existent' but did not.
... Page Should contain Image non-existent
Page Should Not Contain Image
[Setup] Go To Page "links.html"
Page Should not contain Image non-existent
Run Keyword And Expect Error
... Page should not have contained image 'image.jpg'.
... Page Should not contain Image image.jpg
Page Should Contain Link
[Setup] Go To Page "links.html"
Page Should contain link Relative
Page Should contain link sub/index.html
Run Keyword And Expect Error
... Page should have contained link 'non-existent' but did not.
... Page Should contain link non-existent
Page Should Not Contain Link
[Setup] Go To Page "links.html"
Page Should not contain link non-existent
Run Keyword And Expect Error
... Page should not have contained link 'Relative'.
... Page Should not contain link Relative
Page Should Contain List
[Setup] Go To Page "forms/prefilled_email_form.html"
Page should Contain List possible_channels
Run Keyword And Expect Error
... Page should have contained list 'non-existing' but did not.
... Page Should Contain List non-existing
Page Should Not Contain List
[Setup] Go To Page "forms/prefilled_email_form.html"
Page Should Not Contain List non-existing
Run Keyword And Expect Error
... Page should not have contained list 'possible_channels'.
... Page Should Not Contain List possible_channels
Page Should Contain TextField
[Setup] Go To Page "forms/prefilled_email_form.html"
Page Should Contain Text Field name
Page Should Contain Text Field website
Page Should Contain Text Field xpath=//input[@type='text' and @name='email']
Page Should Contain Text Field xpath=//input[@type='url' and @name='website']
Run Keyword And Expect Error
... Page should have contained text field 'non-existing' but did not.
... Page Should Contain Text Field non-existing
Run Keyword And Expect Error
... Page should have contained text field 'can_send_email' but did not.
... Page Should Contain Text Field can_send_email
Page Should Not Contain Text Field
[Setup] Go To Page "forms/prefilled_email_form.html"
Page Should Not Contain Text Field non-existing
Page Should Not Contain Text Field can_send_email
Run Keyword And Expect Error
... Page should not have contained text field 'name'.
... Page Should Not Contain Text Field name
Run Keyword And Expect Error
... Page should not have contained text field 'website'.
... Page Should Not Contain Text Field website
TextField Should Contain
[Tags] NoGrid
[Documentation] LOG 1:13 Text field 'name' contains text ''.
[Setup] Go To Page "forms/email_form.html"
TextField Should contain name ${EMPTY}
TextField Should contain website ${EMPTY}
Input Text name my name
Input Text website https://example.org
TextField Should contain name my name
TextField Should contain website https://example.org
Run Keyword And Expect Error
... Text field 'name' should have contained text 'non-existing' but it contained 'my name'.
... TextField Should contain name non-existing
Run Keyword And Expect Error
... Text field 'website' should have contained text 'https://w3.org' but it contained 'https://example.org'.
... TextField Should contain website https://w3.org
TextField Value Should Be
[Tags] NoGrid
[Documentation] LOG 1:13 Content of text field 'name' is ''.
[Setup] Go To Page "forms/email_form.html"
textfield Value Should Be name ${EMPTY}
Input Text name my name
textfield Value Should Be name my name
Run Keyword And Expect Error
... Value of text field 'name' should have been 'non-existing' but was 'my name'.
... textfield Value Should Be name non-existing
Clear Element Text name
Textfield Value Should Be name ${EMPTY}
TextArea Should Contain
[Setup] Go To Page "forms/email_form.html"
TextArea Should Contain comment ${EMPTY}
Input Text comment This is a comment.
Run Keyword And Expect Error
... Text area 'comment' should have contained text 'Hello World!' but it had 'This is a comment.'.
... TextArea Should Contain comment Hello World!
TextArea Value Should Be
[Setup] Go To Page "forms/email_form.html"
TextArea Value Should Be comment ${EMPTY}
Input Text comment This is a comment.
Run Keyword And Expect Error
... Text area 'comment' should have had text 'Hello World!' but it had 'This is a comment.'.
... TextArea Value Should Be comment Hello World!
Clear Element Text comment
TextArea Value Should Be comment ${EMPTY}
Page Should Contain Button
[Setup] Go To Page "forms/buttons.html"
Page Should Contain Button button
Page Should Contain Button Sisään
Page Should Contain Button Get In
Page Should Contain Button xpath=//button[@type="submit"]
Page Should Contain Button Ulos
Page Should Contain Button xpath=//input[@type="submit"]
Page Should Contain Button Act!
Page Should Contain Button xpath=//input[@type="button"]
Run Keyword And Expect Error
... Page should have contained button 'non-existing' but did not.
... Page Should Contain Button non-existing
Page Should Not Contain Button In Button Tag
[Setup] Go To Page "forms/buttons.html"
Page Should Not Contain Button invalid
Run Keyword And Expect Error
... Page should not have contained button 'button'.
... Page Should Not Contain Button button
Page Should Not Contain Button In Input Tag
[Setup] Go To Page "forms/buttons.html"
Page Should Not Contain Button invalid
Run Keyword And Expect Error
... Page should not have contained input 'Act!'.
... Page Should Not Contain Button Act!
Get All Links
[Setup] Go To Page "links.html"
${links}= Get All Links
Length Should Be ${links} 20
List Should Contain Value ${links} bold_id