diff options
author | Olivier Lamy <olamy@apache.org> | 2011-06-20 23:03:37 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2011-06-20 23:03:37 +0000 |
commit | 8715b0a767e0f39fc7696928fcffc4bad04c45d7 (patch) | |
tree | b3258b05e3b3814378bd04dbff1605c19819b1cc /archiva-modules/archiva-web/archiva-webapp-test | |
parent | 0d6a0d7362e7dd56a2db5e18a9a8ad6f2e4ab02f (diff) | |
download | archiva-8715b0a767e0f39fc7696928fcffc4bad04c45d7.tar.gz archiva-8715b0a767e0f39fc7696928fcffc4bad04c45d7.zip |
satrt fixing some selenium to not be locale dependant only use id
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1137817 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-web/archiva-webapp-test')
2 files changed, 22 insertions, 12 deletions
diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/LoginTest.java b/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/LoginTest.java index 86cd81a7d..54f501973 100644 --- a/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/LoginTest.java +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/LoginTest.java @@ -40,6 +40,7 @@ import org.testng.annotations.Test; public class LoginTest extends AbstractArchivaTest { + @Test public void testWithBadUsername() { goToLoginPage(); @@ -55,9 +56,12 @@ public class LoginTest goToLoginPage(); setFieldValue( "loginForm_username", getProperty( "ADMIN_USERNAME" ) ); setFieldValue( "loginForm_password", "badPassword" ); - getSelenium().click( "loginForm__login" ); + getSelenium().click( "loginSubmit" ); getSelenium().waitForPageToLoad( maxWaitTimeInMs ); - assertTextPresent( "You have entered an incorrect username and/or password" ); + //assertTextPresent( "You have entered an incorrect username and/or password" ); + // <ul class="errorMessage"> + + assertElementPresent( "//ul[@class=\'errorMessage\']" ); } @Test( dependsOnMethods = { "testWithBadPassword" }, alwaysRun = true ) diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractArchivaTest.java b/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractArchivaTest.java index 95c499717..8cef498e9 100644 --- a/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractArchivaTest.java +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractArchivaTest.java @@ -131,19 +131,25 @@ public abstract class AbstractArchivaTest public void assertLoginPage() { - assertPage( "Apache Archiva \\ Login Page" ); - assertTextPresent( "Login" ); - assertTextPresent( "Register" ); - assertTextPresent( "Username" ); + //assertPage( "Apache Archiva \\ Login Page" ); + //assertTextPresent( "Login" ); + assertElementPresent( "loginForm" ); + //assertTextPresent( "Register" ); + assertElementPresent( "registerLink" ); + //assertTextPresent( "Username" ); assertElementPresent( "username" ); - assertTextPresent( "Password" ); + //assertTextPresent( "Password" ); assertElementPresent( "password" ); - assertTextPresent( "Remember Me" ); + //assertTextPresent( "Remember Me" ); assertElementPresent( "rememberMe" ); - assertButtonWithValuePresent( "Login" ); - assertButtonWithValuePresent( "Cancel" ); - assertTextPresent( "Need an Account? Register!" ); - assertTextPresent( "Forgot your Password? Request a password reset." ); + //assertButtonWithValuePresent( "Login" ); + assertButtonWithIdPresent( "loginSubmit" ); + //assertButtonWithValuePresent( "Cancel" ); + assertButtonWithIdPresent( "loginCancel" ); + //assertTextPresent( "Need an Account? Register!" ); + //assertTextPresent( "Forgot your Password? Request a password reset." ); + assertElementPresent( "registerLinkLoginPage" ); + assertElementPresent( "forgottenPasswordLink" ); } // User Management |