From: Wendy Smoak Date: Tue, 12 May 2009 00:35:39 +0000 (+0000) Subject: [MRM-1164] Improve the Selenium tests X-Git-Tag: archiva-1.2.1~20 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=dbd4e769c90a4ccd975e4281c2b06cd99d1fcb6f;p=archiva.git [MRM-1164] Improve the Selenium tests Submitted by: Marecor Baclay git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@773741 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/testng.properties b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/testng.properties index 9c384fa03..82e90928e 100644 --- a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/testng.properties +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/testng.properties @@ -15,12 +15,19 @@ SELENIUM_BROWSER=*firefox # Search SEARCH_BAD_ARTIFACT=asdf # Existing Artifact -ARTIFACT_GROUPID=test -ARTIFACT_ARTIFACTID=test +ARTIFACT_GROUPID=org.apache.maven.archiva.web.test +ARTIFACT_ARTIFACTID=artifact-a ARTIFACT_VERSION=1.0 ARTIFACT_PACKAGING=jar # Reports REPOSITORY_NAME=internal START_DATE=04/01/2009 -END_DATE=04/30/2009 \ No newline at end of file +END_DATE=04/30/2009 + +# User Management +GUEST_USERNAME=guest_user +GUEST_FULLNAME=Guest User +GUEST_EMAIL=guest_user@localhost.localdomain +GUEST_PASSWORD=guest12 +GUEST_PASSWORD1=guest123 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/ArchivaAdminTest.java b/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/ArchivaAdminTest.java index dca7c03d6..1ae6345f8 100644 --- a/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/ArchivaAdminTest.java +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/ArchivaAdminTest.java @@ -20,7 +20,6 @@ package org.apache.archiva.web.test; */ import org.apache.archiva.web.test.parent.AbstractArchivaTest; -import org.testng.Assert; import org.testng.annotations.AfterTest; import org.testng.annotations.BeforeSuite; import org.testng.annotations.BeforeTest; @@ -30,16 +29,14 @@ import org.testng.annotations.Test; public class ArchivaAdminTest extends AbstractArchivaTest { - @BeforeSuite + @BeforeSuite public void initializeContinuum() throws Exception { super.open(); - System.out.println( "open" ); getSelenium().open( baseUrl ); - System.out.println( "URL" ); String title = getSelenium().getTitle(); - if ( title.equals( "Create Admin User" ) ) + if ( title.equals( "Apache Archiva \\ Create Admin User" ) ) { assertCreateAdmin(); String fullname = p.getProperty( "ADMIN_FULLNAME" ); @@ -47,8 +44,6 @@ public class ArchivaAdminTest String mail = p.getProperty( "ADMIN_EMAIL" ); String password = p.getProperty( "ADMIN_PASSWORD" ); submitAdminData( fullname, mail, password ); - assertLoginPage(); - submitUserData( username, password, false, true ); assertAuthenticatedPage( username ); submit(); clickLinkWithText( "Logout" ); @@ -62,11 +57,13 @@ public class ArchivaAdminTest { super.open(); } + + public void displayLandingPage() { - getSelenium().open( baseUrl + "index.action" ); + getSelenium().open( baseUrl ); getSelenium().waitForPageToLoad( maxWaitTimeInMs ); - Assert.assertEquals( "Apache Archiva \\ Quick Search", getSelenium().getTitle() ); + assertPage( "Apache Archiva \\ Quick Search" ); } @Override diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/BrowseTest.java b/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/BrowseTest.java index 72fa33d91..bf27b808e 100644 --- a/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/BrowseTest.java +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/BrowseTest.java @@ -42,4 +42,4 @@ public class BrowseTest assertTextPresent( "Artifacts" ); } -} +} \ No newline at end of file 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 66398c439..75d9e7e11 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 @@ -107,4 +107,4 @@ public class LoginTest { super.close(); } -} +} \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/ReportsTest.java b/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/ReportsTest.java index 334e2b982..704086f9b 100644 --- a/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/ReportsTest.java +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/ReportsTest.java @@ -100,4 +100,4 @@ public class ReportsTest //TODO As of the creation of the tests, GroupId is not a required field in showing the reports of repository health. GroupId should be required I think. } -} +} \ No newline at end of file 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 0ac08e941..ea4359ae0 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 @@ -25,7 +25,7 @@ public abstract class AbstractArchivaTest public void assertCreateAdmin() { - assertPage( "Create Admin User" ); + assertPage( "Apache Archiva \\ Create Admin User" ); assertTextPresent( "Username" ); assertFieldValue( "admin", "user.username" ); assertTextPresent( "Full Name*" ); @@ -42,7 +42,7 @@ public abstract class AbstractArchivaTest public void submitAdminData( String fullname, String email, String password ) { setFieldValue( "user.fullName", fullname ); - setFieldValue( "user.emaim", email ); + setFieldValue( "user.email", email ); setFieldValue( "user.password", password ); setFieldValue( "user.confirmPassword", password ); submit(); diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractArtifactReportsTest.java b/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractArtifactReportsTest.java index 06d4a8b2d..fe41f490b 100644 --- a/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractArtifactReportsTest.java +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractArtifactReportsTest.java @@ -77,4 +77,4 @@ public abstract class AbstractArtifactReportsTest clickButtonWithValue( "View Statistics" ); } -} +} \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractBrowseTest.java b/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractBrowseTest.java index c9f598121..8fe485fc4 100644 --- a/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractBrowseTest.java +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractBrowseTest.java @@ -37,4 +37,4 @@ public abstract class AbstractBrowseTest assertTextPresent( "Groups" ); } -} +} \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractSearchTest.java b/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractSearchTest.java index 279f073cf..f31f5dc7e 100644 --- a/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractSearchTest.java +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractSearchTest.java @@ -54,4 +54,4 @@ public abstract class AbstractSearchTest getSelenium().type( "dom=document.forms[1].elements[0]", artifactId ); clickButtonWithValue( "Search" ); } -} +} \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/testng-pom.xml b/archiva-modules/archiva-web/archiva-webapp-test/testng-pom.xml index faa2847b6..3b73486b6 100644 --- a/archiva-modules/archiva-web/archiva-webapp-test/testng-pom.xml +++ b/archiva-modules/archiva-web/archiva-webapp-test/testng-pom.xml @@ -74,8 +74,14 @@ org.openqa.selenium.client-drivers selenium-java-client-driver - 0.8.1 + 1.0-SNAPSHOT test + + + commons-logging + commons-logging + + @@ -143,7 +149,7 @@ org.codehaus.mojo selenium-maven-plugin - 1.0-beta-1 + 1.0-rc-1 start-selenium @@ -273,7 +279,7 @@ + todir="${project.build.directory}/installs/${container.name}/apache-tomcat-5.5.27/apache-tomcat-5.5.27/common/lib"> @@ -366,7 +372,7 @@ tomcat5x - http://archive.apache.org/dist/tomcat/tomcat-5/v5.5.26/bin/apache-tomcat-5.5.26.zip + http://archive.apache.org/dist/tomcat/tomcat-5/v5.5.27/bin/apache-tomcat-5.5.27.zip