]> source.dussan.org Git - archiva.git/commitdiff
Fixing another timing issue with htmlunit tests
authorMartin Stockhammer <martin_s@apache.org>
Tue, 13 Jun 2017 11:29:24 +0000 (13:29 +0200)
committerMartin Stockhammer <martin_s@apache.org>
Tue, 13 Jun 2017 11:29:24 +0000 (13:29 +0200)
archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/RolesManagementTest.java

index b31ab23f94d45226966647796a0bc5d14083fee8..c7b1889e7c8e231dc69e3038620a9ea1bdd1e0c9 100644 (file)
@@ -23,6 +23,7 @@ import org.apache.commons.lang.StringUtils;
 import org.junit.Assert;
 import org.junit.Test;
 import org.openqa.selenium.By;
+import org.openqa.selenium.WebElement;
 import org.openqa.selenium.support.ui.ExpectedConditions;
 import org.openqa.selenium.support.ui.WebDriverWait;
 
@@ -39,9 +40,10 @@ public class RolesManagementTest
         throws Exception
     {
         login( getAdminUsername(), getAdminPassword() );
-        clickLinkWithLocator( "menu-roles-list-a");
         WebDriverWait wait = new WebDriverWait(getWebDriver(), 10);
-        wait.until(ExpectedConditions.textToBePresentInElementLocated(By.id("roles-view"),"Archiva System Administrator"));
+        WebElement link = wait.until(ExpectedConditions.elementToBeClickable( By.id("menu-roles-list-a") ));
+        tryClick( link, ExpectedConditions.textToBePresentInElementLocated(By.id("roles-view"),"Archiva System Administrator"),
+            "Roles view not available");
         Assert.assertTrue( StringUtils.isEmpty( getText( "role-description-Guest" ) ) );
         clickLinkWithLocator( "edit-role-Guest" );
         wait.until(ExpectedConditions.elementToBeClickable(By.id("role-edit-description-save")));