[Httpunit-commit] CVS: httpunit/test/com/meterware/httpunit/javascript ScriptingTest.java,1.25,1.26
Brought to you by:
russgold
|
From: Russell G. <rus...@us...> - 2002-09-27 15:49:04
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/javascript
In directory usw-pr-cvs1:/tmp/cvs-serv22163/test/com/meterware/httpunit/javascript
Modified Files:
ScriptingTest.java
Log Message:
Made Link href Javascript property writeable
Index: ScriptingTest.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/javascript/ScriptingTest.java,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- ScriptingTest.java 26 Sep 2002 21:49:35 -0000 1.25
+++ ScriptingTest.java 27 Sep 2002 15:49:02 -0000 1.26
@@ -368,6 +368,24 @@
}
+ public void testLinkProperties() throws Exception {
+ defineResource( "somewhere.html?with=values", "you made it!" );
+ defineResource( "OnCommand.html", "<html><head></head>" +
+ "<body>" +
+ "<a name=target href='nowhere.html'>" +
+ "<a name=control href='#' onClick=\"document.target.href='somewhere.html?with=values';\">green</a>" +
+ "</body></html>" );
+ WebConversation wc = new WebConversation();
+ WebResponse response = wc.getResponse( getHostPath() + "/OnCommand.html" );
+ WebLink link = response.getLinkWithName( "target" );
+ assertEquals( "initial value", "nowhere.html", link.getURLString() );
+ response.getLinkWithName( "control" ).click();
+ assertEquals( "changed reference", getHostPath() + "/somewhere.html?with=values", link.getRequest().getURL().toExternalForm() );
+ response = link.click();
+ assertEquals( "New page", "you made it!", response.getText() );
+ }
+
+
public void testLinkIndexes() throws Exception {
defineResource( "OnCommand.html", "<html><head><script language='JavaScript'>" +
"function alertLinks() { " +
|