[Httpunit-commit] CVS: httpunit/test/com/meterware/httpunit/javascript ScriptingTest.java,1.42,1.43
Brought to you by:
russgold
|
From: Russell G. <rus...@us...> - 2002-11-03 06:31:17
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/javascript
In directory usw-pr-cvs1:/tmp/cvs-serv18976/test/com/meterware/httpunit/javascript
Modified Files:
ScriptingTest.java
Log Message:
Support location.replace
Index: ScriptingTest.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/javascript/ScriptingTest.java,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- ScriptingTest.java 31 Oct 2002 00:26:18 -0000 1.42
+++ ScriptingTest.java 3 Nov 2002 06:31:14 -0000 1.43
@@ -373,6 +373,7 @@
"<body onLoad='alert(\"Window location is \" + window.location);alert(\"Document location is \" + document.location)'>" +
"<a href='#' onMouseOver=\"window.location='" + getHostPath() + "/Target.html';\">go</a>" +
"<a href='#' onMouseOver=\"document.location='" + getHostPath() + "/Target.html';\">go</a>" +
+ "<a href='#' onMouseOver=\"document.location.replace('" + getHostPath() + "/Target.html');\">go</a>" +
"</body>" );
WebConversation wc = new WebConversation();
WebResponse response = wc.getResponse( getHostPath() + "/OnCommand.html" );
@@ -386,6 +387,11 @@
response.getLinks()[1].mouseOver();
assertEquals( "3rd page URL", getHostPath() + "/Target.html", wc.getCurrentPage().getURL().toExternalForm() );
assertEquals( "3rd page", "You made it!", wc.getCurrentPage().getText() );
+
+ response = wc.getResponse( getHostPath() + "/OnCommand.html" );
+ response.getLinks()[2].mouseOver();
+ assertEquals( "4th page URL", getHostPath() + "/Target.html", wc.getCurrentPage().getURL().toExternalForm() );
+ assertEquals( "4th page", "You made it!", wc.getCurrentPage().getText() );
}
|