|
From: <et...@us...> - 2011-09-16 23:16:01
|
Revision: 4444
http://mxquery.svn.sourceforge.net/mxquery/?rev=4444&view=rev
Author: etterth
Date: 2011-09-16 23:15:55 +0000 (Fri, 16 Sep 2011)
Log Message:
-----------
- Added tests for getting/setting styles
Added Paths:
-----------
trunk/XQIB_Testing/src/ch/ethz/mxquery/browsertests/Style.java
Added: trunk/XQIB_Testing/src/ch/ethz/mxquery/browsertests/Style.java
===================================================================
--- trunk/XQIB_Testing/src/ch/ethz/mxquery/browsertests/Style.java (rev 0)
+++ trunk/XQIB_Testing/src/ch/ethz/mxquery/browsertests/Style.java 2011-09-16 23:15:55 UTC (rev 4444)
@@ -0,0 +1,47 @@
+package ch.ethz.mxquery.browsertests;
+
+import java.util.List;
+import java.util.NoSuchElementException;
+
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openqa.selenium.WebElement;
+
+import ch.ethz.mxquery.testsuite.XQueryTestBase;
+
+public class Style extends XQueryTestBase {
+
+
+ @Test
+ /**
+ * test the b:setStyle function
+ */
+ public void class_addclass() throws Exception {
+ driver.get("http://127.0.0.1:8090/test/test.html");
+ executeNewScript("insert node <p>text</p> as first into b:dom()//body");
+ executeNewScript("b:setStyle(b:dom()//p,'color','red')");
+
+ WebElement element = driver.findElementByTagName("p");
+ String style = element.getAttribute("style");
+
+ Assert.assertEquals("color: red;", style);
+ }
+
+ @Test
+ /**
+ * test the b:getStyle function
+ */
+ public void class_removeclass() throws Exception {
+ driver.get("http://127.0.0.1:8090/test/test.html");
+ executeNewScript("insert node <p>text</p> as first into b:dom()//body");
+ executeNewScript("b:setStyle(b:dom()//p,'color','red')");
+ String value = executeNewScript("b:getStyle(b:dom()//p,'color')");
+ Assert.assertEquals("red", value);
+ }
+
+
+
+
+
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|