Skip to content
This repository was archived by the owner on Apr 7, 2022. It is now read-only.

Commit 7e60954

Browse files
committed
Add test case for <input type="file">. Doesn't work with HttpUnit (internal bug).
1 parent 1aeec14 commit 7e60954

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/FormSubmissionTest.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public void setUp() throws Exception {
2525
getTestContext().setBaseUrl(HOST_PATH + "/FormSubmissionTest");
2626
}
2727

28-
public void testSetInputField() {
28+
public void testSetTextField() {
2929
beginAt("/SingleNamedButtonForm.html");
3030
setTextField("color", "blue");
3131
submit("button");
@@ -38,7 +38,15 @@ public void testSetInputField() {
3838
assertTextPresent("Params are: color=red");
3939
}
4040

41-
public void testCheckBoxSelection() {
41+
public void testSetFileField() {
42+
beginAt("/SingleNamedButtonForm.html");
43+
setTextField("file", "c:\\test.txt");
44+
submit("button");
45+
assertTextPresent("Submitted parameters");
46+
assertTextPresent("file=test.txt");
47+
}
48+
49+
public void testCheckBoxSelection() {
4250
beginAt("/SingleNamedButtonForm.html");
4351
checkCheckbox("checkBox"); //Fail with httpunit because of hidden field with same name
4452
setTextField("color", "blue");

0 commit comments

Comments
 (0)