Note that this not correct and you've just removed one test which was to check 
that the current tab is the Comments tab.

This needs to be rolled-back (or another test that verifies that the comments 
tab is the first one needs to be added) and the comments tab needs to be put 
back as the first tab (this was discussed on IRC yesterday).

Thanks
-Vincent

On Mar 23, 2011, at 4:49 AM, sdumitriu (SVN) wrote:

> Author: sdumitriu
> Date: 2011-03-23 04:49:01 +0100 (Wed, 23 Mar 2011)
> New Revision: 35817
> 
> Modified:
>   
> enterprise/trunk/distribution-test/selenium-tests/src/test/it/org/xwiki/test/selenium/CommentTest.java
> Log:
> [misc] Fixed failing tests
> 
> Modified: 
> enterprise/trunk/distribution-test/selenium-tests/src/test/it/org/xwiki/test/selenium/CommentTest.java
> ===================================================================
> --- 
> enterprise/trunk/distribution-test/selenium-tests/src/test/it/org/xwiki/test/selenium/CommentTest.java
>     2011-03-23 03:09:08 UTC (rev 35816)
> +++ 
> enterprise/trunk/distribution-test/selenium-tests/src/test/it/org/xwiki/test/selenium/CommentTest.java
>     2011-03-23 03:49:01 UTC (rev 35817)
> @@ -120,6 +120,7 @@
>             loginAsAdmin();
>         }
>         open("CommentTest", "PageWithSomeComments");
> +        loadCommentsTab();
> 
>         // Wait until comments load though ajax mechanism.
>         
> waitForElement("//div[@id='_comments']/form[@id='AddComment']/fieldset[@id='commentform']");
> @@ -147,6 +148,7 @@
>         if (!isAuthenticated()) {
>             loginAsAdmin();
>         }
> +        loadCommentsTab();
>         if 
> (!isElementPresent("//div[@class='commentheader']/div/span[@class='commentauthor']/span/a"))
>  {
>             postComment("This comment will be edited.", null, true);
>         }
> @@ -207,6 +209,7 @@
> 
>     public void postComment(String comment, String author, boolean 
> doubleCheck)
>     {
> +        loadCommentsTab();
>         setCommentContent(comment);
>         if (author != null) {
>             setCommentAuthor(author);
> @@ -233,6 +236,14 @@
>         return 
> getSelenium().getAttribute("//input[@name='XWiki.XWikiComments_author']@value");
>     }
> 
> +    public void loadCommentsTab()
> +    {
> +        if (isElementPresent("//a[@id='Commentslink']")) {
> +            clickLinkWithXPath("//a[@id='Commentslink']", false);
> +            
> waitForCondition("selenium.browserbot.findElement(\"Commentspane\").className.indexOf(\"empty\")
>  == -1");
> +        }
> +    }
> +
>     public void setCommentContent(String content)
>     {
>         waitForElement("//textarea[@id='XWiki.XWikiComments_comment']");

_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to