|
From: <et...@us...> - 2011-10-17 22:18:44
|
Revision: 4489
http://mxquery.svn.sourceforge.net/mxquery/?rev=4489&view=rev
Author: etterth
Date: 2011-10-17 22:18:38 +0000 (Mon, 17 Oct 2011)
Log Message:
-----------
- added test for b:setHash
Modified Paths:
--------------
trunk/XQIB_Testing/src/ch/ethz/mxquery/browsertests/UrlManipulation.java
Modified: trunk/XQIB_Testing/src/ch/ethz/mxquery/browsertests/UrlManipulation.java
===================================================================
--- trunk/XQIB_Testing/src/ch/ethz/mxquery/browsertests/UrlManipulation.java 2011-10-17 22:13:36 UTC (rev 4488)
+++ trunk/XQIB_Testing/src/ch/ethz/mxquery/browsertests/UrlManipulation.java 2011-10-17 22:18:38 UTC (rev 4489)
@@ -33,9 +33,24 @@
String value = executeNewScript("b:setHref('" + newurl + "')");
Assert.assertEquals(newurl, driver.getCurrentUrl());
}
+
@Test
/**
+ * test the b:setHash function
+ */
+ public void url_setHash() throws Exception {
+ driver.get(executionpath + "/test/test.html");
+ driver.executeScript("window.stateHasToStay = 'state stays'", new Object[0]);
+ String newurl = executionpath + "/test/test.html#some_stuff";
+ String value = executeNewScript("b:setHash('" + "#some_stuff" + "')");
+ Assert.assertEquals(newurl, driver.getCurrentUrl());
+ String state = (String) driver.executeScript("return window.stateHasToStay;", new Object[0]);
+ Assert.assertEquals("state stays", state);
+ }
+
+ @Test
+ /**
* tests if the b:getLocation function returns the hash correctly
*/
public void url_getLocation() throws Exception {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|