From 8095a5ff97a54c19f779b16b814204cfcb82f874 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Tue, 21 Jun 2011 22:13:49 +0000 Subject: [PATCH] continue work on selenium test with id rather than label git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1138210 13f79535-47bb-0310-9956-ffa450edef68 --- .../policies/AbstractUpdatePolicy.java | 2 +- .../web/test/parent/AbstractArchivaTest.java | 21 ++++++++++++------- .../web/test/parent/AbstractSearchTest.java | 3 +-- .../webapp/WEB-INF/applicationContext.xml | 2 +- .../webapp/WEB-INF/jsp/admin/repositories.jsp | 2 +- .../webapp/WEB-INF/jsp/decorators/default.jsp | 2 +- .../main/webapp/WEB-INF/jsp/quickSearch.jsp | 2 +- .../src/main/webapp/WEB-INF/jsp/results.jsp | 2 +- 8 files changed, 21 insertions(+), 15 deletions(-) diff --git a/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/AbstractUpdatePolicy.java b/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/AbstractUpdatePolicy.java index 1f7787886..06486113e 100644 --- a/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/AbstractUpdatePolicy.java +++ b/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/AbstractUpdatePolicy.java @@ -154,7 +154,7 @@ public abstract class AbstractUpdatePolicy if ( !localFile.exists() ) { // No file means it's ok. - log.debug( "OK to update " + getUpdateMode() + ", local file does not exist." ); + log.debug( "OK to update {}, local file does not exist.", getUpdateMode() ); return; } 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 6893ed036..ad3d1d77f 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 @@ -434,12 +434,15 @@ public abstract class AbstractArchivaTest public void assertFindArtifactPage() { - assertPage( "Apache Archiva \\ Find Artifact" ); - assertTextPresent( "Find Artifact" ); - assertTextPresent( "Search for:" ); - assertTextPresent( "Checksum:" ); - assertElementPresent( "q" ); - assertButtonWithValuePresent( "Search" ); + //assertPage( "Apache Archiva \\ Find Artifact" ); + assertElementPresent( "searchBox" ); + //assertTextPresent( "Find Artifact" ); + //assertTextPresent( "Search for:" ); + //assertTextPresent( "Checksum:" ); + assertElementPresent( "quickSearchValue" ); + assertElementPresent( "searchHint" ); + //assertButtonWithValuePresent( "Search" ); + assertElementPresent( "quickSearchSubmit" ); } // Appearance @@ -490,13 +493,17 @@ public abstract class AbstractArchivaTest "Upload Artifact,Group Id*:,Artifact Id*:,Version*:,Packaging*:,Classifier:,Generate Maven 2 POM,Artifact File*:,POM File:,Repository Id:"; String[] arrayArtifact = artifact.split( "," ); for ( String arrayartifact : arrayArtifact ) + { assertTextPresent( arrayartifact ); + } String artifactElements = - "upload_groupId,upload_artifactId,upload_version,upload_packaging,upload_classifier,upload_generatePom,upload_artifact,upload_pom,upload_repositoryId,upload_0"; + "upload_groupId,upload_artifactId,upload_version,upload_packaging,upload_classifier,upload_generatePom,upload_artifact,upload_pom,upload_repositoryId,uploadSubmit"; String[] arrayArtifactElements = artifactElements.split( "," ); for ( String artifactelements : arrayArtifactElements ) + { assertElementPresent( artifactelements ); + } } public void addArtifact( String groupId, String artifactId, String version, String packaging, 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 4383efce4..69bc7d15b 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 @@ -52,8 +52,7 @@ public abstract class AbstractSearchTest { goToSearchPage(); - getSelenium().type( "dom=document.forms[1].elements[0]", artifactId ); - //clickButtonWithValue( "Search" ); + setFieldValue( "quickSearchValue", artifactId ); clickButtonWithLocator( "quickSearchSubmit" ); } diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/applicationContext.xml b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/applicationContext.xml index ad1853073..01d6dd055 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/applicationContext.xml +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/applicationContext.xml @@ -169,7 +169,7 @@ scheduler1 org.quartz.simpl.SimpleThreadPool - 1 + 2 4 org.quartz.simpl.RAMJobStore diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/repositories.jsp b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/repositories.jsp index 321f035f9..655cb6838 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/repositories.jsp +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/repositories.jsp @@ -226,7 +226,7 @@ Process All Artifacts - + diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/decorators/default.jsp b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/decorators/default.jsp index 1ec4aba5f..83a757cd4 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/decorators/default.jsp +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/decorators/default.jsp @@ -80,7 +80,7 @@
- +
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/quickSearch.jsp b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/quickSearch.jsp index e8f761660..166c4b10b 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/quickSearch.jsp +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/quickSearch.jsp @@ -95,7 +95,7 @@ - + diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/results.jsp b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/results.jsp index d322c67b6..d23b1c0c8 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/results.jsp +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/results.jsp @@ -115,7 +115,7 @@