From b2837be655860c80da1137a86b9f16788ba4eff7 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Mon, 19 Sep 2011 10:09:53 +0000 Subject: [PATCH] fix some test : with struts we cannot have both client and server side validation git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1172553 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/archiva/web/test/ArtifactManagementTest.java | 6 ++---- .../web/test/parent/AbstractArtifactManagementTest.java | 5 +++++ .../archiva/web/test/parent/AbstractSeleniumTest.java | 1 + 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/ArtifactManagementTest.java b/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/ArtifactManagementTest.java index 67c323527..33aab3c9c 100644 --- a/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/ArtifactManagementTest.java +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/ArtifactManagementTest.java @@ -51,7 +51,6 @@ public class ArtifactManagementTest @Test( dependsOnMethods = { "testAddArtifactNoGroupId" }, alwaysRun = true ) public void testAddArtifactNoArtifactId() { - addArtifact( getGroupId(), " ", getVersion(), getPackaging(), getArtifactFilePath(), getRepositoryId(), false ); assertTextPresent( "You must enter an artifactId." ); } @@ -164,15 +163,14 @@ public class ArtifactManagementTest @Test( alwaysRun = true, dependsOnMethods = { "testAddArtifactNullValues" } ) public void testDeleteArtifactNoVersion() { - deleteArtifact( "delete", "delete", " ", "internal" ); - assertTextPresent( "Invalid version." ); + deleteArtifact( "delete", "delete", " ", "internal", true ); assertTextPresent( "You must enter a version." ); } @Test( alwaysRun = true, dependsOnMethods = { "testAddArtifactNullValues" } ) public void testDeleteArtifactInvalidVersion() { - deleteArtifact( "delete", "delete", "asdf", "internal" ); + deleteArtifact( "delete", "delete", "asdf", "internal", true ); assertTextPresent( "Invalid version." ); } diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractArtifactManagementTest.java b/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractArtifactManagementTest.java index 1b373f650..c126d7fd6 100644 --- a/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractArtifactManagementTest.java +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractArtifactManagementTest.java @@ -66,6 +66,11 @@ public abstract class AbstractArtifactManagementTest } public void deleteArtifact( String groupId, String artifactId, String version, String repositoryId ) + { + deleteArtifact( groupId, artifactId, version, repositoryId, false ); + } + + public void deleteArtifact( String groupId, String artifactId, String version, String repositoryId, boolean wait ) { goToDeleteArtifactPage(); setFieldValue( "groupId", groupId ); diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractSeleniumTest.java b/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractSeleniumTest.java index c30fba72f..f855b5332 100644 --- a/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractSeleniumTest.java +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractSeleniumTest.java @@ -236,6 +236,7 @@ public abstract class AbstractSeleniumTest public void waitPage() { + // TODO define a smaller maxWaitTimeJsInMs for wait javascript response for browser side validation getSelenium().waitForPageToLoad( maxWaitTimeInMs ); }