You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@archiva.apache.org by ma...@apache.org on 2017/06/08 21:27:49 UTC

archiva git commit: Migrating additional tests to WebDriver

Repository: archiva
Updated Branches:
  refs/heads/master 7b8d3bb38 -> d31ce651b


Migrating additional tests to WebDriver

LoginTest, ArchivaAdminTest, RepositoryAdminTest are migrated to WebDriver tests
with FluentWait usage.


Project: http://git-wip-us.apache.org/repos/asf/archiva/repo
Commit: http://git-wip-us.apache.org/repos/asf/archiva/commit/d31ce651
Tree: http://git-wip-us.apache.org/repos/asf/archiva/tree/d31ce651
Diff: http://git-wip-us.apache.org/repos/asf/archiva/diff/d31ce651

Branch: refs/heads/master
Commit: d31ce651b1d684bfa8cf404d76b8342fdcd0a468
Parents: 7b8d3bb
Author: Martin Stockhammer <ma...@apache.org>
Authored: Thu Jun 8 23:25:16 2017 +0200
Committer: Martin Stockhammer <ma...@apache.org>
Committed: Thu Jun 8 23:25:16 2017 +0200

----------------------------------------------------------------------
 .../archiva/web/test/ArchivaAdminTest.java      |   2 +-
 .../org/apache/archiva/web/test/LoginTest.java  |  25 +--
 .../archiva/web/test/RepositoryAdminTest.java   |  41 +++--
 .../archiva/web/test/WebDriverBrowseTest.java   |   2 +-
 .../apache/archiva/web/test/WebDriverTest.java  |   2 +-
 .../web/test/parent/AbstractArchivaTest.java    |   2 +-
 .../web/test/parent/AbstractSeleniumTest.java   | 180 +++++++------------
 .../tools/ArchivaSeleniumExecutionRule.java     |   2 -
 .../web/test/tools/WebdriverUtility.java        |  15 +-
 .../src/test/resources/jetty/jetty-env.xml      |   1 -
 .../main/webapp/js/templates/archiva/menu.html  |   2 +-
 11 files changed, 119 insertions(+), 155 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/archiva/blob/d31ce651/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/ArchivaAdminTest.java
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/ArchivaAdminTest.java b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/ArchivaAdminTest.java
index 8be57aa..5a9d156 100644
--- a/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/ArchivaAdminTest.java
+++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/ArchivaAdminTest.java
@@ -29,7 +29,7 @@ public class ArchivaAdminTest
     @Test
     public void testHome()
     {
-        getSelenium().open( baseUrl );
+        getWebDriver().get( baseUrl );
         assertPage( "Apache Archiva" );
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/archiva/blob/d31ce651/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/LoginTest.java
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/LoginTest.java b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/LoginTest.java
index 24f1a09..f984428 100644
--- a/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/LoginTest.java
+++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/LoginTest.java
@@ -23,6 +23,8 @@ import org.apache.archiva.web.test.parent.AbstractArchivaTest;
 import org.junit.Assert;
 import org.junit.Test;
 import org.openqa.selenium.By;
+import org.openqa.selenium.support.ui.ExpectedConditions;
+import org.openqa.selenium.support.ui.WebDriverWait;
 
 /**
  * Based on LoginTest of Emmanuel Venisse test.
@@ -41,8 +43,9 @@ public class LoginTest
     {
         goToLoginPage();
         setFieldValue( "user-login-form-username", "badUsername" );
-        clickLinkWithLocator( "modal-login-ok", true );
-        assertTextPresent( "This field is required." );
+        clickLinkWithLocator( "modal-login-ok", false );
+        WebDriverWait wait = new WebDriverWait(getWebDriver(), 2);
+        wait.until(ExpectedConditions.textToBePresentInElementLocated(By.id("modal-login"), "This field is required."));
 
     }
 
@@ -52,8 +55,9 @@ public class LoginTest
         goToLoginPage();
         setFieldValue( "user-login-form-username", getProperty( "ADMIN_USERNAME" ) );
         setFieldValue( "user-login-form-password", "badPassword" );
-        clickLinkWithLocator( "modal-login-ok", true );
-        assertTextPresent( "You have entered an incorrect username and/or password" );
+        clickLinkWithLocator( "modal-login-ok", false );
+        WebDriverWait wait = new WebDriverWait(getWebDriver(), 2);
+        wait.until(ExpectedConditions.textToBePresentInElementLocated(By.id("modal-login"), "You have entered an incorrect username and/or password"));
     }
 
     @Test
@@ -61,9 +65,9 @@ public class LoginTest
     {
         goToLoginPage();
         setFieldValue( "user-login-form-password", "password" );
-        waitPage();
-        clickLinkWithLocator( "modal-login-ok", true );
-        assertTextPresent( "This field is required." );
+        clickLinkWithLocator( "modal-login-ok", false);
+        WebDriverWait wait = new WebDriverWait(getWebDriver(), 2);
+        wait.until(ExpectedConditions.textToBePresentInElementLocated(By.id("modal-login"), "This field is required."));
     }
 
     @Test
@@ -73,8 +77,9 @@ public class LoginTest
         setFieldValue( "user-login-form-username", getProperty( "ADMIN_USERNAME" ) );
         Assert.assertTrue(getWebDriver().findElement( By.id("modal-login-ok") ).isDisplayed());
         Assert.assertTrue(getWebDriver().findElement( By.id("modal-login-ok") ).isEnabled());
-        clickLinkWithLocator( "modal-login-ok", true );
-        assertTextPresent( "This field is required." );
+        clickLinkWithLocator( "modal-login-ok", false );
+        WebDriverWait wait = new WebDriverWait(getWebDriver(), 2);
+        wait.until(ExpectedConditions.textToBePresentInElementLocated(By.id("modal-login"), "This field is required."));
     }
 
     @Test
@@ -83,7 +88,7 @@ public class LoginTest
         goToLoginPage();
         setFieldValue( "user-login-form-username", getProperty( "ADMIN_USERNAME" ) );
         setFieldValue( "user-login-form-password", getProperty( "ADMIN_PASSWORD" ) );
-        clickLinkWithLocator( "modal-login-ok", true );
+        clickLinkWithLocator( "modal-login-ok");
 
         assertUserLoggedIn( getProperty( "ADMIN_USERNAME" ) );
     }

http://git-wip-us.apache.org/repos/asf/archiva/blob/d31ce651/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/RepositoryAdminTest.java
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/RepositoryAdminTest.java b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/RepositoryAdminTest.java
index b519bd9..4728e40 100644
--- a/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/RepositoryAdminTest.java
+++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/RepositoryAdminTest.java
@@ -22,8 +22,12 @@ package org.apache.archiva.web.test;
 import org.apache.archiva.web.test.parent.AbstractArchivaTest;
 import org.junit.Assert;
 import org.junit.Test;
+import org.openqa.selenium.By;
 import org.openqa.selenium.JavascriptExecutor;
 import org.openqa.selenium.htmlunit.HtmlUnitDriver;
+import org.openqa.selenium.support.ui.ExpectedCondition;
+import org.openqa.selenium.support.ui.ExpectedConditions;
+import org.openqa.selenium.support.ui.WebDriverWait;
 
 /**
  * Based on LoginTest of Emmanuel Venisse test.
@@ -41,36 +45,41 @@ public class RepositoryAdminTest
     public void testManagedRepository()
     {
         login( getAdminUsername(), getAdminPassword() );
-        clickLinkWithLocator( "menu-repositories-list-a", true );
-        // add custom repo
-        assertTextPresent( "Repositories Administration" );
-        clickLinkWithXPath( "//a[@href='#remote-repositories-content']", true );
-        
-        clickLinkWithXPath( "//a[@href='#remote-repository-edit']", true );
+        clickLinkWithLocator( "menu-repositories-list-a");
+        WebDriverWait wait = new WebDriverWait(getWebDriver(), 10);
+        wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("managed-repositories-view-a")));
+        clickLinkWithXPath( "//a[@href='#remote-repositories-content']");
+        wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("remote-repositories-view-a")));
+        clickLinkWithXPath( "//a[@href='#remote-repository-edit']", false );
+        wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("remote-repository-save-button")));
         
         setFieldValue( "id", "myrepoid" );        
         setFieldValue( "name", "My repo name" );        
         setFieldValue( "url", "http://www.repo.org" );
         
-        clickButtonWithLocator( "remote-repository-save-button", true );
-       
-        clickLinkWithLocator( "menu-proxy-connectors-list-a", true );
-        
+        clickButtonWithLocator( "remote-repository-save-button");
+        wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("remote-repositories-view-a")));
+
+        clickLinkWithLocator( "menu-proxy-connectors-list-a");
+        wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("proxy-connectors-view-tabs-a-network-proxies-grid")));
+        wait.until(ExpectedConditions.textToBePresentInElementLocated(By.id("main-content"), "Proxy Connectors"));
         // proxy connect
-        assertTextPresent( "Proxy Connectors" );
-        assertTextPresent( "central" );
+        wait.until(ExpectedConditions.textToBePresentInElementLocated(By.id("proxy-connectors-view"), "central" ));
         assertTextNotPresent( "myrepoid" );
-        clickButtonWithLocator( "proxy-connectors-view-tabs-a-edit", true );
+        clickButtonWithLocator( "proxy-connectors-view-tabs-a-edit");
+        wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("proxy-connector-btn-save")));
         selectValue( "sourceRepoId", "internal" );
         // Workaround
         // TODO: Check after upgrade of htmlunit, bootstrap or jquery
         // TODO: Check whats wrong here
         ( (JavascriptExecutor) getWebDriver() ).executeScript( "$('#targetRepoId').show();" );
         // End of Workaround
+        wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("targetRepoId")));
         selectValue( "targetRepoId", "myrepoid" );
-        clickButtonWithLocator( "proxy-connector-btn-save", true);
-        assertTextPresent( "central" );
-        assertTextPresent( "myrepoid" );
+        clickButtonWithLocator( "proxy-connector-btn-save");
+        wait.until(ExpectedConditions.textToBePresentInElementLocated(By.id("user-messages"),"ProxyConnector added"));
+        wait.until(ExpectedConditions.textToBePresentInElementLocated(By.id("proxy-connectors-view"), "central" ));
+        wait.until(ExpectedConditions.textToBePresentInElementLocated(By.id("proxy-connectors-view"), "myrepoid" ));
         clickLinkWithXPath( "//i[contains(concat(' ',normalize-space(@class),' '),' icon-resize-vertical ')]/../..", true );
         assertTextPresent( "internal" );
         // order test

http://git-wip-us.apache.org/repos/asf/archiva/blob/d31ce651/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/WebDriverBrowseTest.java
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/WebDriverBrowseTest.java b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/WebDriverBrowseTest.java
index 7c7b718..2470494 100644
--- a/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/WebDriverBrowseTest.java
+++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/WebDriverBrowseTest.java
@@ -64,7 +64,7 @@ public class WebDriverBrowseTest
     public void takeScreenShot( String fileName )
     {
         log.info("Taking screenshot "+fileName);
-        WebdriverUtility.takeScreenShot( fileName, getDriver(), (a)->super.takeScreenShot( a ) );
+        WebdriverUtility.takeScreenShot( fileName, getDriver() );
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/archiva/blob/d31ce651/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/WebDriverTest.java
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/WebDriverTest.java b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/WebDriverTest.java
index bb01a89..a27ee47 100644
--- a/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/WebDriverTest.java
+++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/WebDriverTest.java
@@ -57,7 +57,7 @@ public class WebDriverTest
     public void takeScreenShot( String fileName )
     {
         log.info("Taking screenshot "+fileName);
-        WebdriverUtility.takeScreenShot( fileName, getDriver(), (a)->super.takeScreenShot( a ) );
+        WebdriverUtility.takeScreenShot( fileName, getDriver());
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/archiva/blob/d31ce651/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/parent/AbstractArchivaTest.java
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/parent/AbstractArchivaTest.java b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/parent/AbstractArchivaTest.java
index d05cbcc..54a20d5 100644
--- a/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/parent/AbstractArchivaTest.java
+++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/parent/AbstractArchivaTest.java
@@ -169,7 +169,7 @@ public abstract class AbstractArchivaTest
 
     public void goToHomePage()
     {
-        getSelenium().open( baseUrl );
+        getWebDriver().get( baseUrl );
     }
 
     protected void logout()

http://git-wip-us.apache.org/repos/asf/archiva/blob/d31ce651/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/parent/AbstractSeleniumTest.java
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/parent/AbstractSeleniumTest.java b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/parent/AbstractSeleniumTest.java
index 763bcc3..2245910 100644
--- a/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/parent/AbstractSeleniumTest.java
+++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/parent/AbstractSeleniumTest.java
@@ -29,6 +29,9 @@ import org.junit.Rule;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.sql.Time;
 import java.text.SimpleDateFormat;
 import java.util.Arrays;
 import java.util.Date;
@@ -37,14 +40,15 @@ import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Properties;
+import java.util.concurrent.TimeUnit;
+
 import org.apache.commons.io.FileUtils;
-import org.openqa.selenium.By;
-import org.openqa.selenium.JavascriptExecutor;
-import org.openqa.selenium.NoSuchElementException;
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.WebElement;
+import org.openqa.selenium.*;
 import org.openqa.selenium.htmlunit.HtmlUnitDriver;
+import org.openqa.selenium.support.ui.ExpectedConditions;
+import org.openqa.selenium.support.ui.FluentWait;
 import org.openqa.selenium.support.ui.Select;
+import org.openqa.selenium.support.ui.WebDriverWait;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -73,8 +77,6 @@ public abstract class AbstractSeleniumTest
 
     public boolean remoteSelenium = Boolean.parseBoolean( System.getProperty( "remoteSelenium", "false" ) );
 
-    private Selenium selenium = null;
-
     WebDriver webDriver = null;
 
     public Properties p;
@@ -93,7 +95,6 @@ public abstract class AbstractSeleniumTest
         baseUrl = WebdriverUtility.getBaseUrl()+"/index.html?request_lang=en";
 
         open( baseUrl, browser, seleniumHost, seleniumPort, maxWaitTimeInMs, remoteSelenium );
-        archivaSeleniumExecutionRule.selenium = selenium;
         assertAdminCreated();
     }
 
@@ -102,10 +103,7 @@ public abstract class AbstractSeleniumTest
      */
     public void close()
     {
-        if ( getSelenium() != null )
-        {
-            getSelenium().stop();
-        }
+        getWebDriver().close();
     }
 
     /**
@@ -116,13 +114,11 @@ public abstract class AbstractSeleniumTest
     {
         try
         {
-            if ( getSelenium() == null )
+            if ( getWebDriver() == null )
             {
                 WebDriver driver = WebdriverUtility.newWebDriver(browser, seleniumHost, seleniumPort, remoteSelenium);
-                WebDriverBackedSelenium selenium = new WebDriverBackedSelenium(driver, baseUrl);
                 // selenium.start();
-                selenium.setTimeout( Integer.toString( maxWaitTimeInMs ) );
-                this.selenium = selenium;
+                // selenium.setTimeout( Integer.toString( maxWaitTimeInMs ) );
                 this.webDriver = driver;
             }
         }
@@ -147,9 +143,15 @@ public abstract class AbstractSeleniumTest
 
         open( baseUrl, browser, seleniumHost, seleniumPort, maxWaitTimeInMs, remoteSelenium);
 
-        getSelenium().open( baseUrl );
+        getWebDriver().get(baseUrl);
+        WebDriverWait wait = new WebDriverWait(getWebDriver(),30);
+        wait.until(ExpectedConditions.presenceOfElementLocated(By.id("topbar-menu")));
+
+        FluentWait fluentWait = new FluentWait(getWebDriver()).withTimeout(10, TimeUnit.SECONDS);
+        fluentWait.until( ExpectedConditions.or(
+                    ExpectedConditions.visibilityOfElementLocated(By.id("create-admin-link")),
+                            ExpectedConditions.visibilityOfElementLocated(By.id("login-link-a"))));
 
-        waitPage();
 
         // if not admin user created create one
         if ( isElementVisible( "create-admin-link" ) )
@@ -157,7 +159,9 @@ public abstract class AbstractSeleniumTest
             Assert.assertFalse( isElementVisible( "login-link-a" ) );
             Assert.assertFalse( isElementVisible( "register-link-a" ) );
             // skygo need to set to true for passing is that work as expected ?
-            clickLinkWithLocator( "create-admin-link-a", true );
+            clickLinkWithLocator( "create-admin-link-a");
+            wait = new WebDriverWait(getWebDriver(), 5);
+            wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("user-create")));
             assertCreateAdmin();
             String fullname = getProperty( "ADMIN_FULLNAME" );
             String username = getAdminUsername();
@@ -165,16 +169,10 @@ public abstract class AbstractSeleniumTest
             String password = getProperty( "ADMIN_PASSWORD" );
             submitAdminData( fullname, mail, password );
             assertUserLoggedIn( username );
-            clickLinkWithLocator( "logout-link-a" );
+            clickLinkWithLocator( "logout-link-a" , false);
         }
         else
         {
-            try
-            {
-                Assert.assertNotNull( getWebDriver().findElement( By.id( "login-link-a" ) ) );
-            } catch (NoSuchElementException e) {
-                logger.info("ASSERT: login-link-a not found!");
-            }
             Assert.assertTrue( isElementVisible( "login-link-a" ) );
             Assert.assertTrue( isElementVisible( "register-link-a" ) );
             login( getAdminUsername(), getAdminPassword() );
@@ -182,11 +180,6 @@ public abstract class AbstractSeleniumTest
 
     }
 
-    public Selenium getSelenium()
-    {
-        return selenium;
-    }
-
     public WebDriver getWebDriver() {
         return this.webDriver;
     }
@@ -214,7 +207,7 @@ public abstract class AbstractSeleniumTest
         setFieldValue( "email", email );
         setFieldValue( "password", password );
         setFieldValue( "confirmPassword", password );
-        clickButtonWithLocator( "user-create-form-register-button" );
+        clickButtonWithLocator( "user-create-form-register-button" , false);
     }
 
     public void login( String username, String password )
@@ -239,20 +232,22 @@ public abstract class AbstractSeleniumTest
     // Go to Login Page
     public void goToLoginPage()
     {
-        getSelenium().open( baseUrl );
-        waitPage();
-        getWebDriver().manage().window().maximize();
+        logger.info("Goto login page");
+        getWebDriver().get( baseUrl );
+        WebDriverWait wait = new WebDriverWait(getWebDriver(),30);
+        wait.until(ExpectedConditions.presenceOfElementLocated(By.id("topbar-menu")));
+        wait.until(ExpectedConditions.or(ExpectedConditions.visibilityOfElementLocated(By.id("logout-link")),
+                ExpectedConditions.visibilityOfElementLocated(By.id("login-link-a"))));
+
         // are we already logged in ?
         if ( isElementVisible( "logout-link" ) ) //isElementPresent( "logoutLink" ) )
         {
+            logger.info("Logging out ");
             // so logout
             clickLinkWithLocator( "logout-link-a", false );
-            clickLinkWithLocator( "login-link-a" );
-        }
-        else if ( isElementVisible( "login-link-a" ) )
-        {
-            clickLinkWithLocator( "login-link-a", true );
         }
+        wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("login-link-a")));
+        clickLinkWithLocator( "login-link-a", false );
         // This is a workaround for bug with HTMLUnit. The display attribute of the
         // login dialog is not changed via the click.
         // TODO: Check after changing jquery, bootstrap or htmlunit version
@@ -261,7 +256,8 @@ public abstract class AbstractSeleniumTest
             ( (JavascriptExecutor) getWebDriver() ).executeScript( "$('#modal-login').show();" );
         }
         // END OF WORKAROUND
-
+        wait = new WebDriverWait(getWebDriver(),20);
+        wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("modal-login")));
         assertLoginModal();
     }
 
@@ -270,8 +266,8 @@ public abstract class AbstractSeleniumTest
     {
         assertElementPresent( "user-login-form" );
         Assert.assertTrue( isElementVisible( "register-link" ) );
-        assertElementPresent( "user-login-form-username" );
-        assertElementPresent( "user-login-form-password" );
+        Assert.assertTrue( isElementVisible("user-login-form-username" ));
+        Assert.assertTrue( isElementVisible("user-login-form-password" ));
         assertButtonWithIdPresent( "modal-login-ok" );
         Assert.assertTrue( isElementVisible( "modal-login-ok" ));
     }
@@ -290,19 +286,26 @@ public abstract class AbstractSeleniumTest
     public void submitLoginPage( String username, String password, boolean rememberMe, boolean validUsernamePassword,
                                  String assertReturnPage )
     {
-        clickLinkWithLocator( "login-link-a", true );
-        // TODO: Check whats wrong here
-        ( (JavascriptExecutor) getWebDriver() ).executeScript( "$('#modal-login').show();" );
-
-        setFieldValue( "user-login-form-username", username );
-        setFieldValue( "user-login-form-password", password );
+        logger.info("Activating login form");
+        // clickLinkWithLocator( "login-link-a", false);
+        WebDriverWait wait = new WebDriverWait(getWebDriver(),5);
+        WebElement usernameField = wait.until(ExpectedConditions.visibilityOf(getWebDriver().findElement(By.id("user-login-form-username"))));
+        wait = new WebDriverWait(getWebDriver(),5);
+        WebElement passwordField = wait.until(ExpectedConditions.visibilityOf(getWebDriver().findElement(By.id("user-login-form-password"))));
+        wait = new WebDriverWait(getWebDriver(),5);
+        WebElement button = wait.until(ExpectedConditions.elementToBeClickable(By.id("modal-login-ok")));
+        logger.info("Login form visible");
+        logger.info("Enter username "+username);
+        usernameField.sendKeys(username);
+        logger.info("Enter password "+password);
+        passwordField.sendKeys(password);
         /*
         if ( rememberMe )
         {
             checkField( "rememberMe" );
         }*/
 
-        clickButtonWithLocator( "modal-login-ok" );
+        button.click();
         if ( validUsernamePassword )
         {
             assertUserLoggedIn( username );
@@ -327,8 +330,9 @@ public abstract class AbstractSeleniumTest
 
     protected void assertUserLoggedIn( String username )
     {
+        WebDriverWait wait = new WebDriverWait(getWebDriver(), 10);
+        wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("logout-link")));
         Assert.assertFalse( isElementVisible( "login-link" ) );
-        Assert.assertTrue( isElementVisible( "logout-link" ) );
         Assert.assertFalse( isElementVisible( "register-link" ) );
         Assert.assertFalse( isElementVisible( "create-admin-link" ) );
     }
@@ -375,26 +379,10 @@ public abstract class AbstractSeleniumTest
         Assert.assertTrue( "'" + text + "' isn't present.", getWebDriver().getPageSource().contains( text ) );
     }
 
-    /**
-     * one of text args must be in the page so use en and fr text (olamy use en locale :-) )
-     *
-     * @param texts
-     */
-    public void assertTextPresent( String... texts )
-    {
-        boolean present = false;
-        StringBuilder sb = new StringBuilder();
-        for ( String text : texts )
-        {
-            present = present || getSelenium().isTextPresent( text );
-            sb.append( " " + text + " " );
-        }
-        Assert.assertTrue( "'one of the following test " + sb.toString() + "' isn't present.", present );
-    }
 
     public void assertTextNotPresent( String text )
     {
-        Assert.assertFalse( "'" + text + "' is present.", getSelenium().isTextPresent( text ) );
+        Assert.assertFalse( "'" + text + "' is present.", isTextPresent( text ) );
     }
 
     public void assertElementPresent( String elementLocator )
@@ -446,14 +434,11 @@ public abstract class AbstractSeleniumTest
         assertElementNotPresent( "/¯img[@alt='" + alt + "']" );
     }
 
-    public void assertCellValueFromTable( String expected, String tableElement, int row, int column )
-    {
-        Assert.assertEquals( expected, getCellValueFromTable( tableElement, row, column ) );
-    }
+
 
     public boolean isTextPresent( String text )
     {
-        return getSelenium().isTextPresent( text );
+        return getWebDriver().getPageSource().contains(text);
     }
 
     public boolean isLinkPresent( String text )
@@ -509,10 +494,6 @@ public abstract class AbstractSeleniumTest
         return findElement(fieldName ).getAttribute( "value" );
     }
 
-    public String getCellValueFromTable( String tableElement, int row, int column )
-    {
-        return getSelenium().getTable( tableElement + "." + row + "." + column );
-    }
 
     public void selectValue( String locator, String value )
     {
@@ -568,7 +549,7 @@ public abstract class AbstractSeleniumTest
 
     public void clickButtonWithValue( String text )
     {
-        clickButtonWithValue( text, true );
+        clickButtonWithValue( text, false );
     }
 
     public void clickButtonWithValue( String text, boolean wait )
@@ -602,7 +583,7 @@ public abstract class AbstractSeleniumTest
 
     public void clickLinkWithText( String text )
     {
-        clickLinkWithText( text, true );
+        clickLinkWithText( text, false );
     }
 
     public void clickLinkWithText( String text, boolean wait )
@@ -612,7 +593,7 @@ public abstract class AbstractSeleniumTest
 
     public void clickLinkWithXPath( String xpath )
     {
-        clickLinkWithXPath( xpath, true );
+        clickLinkWithXPath( xpath, false );
     }
 
     public void clickLinkWithXPath( String xpath, boolean wait )
@@ -622,7 +603,7 @@ public abstract class AbstractSeleniumTest
 
     public void clickLinkWithLocator( String locator )
     {
-        clickLinkWithLocator( locator, true );
+        clickLinkWithLocator( locator, false );
     }
 
     public void clickLinkWithLocator( String locator, boolean wait )
@@ -637,7 +618,7 @@ public abstract class AbstractSeleniumTest
 
     public void clickButtonWithLocator( String locator )
     {
-        clickButtonWithLocator( locator, true );
+        clickButtonWithLocator( locator, false );
     }
 
     public void clickButtonWithLocator( String locator, boolean wait )
@@ -720,42 +701,11 @@ public abstract class AbstractSeleniumTest
         }
 
         targetPath.mkdirs();
-        Selenium selenium = getSelenium();
-        if (selenium!=null)
+        if (getWebDriver()!=null)
         {
             String fileBaseName = methodName + "_" + className + ".java_" + lineNumber + "-" + time;
             File fileName = new File( targetPath, fileBaseName + ".png" );
-            selenium.windowMaximize();
-
-            if (selenium instanceof WebDriverBackedSelenium)
-            {
-                WebdriverUtility.takeScreenShot( fileName.getName(), ( (WebDriverBackedSelenium) selenium ).getWrappedDriver(),
-                    (a)->selenium.captureEntirePageScreenshot( a, "background=#FFFFFF" )
-                    );
-            } else
-            {
-
-                try
-                {
-                    // save html to have a minimum feedback if jenkins firefox not up
-                    File fileNameHTML = new File( new File( "target", "errorshtmlsnap" ), fileBaseName + ".html" );
-                    FileUtils.writeStringToFile( fileNameHTML, selenium.getHtmlSource() );
-                }
-                catch ( IOException e )
-                {
-                    System.out.print( e.getMessage() );
-                    e.printStackTrace();
-                }
-
-
-                try
-                {
-                }
-                catch ( UnsupportedOperationException ex )
-                {
-                    logger.warn( "Could not create screenshot. Not supported by this webdriver. " + selenium.getClass().getName() );
-                }
-            }
+            Path screenshot = WebdriverUtility.takeScreenShot( fileName.getName(), getWebDriver());
             return fileName.getAbsolutePath();
         } else {
             return "";

http://git-wip-us.apache.org/repos/asf/archiva/blob/d31ce651/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/tools/ArchivaSeleniumExecutionRule.java
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/tools/ArchivaSeleniumExecutionRule.java b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/tools/ArchivaSeleniumExecutionRule.java
index 779ebd6..16417fa 100644
--- a/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/tools/ArchivaSeleniumExecutionRule.java
+++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/tools/ArchivaSeleniumExecutionRule.java
@@ -36,8 +36,6 @@ public class ArchivaSeleniumExecutionRule
 
     final Logger log = LoggerFactory.getLogger( ArchivaSeleniumExecutionRule.class );
 
-    // FIXME cerate a separate TestRule for open and close calls ?
-    public Selenium selenium;
 
     public Statement apply( Statement base, FrameworkMethod method, Object target )
     {

http://git-wip-us.apache.org/repos/asf/archiva/blob/d31ce651/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/tools/WebdriverUtility.java
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/tools/WebdriverUtility.java b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/tools/WebdriverUtility.java
index 177c1fc..0f3af86 100644
--- a/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/tools/WebdriverUtility.java
+++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/tools/WebdriverUtility.java
@@ -21,9 +21,7 @@ package org.apache.archiva.web.test.tools;
 import com.gargoylesoftware.htmlunit.WebClient;
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang3.StringUtils;
-import org.openqa.selenium.Capabilities;
-import org.openqa.selenium.JavascriptExecutor;
-import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.*;
 import org.openqa.selenium.chrome.ChromeDriver;
 import org.openqa.selenium.firefox.FirefoxDriver;
 import org.openqa.selenium.htmlunit.HtmlUnitDriver;
@@ -174,16 +172,18 @@ public class WebdriverUtility
         return "http://localhost:" + containerPort+"/archiva";
     }
 
-    public static void takeScreenShot( String fileName, WebDriver driver, Consumer<String> screenShotFunction) {
+    public static Path takeScreenShot( String fileName, WebDriver driver) {
+        Path result = null;
         try
         {
             Path snapDir = Paths.get( "target", "errorshtmlsnap" );
+            Path screenShotDir = Paths.get("target","screenshots");
             if ( !Files.exists( snapDir ) )
             {
                 Files.createDirectories( snapDir );
             }
             Path htmlFile = snapDir.resolve( fileName + ".html" );
-            Path screenShotFile = snapDir.resolve( fileName );
+            Path screenShotFile = screenShotDir.resolve( fileName );
             String pageSource=null;
             String encoding="ISO-8859-1";
             try
@@ -199,7 +199,9 @@ public class WebdriverUtility
             FileUtils.writeStringToFile( htmlFile.toFile(), pageSource, encoding);
             try
             {
-                screenShotFunction.accept( screenShotFile.toAbsolutePath().toString() );
+                File scrs = ((TakesScreenshot)driver).getScreenshotAs( OutputType.FILE );
+                result = scrs.toPath();
+                Files.copy(result, screenShotFile);
             }
             catch ( Exception e )
             {
@@ -211,5 +213,6 @@ public class WebdriverUtility
         {
             log.info( "Creating screenshot failed " + e.getMessage() );
         }
+        return result;
     }
 }

http://git-wip-us.apache.org/repos/asf/archiva/blob/d31ce651/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/jetty/jetty-env.xml
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/jetty/jetty-env.xml b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/jetty/jetty-env.xml
index bed63bf..6d67520 100644
--- a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/jetty/jetty-env.xml
+++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/jetty/jetty-env.xml
@@ -17,7 +17,6 @@
   ~ specific language governing permissions and limitations
   ~ under the License.
   -->
-<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
 
 <Configure id="wac" class="org.eclipse.jetty.webapp.WebAppContext">
   <New id="derbyDs" class="org.eclipse.jetty.plus.jndi.Resource">

http://git-wip-us.apache.org/repos/asf/archiva/blob/d31ce651/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/archiva/menu.html
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/archiva/menu.html b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/archiva/menu.html
index 30bb261..df8c42e 100644
--- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/archiva/menu.html
+++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/archiva/menu.html
@@ -88,7 +88,7 @@
               </a>
             </li>
             <li id="login-link" style="display: none">
-              <a onclick="loginBox(); return false;" id="login-link-a">
+              <a onclick="loginBox();" id="login-link-a">
                 <span class="btn btn-success label force-upper-case">${$.i18n.prop('login')}</span>
               </a>
             </li>