1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package org.htmlunit.html;
16
17 import org.htmlunit.SimpleWebTestCase;
18 import org.htmlunit.junit.BrowserRunner;
19 import org.junit.Test;
20 import org.junit.runner.RunWith;
21
22
23
24
25
26
27
28
29 @RunWith(BrowserRunner.class)
30 public class HtmlTableSectionTest extends SimpleWebTestCase {
31
32
33
34
35 @Test
36 public void asNormalizedText() throws Exception {
37 final String html = DOCTYPE_HTML
38 + "<html>\n"
39 + "<body>\n"
40 + " <table>\n"
41 + " <tfoot><td>Five</td></tfoot>\n"
42 + " <tbody><td>Two</td></tbody>\n"
43 + " <thead><td>One</td></thead>\n"
44 + " <thead><td>Three</td></thead>\n"
45 + " <tfoot><td>Four</td></tfoot>\n"
46 + " </table>\n"
47 + "</body></html>";
48
49 final HtmlPage page = loadPageWithAlerts(html);
50 assertEquals("One\nTwo\nThree\nFour\nFive", page.asNormalizedText());
51 }
52 }