Revision: 767
          http://jwebunit.svn.sourceforge.net/jwebunit/?rev=767&view=rev
Author:   jevonwright
Date:     2008-11-18 03:09:00 +0000 (Tue, 18 Nov 2008)

Log Message:
-----------
adding test case for xpath preceding:: axis in IElement 

Modified Paths:
--------------
    
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/IElementTest.java

Modified: 
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/IElementTest.java
===================================================================
--- 
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/IElementTest.java
 2008-11-18 02:55:26 UTC (rev 766)
+++ 
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/IElementTest.java
 2008-11-18 03:09:00 UTC (rev 767)
@@ -200,4 +200,18 @@
        assertCommentNotPresent("definitely not here");
     }
     
+    /**
+     * Test preceding element XPath.
+     * preceding: "Selects everything in the document that is before the start 
tag of the current node"
+     */
+    public void testPreceding() {
+       IElement element = getElementById("first"); // li
+       // should get the first <input>, which is
+       // <input id="test" name="element_name" value="test3">
+       IElement preceding = element.getElement("preceding::input"); 
+       
+       assertEquals(preceding.getName(), "input");
+       assertEquals(preceding.getAttribute("name"), "element_name");
+    }
+    
 }


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
JWebUnit-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-development

Reply via email to