Revision: 769
          http://jwebunit.svn.sourceforge.net/jwebunit/?rev=769&view=rev
Author:   jevonwright
Date:     2008-11-24 01:42:25 +0000 (Mon, 24 Nov 2008)

Log Message:
-----------
adding tests for issue 996031: add a clickLinkWithExactText()

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

Added Paths:
-----------
    
trunk/jwebunit-commons-tests/src/main/resources/testcases/NavigationTest/test1.html
    
trunk/jwebunit-commons-tests/src/main/resources/testcases/NavigationTest/test2.html
    
trunk/jwebunit-commons-tests/src/main/resources/testcases/NavigationTest/test3.html

Modified: 
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/NavigationTest.java
===================================================================
--- 
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/NavigationTest.java
       2008-11-24 00:56:04 UTC (rev 768)
+++ 
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/NavigationTest.java
       2008-11-24 01:42:25 UTC (rev 769)
@@ -131,4 +131,27 @@
                clickLinkWithText("Map & Directions");
                assertTitleEquals("targetPage");
        }
+       
+       /**
+        * Testing for issue 996031
+        */
+       public void testLinkExactText() {
+               beginAt("/test1.html");
+               assertTitleEquals("test1");
+               assertLinkPresentWithExactText("one");
+               assertLinkPresentWithExactText("tone");
+               clickLinkWithExactText("one");
+               assertTitleEquals("test2");
+               
+               // the following should fail
+               boolean passed = false;
+               try {
+                       clickLinkWithExactText("doesn't exist");
+               } catch (AssertionFailedError e) {
+                       // expected
+                       passed = true;
+               }
+               assertTrue("non-existant link should throw an error", passed);
+       }
+       
 }
\ No newline at end of file

Added: 
trunk/jwebunit-commons-tests/src/main/resources/testcases/NavigationTest/test1.html
===================================================================
--- 
trunk/jwebunit-commons-tests/src/main/resources/testcases/NavigationTest/test1.html
                         (rev 0)
+++ 
trunk/jwebunit-commons-tests/src/main/resources/testcases/NavigationTest/test1.html
 2008-11-24 01:42:25 UTC (rev 769)
@@ -0,0 +1,9 @@
+<html>
+       <head>
+               <title>test1</title>
+       </head>
+       <body>
+               <a href="test3.html">tone</a>
+               <a href="test2.html">one</a>
+       </body>
+</html>
\ No newline at end of file

Added: 
trunk/jwebunit-commons-tests/src/main/resources/testcases/NavigationTest/test2.html
===================================================================
--- 
trunk/jwebunit-commons-tests/src/main/resources/testcases/NavigationTest/test2.html
                         (rev 0)
+++ 
trunk/jwebunit-commons-tests/src/main/resources/testcases/NavigationTest/test2.html
 2008-11-24 01:42:25 UTC (rev 769)
@@ -0,0 +1,9 @@
+<html>
+       <head>
+               <title>test2</title>
+       </head>
+       <body>
+               <a href="test3.html">tone</a>
+               <a href="test2.html">one</a>
+       </body>
+</html>
\ No newline at end of file

Added: 
trunk/jwebunit-commons-tests/src/main/resources/testcases/NavigationTest/test3.html
===================================================================
--- 
trunk/jwebunit-commons-tests/src/main/resources/testcases/NavigationTest/test3.html
                         (rev 0)
+++ 
trunk/jwebunit-commons-tests/src/main/resources/testcases/NavigationTest/test3.html
 2008-11-24 01:42:25 UTC (rev 769)
@@ -0,0 +1,9 @@
+<html>
+       <head>
+               <title>test3</title>
+       </head>
+       <body>
+               <a href="test3.html">tone</a>
+               <a href="test2.html">one</a>
+       </body>
+</html>
\ No newline at end of file


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