1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package net.sourceforge.jwebunit.tests;
20
21 import static net.sourceforge.jwebunit.junit.JWebUnit.assertElementPresent;
22 import static net.sourceforge.jwebunit.junit.JWebUnit.assertFormPresent;
23 import static net.sourceforge.jwebunit.junit.JWebUnit.beginAt;
24 import static net.sourceforge.jwebunit.junit.JWebUnit.setBaseUrl;
25 import static net.sourceforge.jwebunit.junit.JWebUnit.submit;
26
27 import org.junit.Test;
28
29
30
31
32 public class HtmlParsingTest extends JWebUnitAPITestCase {
33
34 public void setUp() throws Exception {
35 super.setUp();
36 setBaseUrl(HOST_PATH + "/HtmlTest/");
37 }
38
39 @Test public void testSimpleForm() {
40 beginAt("SimpleForm.html");
41 assertFormPresent();
42 submit();
43 }
44
45 @Test public void testInvalidForm() {
46 beginAt("InvalidForm.html");
47 assertFormPresent();
48 submit();
49 }
50
51 @Test public void testInvalidFormNoDoctype() {
52 beginAt("InvalidFormNoDoctype.html");
53 assertFormPresent();
54 submit();
55 }
56
57 @Test public void testValidComplexForm() {
58 beginAt("ValidComplexForm.html");
59 assertFormPresent();
60 submit();
61 }
62
63 @Test public void testValidFormNoDoctype() {
64 beginAt("ValidFormNoDoctype.html");
65 assertFormPresent();
66 submit();
67 }
68
69 @Test public void testXhtmlStrict() {
70 beginAt("XhtmlStrict.html");
71
72 assertElementPresent("div1");
73
74 }
75 }