continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1412096 - in /continuum/trunk/continuum-webapp-test/src/test: resources/ testng/org/apache/continuum/web/test/ testng/org/apache/continuum/web/test/parent/
Date Wed, 21 Nov 2012 13:48:57 GMT
Author: brett
Date: Wed Nov 21 13:48:55 2012
New Revision: 1412096

URL: http://svn.apache.org/viewvc?rev=1412096&view=rev
Log:
[CONTINUUM-2692] fix Selenium tests after recent changes

Modified:
    continuum/trunk/continuum-webapp-test/src/test/resources/testng.properties
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/AntProjectTest.java
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildDefinitionTest.java
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/DistributedBuildTest.java
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ShellProjectTest.java
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractContinuumTest.java

Modified: continuum/trunk/continuum-webapp-test/src/test/resources/testng.properties
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/resources/testng.properties?rev=1412096&r1=1412095&r2=1412096&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/resources/testng.properties (original)
+++ continuum/trunk/continuum-webapp-test/src/test/resources/testng.properties Wed Nov 21
13:48:55 2012
@@ -217,6 +217,8 @@ BUILD_DEFINITION_GOALS=test
 BUILD_DEFINITION_ARGUMENTS=--batch-mode --non-recursive
 BUILD_DEFINITION_DESCRIPTION=Maven Build Definition Description
 
+BUILD_DEFINITION_ANT_PROJECT_NAME=Build Definition Test Ant Project
+
 # Build queue tests
 
 BUILD_QUEUE_NAME=name_build_queue
@@ -260,6 +262,10 @@ SHELL_SCM_URL=http://localhost:9595/exam
 SHELL_SCM_USERNAME=
 SHELL_SCM_PASSWORD=
 
+SHELL_PROJECT_GROUP_NAME=Shell Test Project Group
+SHELL_PROJECT_GROUP_ID=shell.group
+SHELL_PROJECT_GROUP_DESCRIPTION=She sells seashells by the seashore
+
 ########################
 # projectGroup group 
 ########################

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/AntProjectTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/AntProjectTest.java?rev=1412096&r1=1412095&r2=1412096&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/AntProjectTest.java
(original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/AntProjectTest.java
Wed Nov 21 13:48:55 2012
@@ -20,6 +20,7 @@ package org.apache.continuum.web.test;
  */
 
 import org.apache.continuum.web.test.parent.AbstractAdminTest;
+import org.testng.annotations.AfterMethod;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
@@ -73,6 +74,13 @@ public class AntProjectTest
         addProjectGroup( projectGroupName, projectGroupId, projectGroupDescription, true,
false );
     }
 
+    @AfterMethod
+    public void tearDown()
+        throws Throwable
+    {
+        removeProjectGroup( projectGroupName, false );
+    }
+
     public void testAddAntProject()
         throws Exception
     {
@@ -108,10 +116,11 @@ public class AntProjectTest
         assertTextPresent( "SCM Url is required and cannot contain null or spaces only" );
     }
 
-    @Test( dependsOnMethods = {"testAddAntProject"} )
     public void testAddDuplicateAntProject()
         throws Exception
     {
+        testAddAntProject();
+
         goToAddAntProjectPage();
         addProject( projectName, projectDescription, projectVersion, scmUrl, scmUsername,
scmPassword, projectTag, null,
                     false, "ant" );

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildDefinitionTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildDefinitionTest.java?rev=1412096&r1=1412095&r2=1412096&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildDefinitionTest.java
(original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildDefinitionTest.java
Wed Nov 21 13:48:55 2012
@@ -86,7 +86,7 @@ public class BuildDefinitionTest
         String pomUsername = getProperty( "MAVEN2_POM_USERNAME" );
         String pomPassword = getProperty( "MAVEN2_POM_PASSWORD" );
 
-        antProjectName = getProperty( "ANT_NAME" );
+        antProjectName = getProperty( "BUILD_DEFINITION_ANT_PROJECT_NAME" );
         antProjectDescription = getProperty( "ANT_DESCRIPTION" );
         antProjectVersion = getProperty( "ANT_VERSION" );
         antProjectTag = getProperty( "ANT_TAG" );

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/DistributedBuildTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/DistributedBuildTest.java?rev=1412096&r1=1412095&r2=1412096&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/DistributedBuildTest.java
(original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/DistributedBuildTest.java
Wed Nov 21 13:48:55 2012
@@ -195,7 +195,7 @@ public class DistributedBuildTest
 
         goToGroupBuildDefinitionPage( projectGroupName, projectGroupId, projectGroupDescription
);
         clickImgWithAlt( "Edit" );
-        assertAddEditBuildDefinitionPage( "maven2" );
+        assertAddEditBuildDefinitionPage( MAVEN_PROJECT_TYPE );
         selectValue( "profileId", buildEnvName );
         submit();
         assertGroupBuildDefinitionPage( projectGroupName );

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ShellProjectTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ShellProjectTest.java?rev=1412096&r1=1412095&r2=1412096&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ShellProjectTest.java
(original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ShellProjectTest.java
Wed Nov 21 13:48:55 2012
@@ -20,6 +20,8 @@ package org.apache.continuum.web.test;
  */
 
 import org.apache.continuum.web.test.parent.AbstractAdminTest;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
 /**
@@ -32,39 +34,69 @@ import org.testng.annotations.Test;
 public class ShellProjectTest
     extends AbstractAdminTest
 {
+    private String projectGroupId;
+
+    private String projectGroupName;
+
+    private String projectGroupDescription;
+
+    private String scmPassword;
+
+    private String scmUsername;
+
+    private String scmUrl;
+
+    private String scmTag;
+
+    private String projectVersion;
+
+    private String projectDescription;
+
+    private String projectName;
+
+    @BeforeMethod
+    public void setUp()
+    {
+        projectGroupId = getProperty( "SHELL_PROJECT_GROUP_ID" );
+        projectGroupName = getProperty( "SHELL_PROJECT_GROUP_NAME" );
+        projectGroupDescription = getProperty( "SHELL_PROJECT_GROUP_DESCRIPTION" );
+        projectName = getProperty( "SHELL_NAME" );
+        projectDescription = getProperty( "SHELL_DESCRIPTION" );
+        projectVersion = getProperty( "SHELL_VERSION" );
+        scmUrl = getProperty( "SHELL_SCM_URL" );
+        scmUsername = getProperty( "SHELL_SCM_USERNAME" );
+        scmPassword = getProperty( "SHELL_SCM_PASSWORD" );
+        scmTag = getProperty( "SHELL_TAG" );
+
+        addProjectGroup( projectGroupName, projectGroupId, projectGroupDescription, true,
false );
+    }
+
+    @AfterClass
+    public void cleanup()
+    {
+        removeProjectGroup( projectGroupName );
+    }
+
     public void testAddShellProject()
         throws Exception
     {
-        String SHELL_NAME = getProperty( "SHELL_NAME" );
-        String SHELL_DESCRIPTION = getProperty( "SHELL_DESCRIPTION" );
-        String SHELL_VERSION = getProperty( "SHELL_VERSION" );
-        String SHELL_TAG = getProperty( "SHELL_TAG" );
-        String SHELL_SCM_URL = getProperty( "SHELL_SCM_URL" );
-        String SHELL_SCM_USERNAME = getProperty( "SHELL_SCM_USERNAME" );
-        String SHELL_SCM_PASSWORD = getProperty( "SHELL_SCM_PASSWORD" );
-        String DEFAULT_PROJ_GRP_NAME = getProperty( "DEFAULT_PROJ_GRP_NAME" );
-        String DEFAULT_PROJ_GRP_ID = getProperty( "DEFAULT_PROJ_GRP_ID" );
-        String DEFAULT_PROJ_GRP_DESCRIPTION = getProperty( "DEFAULT_PROJ_GRP_DESCRIPTION"
);
         goToAddShellProjectPage();
-        addProject( SHELL_NAME, SHELL_DESCRIPTION, SHELL_VERSION, SHELL_SCM_URL, SHELL_SCM_USERNAME,
SHELL_SCM_PASSWORD,
-                    SHELL_TAG, DEFAULT_PROJ_GRP_NAME, true, "shell" );
-        assertProjectGroupSummaryPage( DEFAULT_PROJ_GRP_NAME, DEFAULT_PROJ_GRP_ID, DEFAULT_PROJ_GRP_DESCRIPTION
);
+        addProject( projectName, projectDescription, projectVersion, scmUrl, scmUsername,
scmPassword, scmTag,
+                    projectGroupName, true, "shell" );
+        assertProjectGroupSummaryPage( projectGroupName, projectGroupId, projectGroupDescription
);
     }
 
     public void testAddShellProjectWithInvalidValues()
         throws Exception
     {
-        String SHELL_NAME = "!@#$<>?etc";
-        String SHELL_DESCRIPTION = "![]<>'^&etc";
-        String SHELL_VERSION = "<>whitespaces!#etc";
-        String SHELL_TAG = "!<>*%etc";
-        String SHELL_SCM_URL = "!<>*%etc";
-        String SHELL_SCM_USERNAME = getProperty( "SHELL_SCM_USERNAME" );
-        String SHELL_SCM_PASSWORD = getProperty( "SHELL_SCM_PASSWORD" );
-        String DEFAULT_PROJ_GRP_NAME = getProperty( "DEFAULT_PROJ_GRP_NAME" );
+        String projectName = "!@#$<>?etc";
+        String description = "![]<>'^&etc";
+        String version = "<>whitespaces!#etc";
+        String tag = "!<>*%etc";
+        String scmUrl = "!<>*%etc";
         goToAddShellProjectPage();
-        addProject( SHELL_NAME, SHELL_DESCRIPTION, SHELL_VERSION, SHELL_SCM_URL, SHELL_SCM_USERNAME,
SHELL_SCM_PASSWORD,
-                    SHELL_TAG, DEFAULT_PROJ_GRP_NAME, false, "shell" );
+        addProject( projectName, description, version, scmUrl, scmUsername, scmPassword,
tag, projectGroupName, false,
+                    "shell" );
         assertTextPresent( "Name contains invalid characters." );
         assertTextPresent( "Version contains invalid characters." );
         assertTextPresent( "SCM Url contains invalid characters." );
@@ -85,16 +117,9 @@ public class ShellProjectTest
     public void testAddDuplicateShellProject()
         throws Exception
     {
-        String SHELL_NAME = getProperty( "SHELL_NAME" );
-        String SHELL_DESCRIPTION = getProperty( "SHELL_DESCRIPTION" );
-        String SHELL_VERSION = getProperty( "SHELL_VERSION" );
-        String SHELL_TAG = getProperty( "SHELL_TAG" );
-        String SHELL_SCM_URL = getProperty( "SHELL_SCM_URL" );
-        String SHELL_SCM_USERNAME = getProperty( "SHELL_SCM_USERNAME" );
-        String SHELL_SCM_PASSWORD = getProperty( "SHELL_SCM_PASSWORD" );
         goToAddShellProjectPage();
-        addProject( SHELL_NAME, SHELL_DESCRIPTION, SHELL_VERSION, SHELL_SCM_URL, SHELL_SCM_USERNAME,
SHELL_SCM_PASSWORD,
-                    SHELL_TAG, null, false, "shell" );
+        addProject( projectName, projectDescription, projectVersion, scmUrl, scmUsername,
scmPassword, scmTag, null,
+                    false, "shell" );
         assertTextPresent( "Project name already exist" );
     }
 

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractContinuumTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractContinuumTest.java?rev=1412096&r1=1412095&r2=1412096&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractContinuumTest.java
(original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractContinuumTest.java
Wed Nov 21 13:48:55 2012
@@ -758,7 +758,10 @@ public abstract class AbstractContinuumT
         }
         waitAddProject( title );
 
-        assertLinkPresent( name );
+        if ( success )
+        {
+            assertLinkPresent( name );
+        }
     }
 
     protected void waitAddProject( String title )



Mime
View raw message