1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package org.htmlunit.general;
16
17 import org.htmlunit.WebDriverTestCase;
18 import org.htmlunit.junit.annotation.Alerts;
19 import org.junit.jupiter.api.Test;
20
21
22
23
24
25
26
27 public class ElementOuterHtmlTest extends WebDriverTestCase {
28
29 private void test(final String elementName) throws Exception {
30 final String html = DOCTYPE_HTML
31 + "<html><head>\n"
32 + " <script>\n"
33 + LOG_TITLE_FUNCTION
34 + " function test() {\n"
35 + " var value = document.createElement('" + elementName + "').outerHTML;\n"
36 + " value = value.replace('<?XML:NAMESPACE PREFIX = PUBLIC NS = \"URN:COMPONENT\" />', '');\n"
37 + " value = value.replace('<?XML:NAMESPACE PREFIX = \"PUBLIC\" NS = \"URN:COMPONENT\" />', '');\n"
38 + " log(value);\n"
39 + " }\n"
40 + " </script>\n"
41 + "</head>\n"
42 + "<body onload='test()'></body></html>";
43
44 loadPageVerifyTitle2(html);
45 }
46
47
48
49
50 @Test
51 @Alerts("<abbr></abbr>")
52 public void abbr() throws Exception {
53 test("abbr");
54 }
55
56
57
58
59 @Test
60 @Alerts("<acronym></acronym>")
61 public void acronym() throws Exception {
62 test("acronym");
63 }
64
65
66
67
68 @Test
69 @Alerts("<a></a>")
70 public void a() throws Exception {
71 test("a");
72 }
73
74
75
76
77 @Test
78 @Alerts("<address></address>")
79 public void address() throws Exception {
80 test("address");
81 }
82
83
84
85
86 @Test
87 @Alerts("<applet></applet>")
88 public void applet() throws Exception {
89 test("applet");
90 }
91
92
93
94
95 @Test
96 @Alerts("<area>")
97 public void area() throws Exception {
98 test("area");
99 }
100
101
102
103
104 @Test
105 @Alerts("<article></article>")
106 public void article() throws Exception {
107 test("article");
108 }
109
110
111
112
113 @Test
114 @Alerts("<aside></aside>")
115 public void aside() throws Exception {
116 test("aside");
117 }
118
119
120
121
122 @Test
123 @Alerts("<audio></audio>")
124 public void audio() throws Exception {
125 test("audio");
126 }
127
128
129
130
131 @Test
132 @Alerts("<bgsound>")
133 public void bgsound() throws Exception {
134 test("bgsound");
135 }
136
137
138
139
140 @Test
141 @Alerts("<base>")
142 public void base() throws Exception {
143 test("base");
144 }
145
146
147
148
149 @Test
150 @Alerts("<basefont>")
151 public void basefont() throws Exception {
152 test("basefont");
153 }
154
155
156
157
158 @Test
159 @Alerts("<bdi></bdi>")
160 public void bdi() throws Exception {
161 test("bdi");
162 }
163
164
165
166
167 @Test
168 @Alerts("<bdo></bdo>")
169 public void bdo() throws Exception {
170 test("bdo");
171 }
172
173
174
175
176 @Test
177 @Alerts("<big></big>")
178 public void big() throws Exception {
179 test("big");
180 }
181
182
183
184
185 @Test
186 @Alerts("<blink></blink>")
187 public void blink() throws Exception {
188 test("blink");
189 }
190
191
192
193
194 @Test
195 @Alerts("<blockquote></blockquote>")
196 public void blockquote() throws Exception {
197 test("blockquote");
198 }
199
200
201
202
203 @Test
204 @Alerts("<body></body>")
205 public void body() throws Exception {
206 test("body");
207 }
208
209
210
211
212 @Test
213 @Alerts("<b></b>")
214 public void b() throws Exception {
215 test("b");
216 }
217
218
219
220
221 @Test
222 @Alerts("<br>")
223 public void br() throws Exception {
224 test("br");
225 }
226
227
228
229
230 @Test
231 @Alerts("<button></button>")
232 public void button() throws Exception {
233 test("button");
234 }
235
236
237
238
239 @Test
240 @Alerts("<canvas></canvas>")
241 public void canvas() throws Exception {
242 test("canvas");
243 }
244
245
246
247
248 @Test
249 @Alerts("<caption></caption>")
250 public void caption() throws Exception {
251 test("caption");
252 }
253
254
255
256
257 @Test
258 @Alerts("<center></center>")
259 public void center() throws Exception {
260 test("center");
261 }
262
263
264
265
266 @Test
267 @Alerts("<cite></cite>")
268 public void cite() throws Exception {
269 test("cite");
270 }
271
272
273
274
275 @Test
276 @Alerts("<code></code>")
277 public void code() throws Exception {
278 test("code");
279 }
280
281
282
283
284 @Test
285 @Alerts("<col>")
286 public void col() throws Exception {
287 test("col");
288 }
289
290
291
292
293 @Test
294 @Alerts("<colgroup></colgroup>")
295 public void colgroup() throws Exception {
296 test("colgroup");
297 }
298
299
300
301
302 @Test
303 @Alerts("<command></command>")
304 public void command() throws Exception {
305 test("command");
306 }
307
308
309
310
311 @Test
312 @Alerts("<datalist></datalist>")
313 public void datalist() throws Exception {
314 test("datalist");
315 }
316
317
318
319
320 @Test
321 @Alerts("<dfn></dfn>")
322 public void dfn() throws Exception {
323 test("dfn");
324 }
325
326
327
328
329 @Test
330 @Alerts("<dd></dd>")
331 public void dd() throws Exception {
332 test("dd");
333 }
334
335
336
337
338 @Test
339 @Alerts("<del></del>")
340 public void del() throws Exception {
341 test("del");
342 }
343
344
345
346
347 @Test
348 @Alerts("<details></details>")
349 public void details() throws Exception {
350 test("details");
351 }
352
353
354
355
356 @Test
357 @Alerts("<dialog></dialog>")
358 public void dialog() throws Exception {
359 test("dialog");
360 }
361
362
363
364
365 @Test
366 @Alerts("<dir></dir>")
367 public void dir() throws Exception {
368 test("dir");
369 }
370
371
372
373
374 @Test
375 @Alerts("<div></div>")
376 public void div() throws Exception {
377 test("div");
378 }
379
380
381
382
383 @Test
384 @Alerts("<dl></dl>")
385 public void dl() throws Exception {
386 test("dl");
387 }
388
389
390
391
392 @Test
393 @Alerts("<dt></dt>")
394 public void dt() throws Exception {
395 test("dt");
396 }
397
398
399
400
401 @Test
402 @Alerts("<embed>")
403 public void embed() throws Exception {
404 test("embed");
405 }
406
407
408
409
410 @Test
411 @Alerts("<em></em>")
412 public void em() throws Exception {
413 test("em");
414 }
415
416
417
418
419 @Test
420 @Alerts("<fieldset></fieldset>")
421 public void fieldset() throws Exception {
422 test("fieldset");
423 }
424
425
426
427
428 @Test
429 @Alerts("<figcaption></figcaption>")
430 public void figcaption() throws Exception {
431 test("figcaption");
432 }
433
434
435
436
437 @Test
438 @Alerts("<figure></figure>")
439 public void figure() throws Exception {
440 test("figure");
441 }
442
443
444
445
446 @Test
447 @Alerts("<font></font>")
448 public void font() throws Exception {
449 test("font");
450 }
451
452
453
454
455 @Test
456 @Alerts("<form></form>")
457 public void form() throws Exception {
458 test("form");
459 }
460
461
462
463
464 @Test
465 @Alerts("<footer></footer>")
466 public void footer() throws Exception {
467 test("footer");
468 }
469
470
471
472
473 @Test
474 @Alerts("<frame>")
475 public void frame() throws Exception {
476 test("frame");
477 }
478
479
480
481
482 @Test
483 @Alerts("<frameset></frameset>")
484 public void frameset() throws Exception {
485 test("frameset");
486 }
487
488
489
490
491 @Test
492 @Alerts("<h1></h1>")
493 public void h1() throws Exception {
494 test("h1");
495 }
496
497
498
499
500 @Test
501 @Alerts("<h2></h2>")
502 public void h2() throws Exception {
503 test("h2");
504 }
505
506
507
508
509 @Test
510 @Alerts("<h3></h3>")
511 public void h3() throws Exception {
512 test("h3");
513 }
514
515
516
517
518 @Test
519 @Alerts("<h4></h4>")
520 public void h4() throws Exception {
521 test("h4");
522 }
523
524
525
526
527 @Test
528 @Alerts("<h5></h5>")
529 public void h5() throws Exception {
530 test("h5");
531 }
532
533
534
535
536 @Test
537 @Alerts("<h6></h6>")
538 public void h6() throws Exception {
539 test("h6");
540 }
541
542
543
544
545 @Test
546 @Alerts("<head></head>")
547 public void head() throws Exception {
548 test("head");
549 }
550
551
552
553
554 @Test
555 @Alerts("<header></header>")
556 public void header() throws Exception {
557 test("header");
558 }
559
560
561
562
563 @Test
564 @Alerts("<hr>")
565 public void hr() throws Exception {
566 test("hr");
567 }
568
569
570
571
572 @Test
573 @Alerts("<html></html>")
574 public void html() throws Exception {
575 test("html");
576 }
577
578
579
580
581 @Test
582 @Alerts("<iframe></iframe>")
583 public void iframe() throws Exception {
584 test("iframe");
585 }
586
587
588
589
590 @Test
591 @Alerts("<q></q>")
592 public void q() throws Exception {
593 test("q");
594 }
595
596
597
598
599 @Test
600 @Alerts("<ruby></ruby>")
601 public void ruby() throws Exception {
602 test("ruby");
603 }
604
605
606
607
608 @Test
609 @Alerts("<rt></rt>")
610 public void rt() throws Exception {
611 test("rt");
612 }
613
614
615
616
617 @Test
618 @Alerts("<rtc></rtc>")
619 public void rtc() throws Exception {
620 test("rtc");
621 }
622
623
624
625
626
627 @Test
628 @Alerts("<rb></rb>")
629 public void rb() throws Exception {
630 test("rb");
631 }
632
633
634
635
636 @Test
637 @Alerts("<rbc></rbc>")
638 public void rbc() throws Exception {
639 test("rbc");
640 }
641
642
643
644
645 @Test
646 @Alerts("<rp></rp>")
647 public void rp() throws Exception {
648 test("rp");
649 }
650
651
652
653
654 @Test
655 @Alerts("<image></image>")
656 public void image() throws Exception {
657 test("image");
658 }
659
660
661
662
663 @Test
664 @Alerts("<img>")
665 public void img() throws Exception {
666 test("img");
667 }
668
669
670
671
672 @Test
673 @Alerts("<ins></ins>")
674 public void ins() throws Exception {
675 test("ins");
676 }
677
678
679
680
681 @Test
682 @Alerts("<isindex></isindex>")
683 public void isindex() throws Exception {
684 test("isindex");
685 }
686
687
688
689
690 @Test
691 @Alerts("<i></i>")
692 public void i() throws Exception {
693 test("i");
694 }
695
696
697
698
699 @Test
700 @Alerts("<kbd></kbd>")
701 public void kbd() throws Exception {
702 test("kbd");
703 }
704
705
706
707
708 @Test
709 @Alerts("<keygen>")
710 public void keygen() throws Exception {
711 test("keygen");
712 }
713
714
715
716
717 @Test
718 @Alerts("<label></label>")
719 public void label() throws Exception {
720 test("label");
721 }
722
723
724
725
726 @Test
727 @Alerts("<layer></layer>")
728 public void layer() throws Exception {
729 test("layer");
730 }
731
732
733
734
735 @Test
736 @Alerts("<legend></legend>")
737 public void legend() throws Exception {
738 test("legend");
739 }
740
741
742
743
744 @Test
745 @Alerts("<listing></listing>")
746 public void listing() throws Exception {
747 test("listing");
748 }
749
750
751
752
753 @Test
754 @Alerts("<li></li>")
755 public void li() throws Exception {
756 test("li");
757 }
758
759
760
761
762 @Test
763 @Alerts("<link>")
764 public void link() throws Exception {
765 test("link");
766 }
767
768
769
770
771 @Test
772 @Alerts("<main></main>")
773 public void main() throws Exception {
774 test("main");
775 }
776
777
778
779
780 @Test
781 @Alerts("<map></map>")
782 public void map() throws Exception {
783 test("map");
784 }
785
786
787
788
789 @Test
790 @Alerts("<marquee></marquee>")
791 public void marquee() throws Exception {
792 test("marquee");
793 }
794
795
796
797
798 @Test
799 @Alerts("<mark></mark>")
800 public void mark() throws Exception {
801 test("mark");
802 }
803
804
805
806
807 @Test
808 @Alerts("<menu></menu>")
809 public void menu() throws Exception {
810 test("menu");
811 }
812
813
814
815
816 @Test
817 @Alerts("<menuitem></menuitem>")
818 public void menuitem() throws Exception {
819 test("menuitem");
820 }
821
822
823
824
825 @Test
826 @Alerts("<meta>")
827 public void meta() throws Exception {
828 test("meta");
829 }
830
831
832
833
834 @Test
835 @Alerts("<meter></meter>")
836 public void meter() throws Exception {
837 test("meter");
838 }
839
840
841
842
843 @Test
844 @Alerts("<multicol></multicol>")
845 public void multicol() throws Exception {
846 test("multicol");
847 }
848
849
850
851
852 @Test
853 @Alerts("<nav></nav>")
854 public void nav() throws Exception {
855 test("nav");
856 }
857
858
859
860
861 @Test
862 @Alerts("<nextid></nextid>")
863 public void nextid() throws Exception {
864 test("nextid");
865 }
866
867
868
869
870 @Test
871 @Alerts("<nobr></nobr>")
872 public void nobr() throws Exception {
873 test("nobr");
874 }
875
876
877
878
879 @Test
880 @Alerts("<noembed></noembed>")
881 public void noembed() throws Exception {
882 test("noembed");
883 }
884
885
886
887
888 @Test
889 @Alerts("<noframes></noframes>")
890 public void noframes() throws Exception {
891 test("noframes");
892 }
893
894
895
896
897 @Test
898 @Alerts("<noscript></noscript>")
899 public void noscript() throws Exception {
900 test("noscript");
901 }
902
903
904
905
906 @Test
907 @Alerts("<nolayer></nolayer>")
908 public void nolayer() throws Exception {
909 test("nolayer");
910 }
911
912
913
914
915 @Test
916 @Alerts("<object></object>")
917 public void object() throws Exception {
918 test("object");
919 }
920
921
922
923
924 @Test
925 @Alerts("<ol></ol>")
926 public void ol() throws Exception {
927 test("ol");
928 }
929
930
931
932
933 @Test
934 @Alerts("<optgroup></optgroup>")
935 public void optgroup() throws Exception {
936 test("optgroup");
937 }
938
939
940
941
942 @Test
943 @Alerts("<option></option>")
944 public void option() throws Exception {
945 test("option");
946 }
947
948
949
950
951 @Test
952 @Alerts("<output></output>")
953 public void output() throws Exception {
954 test("output");
955 }
956
957
958
959
960 @Test
961 @Alerts("<p></p>")
962 public void p() throws Exception {
963 test("p");
964 }
965
966
967
968
969 @Test
970 @Alerts("<param>")
971 public void param() throws Exception {
972 test("param");
973 }
974
975
976
977
978 @Test
979 @Alerts("<plaintext></plaintext>")
980 public void plaintext() throws Exception {
981 test("plaintext");
982 }
983
984
985
986
987 @Test
988 @Alerts("<pre></pre>")
989 public void pre() throws Exception {
990 test("pre");
991 }
992
993
994
995
996 @Test
997 @Alerts("<progress></progress>")
998 public void progress() throws Exception {
999 test("progress");
1000 }
1001
1002
1003
1004
1005 @Test
1006 @Alerts("<s></s>")
1007 public void s() throws Exception {
1008 test("s");
1009 }
1010
1011
1012
1013
1014 @Test
1015 @Alerts("<samp></samp>")
1016 public void samp() throws Exception {
1017 test("samp");
1018 }
1019
1020
1021
1022
1023 @Test
1024 @Alerts("<script></script>")
1025 public void script() throws Exception {
1026 test("script");
1027 }
1028
1029
1030
1031
1032 @Test
1033 @Alerts("<section></section>")
1034 public void section() throws Exception {
1035 test("section");
1036 }
1037
1038
1039
1040
1041 @Test
1042 @Alerts("<select></select>")
1043 public void select() throws Exception {
1044 test("select");
1045 }
1046
1047
1048
1049
1050 @Test
1051 @Alerts("<small></small>")
1052 public void small() throws Exception {
1053 test("small");
1054 }
1055
1056
1057
1058
1059 @Test
1060 @Alerts("<source>")
1061 public void source() throws Exception {
1062 test("source");
1063 }
1064
1065
1066
1067
1068 @Test
1069 @Alerts("<spacer></spacer>")
1070 public void spacer() throws Exception {
1071 test("spacer");
1072 }
1073
1074
1075
1076
1077 @Test
1078 @Alerts("<span></span>")
1079 public void span() throws Exception {
1080 test("span");
1081 }
1082
1083
1084
1085
1086 @Test
1087 @Alerts("<strike></strike>")
1088 public void strike() throws Exception {
1089 test("strike");
1090 }
1091
1092
1093
1094
1095 @Test
1096 @Alerts("<strong></strong>")
1097 public void strong() throws Exception {
1098 test("strong");
1099 }
1100
1101
1102
1103
1104 @Test
1105 @Alerts("<style></style>")
1106 public void style() throws Exception {
1107 test("style");
1108 }
1109
1110
1111
1112
1113 @Test
1114 @Alerts("<sub></sub>")
1115 public void sub() throws Exception {
1116 test("sub");
1117 }
1118
1119
1120
1121
1122 @Test
1123 @Alerts("<summary></summary>")
1124 public void summary() throws Exception {
1125 test("summary");
1126 }
1127
1128
1129
1130
1131 @Test
1132 @Alerts("<sup></sup>")
1133 public void sup() throws Exception {
1134 test("sup");
1135 }
1136
1137
1138
1139
1140 @Test
1141 @Alerts("<svg></svg>")
1142 public void svg() throws Exception {
1143 test("svg");
1144 }
1145
1146
1147
1148
1149 @Test
1150 @Alerts("<table></table>")
1151 public void table() throws Exception {
1152 test("table");
1153 }
1154
1155
1156
1157
1158 @Test
1159 @Alerts("<tbody></tbody>")
1160 public void tbody() throws Exception {
1161 test("tbody");
1162 }
1163
1164
1165
1166
1167 @Test
1168 @Alerts("<td></td>")
1169 public void td() throws Exception {
1170 test("td");
1171 }
1172
1173
1174
1175
1176 @Test
1177 @Alerts("<th></th>")
1178 public void th() throws Exception {
1179 test("th");
1180 }
1181
1182
1183
1184
1185 @Test
1186 @Alerts("<tr></tr>")
1187 public void tr() throws Exception {
1188 test("tr");
1189 }
1190
1191
1192
1193
1194 @Test
1195 @Alerts("<track>")
1196 public void track() throws Exception {
1197 test("track");
1198 }
1199
1200
1201
1202
1203 @Test
1204 @Alerts("<textarea></textarea>")
1205 public void textarea() throws Exception {
1206 test("textarea");
1207 }
1208
1209
1210
1211
1212 @Test
1213 @Alerts("<tfoot></tfoot>")
1214 public void tfoot() throws Exception {
1215 test("tfoot");
1216 }
1217
1218
1219
1220
1221 @Test
1222 @Alerts("<thead></thead>")
1223 public void thead() throws Exception {
1224 test("thead");
1225 }
1226
1227
1228
1229
1230 @Test
1231 @Alerts("<tt></tt>")
1232 public void tt() throws Exception {
1233 test("tt");
1234 }
1235
1236
1237
1238
1239 @Test
1240 @Alerts("<time></time>")
1241 public void time() throws Exception {
1242 test("time");
1243 }
1244
1245
1246
1247
1248 @Test
1249 @Alerts("<title></title>")
1250 public void title() throws Exception {
1251 test("title");
1252 }
1253
1254
1255
1256
1257 @Test
1258 @Alerts("<u></u>")
1259 public void u() throws Exception {
1260 test("u");
1261 }
1262
1263
1264
1265
1266 @Test
1267 @Alerts("<ul></ul>")
1268 public void ul() throws Exception {
1269 test("ul");
1270 }
1271
1272
1273
1274
1275 @Test
1276 @Alerts("<var></var>")
1277 public void var() throws Exception {
1278 test("var");
1279 }
1280
1281
1282
1283
1284 @Test
1285 @Alerts("<video></video>")
1286 public void video() throws Exception {
1287 test("video");
1288 }
1289
1290
1291
1292
1293 @Test
1294 @Alerts("<wbr>")
1295 public void wbr() throws Exception {
1296 test("wbr");
1297 }
1298
1299
1300
1301
1302 @Test
1303 @Alerts("<xmp></xmp>")
1304 public void xmp() throws Exception {
1305 test("xmp");
1306 }
1307
1308
1309
1310
1311 @Test
1312 @Alerts("<input>")
1313 public void input() throws Exception {
1314 test("input");
1315 }
1316
1317
1318
1319
1320 @Test
1321 @Alerts("<data></data>")
1322 public void data() throws Exception {
1323 test("data");
1324 }
1325
1326
1327
1328
1329 @Test
1330 @Alerts("<content></content>")
1331 public void content() throws Exception {
1332 test("content");
1333 }
1334
1335
1336
1337
1338 @Test
1339 @Alerts("<picture></picture>")
1340 public void picture() throws Exception {
1341 test("picture");
1342 }
1343
1344
1345
1346
1347 @Test
1348 @Alerts("<template></template>")
1349 public void template() throws Exception {
1350 test("template");
1351 }
1352
1353
1354
1355
1356 @Test
1357 @Alerts("<slot></slot>")
1358 public void slot() throws Exception {
1359 test("slot");
1360 }
1361
1362
1363
1364
1365 @Test
1366 @Alerts("<abcdefg></abcdefg>")
1367 public void arbitrary() throws Exception {
1368 test("abcdefg");
1369 }
1370 }