continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jzurb...@apache.org
Subject svn commit: r820614 - in /continuum/trunk/continuum-webapp-test/src/test: resources/ testng/org/apache/continuum/web/test/ testng/org/apache/continuum/web/test/parent/
Date Thu, 01 Oct 2009 11:32:19 GMT
Author: jzurbano
Date: Thu Oct  1 11:32:19 2009
New Revision: 820614

URL: http://svn.apache.org/viewvc?rev=820614&view=rev
Log:
[CONTINUUM-2378] - Selenium Test for deleting projects and project groups
Added Selenium tests to the following:
- delete of project using the delete icon and the "Delete Project(s)" button
- delete of project group using the delete icon and the "Delete Group" button


Modified:
    continuum/trunk/continuum-webapp-test/src/test/resources/testng.properties
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MavenOneProjectTest.java
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MavenTwoProjectTest.java
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ProjectGroupTest.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=820614&r1=820613&r2=820614&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/resources/testng.properties (original)
+++ continuum/trunk/continuum-webapp-test/src/test/resources/testng.properties Thu Oct  1
11:32:19 2009
@@ -27,6 +27,12 @@
 M2_POM_USERNAME=
 M2_POM_PASSWORD=
 
+# Properties for testDeleteMavenTwoProject
+M2_DELETE_POM_URL=https://svn.apache.org/repos/asf/continuum/sandbox/simple-example/pom.xml
+M2_DELETE_PROJ_GRP_NAME=Continuum Simple Example Project
+M2_DELETE_PROJ_GRP_ID=org.apache.continuum.examples
+M2_DELETE_PROJ_GRP_DESCRIPTION=Delete test project
+
 # SCM element is missing from pom
 NOT_SCM_POM_URL=http://svn.apache.org/repos/asf/continuum/trunk/continuum-webapp-test/src/test/resources/unit/maven-two-projects/missing-scm-element-pom.xml
 MISS_CONECT_POM_URL=http://svn.apache.org/repos/asf/continuum/trunk/continuum-webapp-test/src/test/resources/unit/maven-two-projects/missing-connection-element-pom.xml
@@ -45,6 +51,12 @@
 M1_POM_USERNAME=
 M1_POM_PASSWORD=
 
+# Properties for testDeleteMavenOneProject
+M1_DELETE_POM_URL=http://svn.apache.org/repos/asf/continuum/trunk/continuum-webapp-test/src/test/resources/unit/maven-one-projects/valid-project.xml
+M1_DELETE_PROJ_GRP_NAME=Maven One Project
+M1_DELETE_PROJ_GRP_ID=maven-one-project
+M1_DELETE_PROJ_GRP_DESCRIPTION=This is a sample Maven One Project.
+
 M1_MISS_REPO_POM_URL=http://svn.apache.org/repos/asf/continuum/trunk/continuum-webapp-test/src/test/resources/unit/maven-one-projects/missing-repository-element-project.xml
 M1_EXTENDED_POM_URL=http://svn.apache.org/repos/asf/continuum/trunk/continuum-webapp-test/src/test/resources/unit/maven-one-projects/extend-element-project.xml
 M1_UNPARSEABLE_POM_URL=http://svn.apache.org/repos/asf/continuum/trunk/continuum-webapp-test/src/test/resources/unit/maven-one-projects/unparseable-content-project.xml
@@ -84,6 +96,11 @@
 TEST2_PROJ_GRP_ID=Test Project Group 2 Id
 TEST2_PROJ_GRP_DESCRIPTION=Test Project Group 2 Description
 
+# Test properties for testDeleteProjectGroup
+TEST_DELETE_GRP_NAME=Add then Delete Project Group
+TEST_DELETE_GRP_ID=test.delete.project.group
+TEST_DELETE_GRP_DESCRIPTION=Test Delete Project Group Description
+
 ########################
 # notifier group 
 ########################

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MavenOneProjectTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MavenOneProjectTest.java?rev=820614&r1=820613&r2=820614&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MavenOneProjectTest.java
(original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MavenOneProjectTest.java
Thu Oct  1 11:32:19 2009
@@ -152,4 +152,64 @@
         clickButtonWithValue( "Cancel" );
         assertAboutPage();
     }
+
+    @Test( dependsOnMethods = { "testValidPomUrl" } )
+    public void testDeleteMavenOneProject()
+        throws Exception
+    {
+        boolean isExisting = false;
+        String M1_PROJ_GRP_NAME = getProperty( "M1_DELETE_PROJ_GRP_NAME" );
+        goToProjectGroupsSummaryPage();
+        
+        if ( isLinkPresent( M1_PROJ_GRP_NAME ) )
+        {
+            isExisting = true;
+        }
+        else
+        {
+            addMaven1Project( M1_PROJ_GRP_NAME );
+        }
+        
+        // delete project - delete icon
+        clickLinkWithText( M1_PROJ_GRP_NAME );
+        clickLinkWithXPath( "//tbody/tr['0']/td['10']/a/img[@alt='Delete']" );
+        assertTextPresent( "Delete Continuum Project" );
+        clickButtonWithValue( "Delete" );
+        assertPage( "Continuum - Project Group" );
+        assertLinkNotPresent( M1_PROJ_GRP_NAME );
+        
+        // remove group for next test
+        removeProjectGroup( M1_PROJ_GRP_NAME );
+        
+        // delete project - "Delete Project(s)" button
+        addMaven1Project( M1_PROJ_GRP_NAME );
+        clickLinkWithText( M1_PROJ_GRP_NAME );
+        checkField( "//tbody/tr['0']/td['0']/input[@name='selectedProjects']" );
+        clickButtonWithValue( "Delete Project(s)" );
+        assertTextPresent( "Delete Continuum Projects" );
+        clickButtonWithValue( "Delete" );
+        assertPage( "Continuum - Project Group" );
+        assertLinkNotPresent( M1_PROJ_GRP_NAME );
+        
+        if ( !isExisting )
+        {
+            removeProjectGroup( M1_PROJ_GRP_NAME );
+        }
+    }
+    
+    private void addMaven1Project( String groupName )
+        throws Exception
+    {
+        String M1_POM_URL = getProperty( "M1_DELETE_POM_URL" );
+        String M1_POM_USERNAME = getProperty( "M1_POM_USERNAME" );
+        String M1_POM_PASSWORD = getProperty( "M1_POM_PASSWORD" );
+        String M1_PROJ_GRP_ID = getProperty( "M1_DELETE_PROJ_GRP_ID" );
+        String M1_PROJ_GRP_DESCRIPTION = getProperty( "M1_DELETE_PROJ_GRP_DESCRIPTION" );
+        
+        goToAddMavenOneProjectPage();
+        assertLinkNotPresent( groupName );
+        addMavenOneProject( M1_POM_URL, M1_POM_USERNAME, M1_POM_PASSWORD, null, null, true
);
+        goToProjectGroupsSummaryPage();
+        assertLinkPresent( groupName );
+    }
 }

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MavenTwoProjectTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MavenTwoProjectTest.java?rev=820614&r1=820613&r2=820614&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MavenTwoProjectTest.java
(original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MavenTwoProjectTest.java
Thu Oct  1 11:32:19 2009
@@ -162,4 +162,50 @@
         clickButtonWithValue( "Cancel" );
         assertAboutPage();
     }
+    
+    @Test( dependsOnMethods = { "testAddMavenTwoProject" } )
+    public void testDeleteMavenTwoProject()
+        throws Exception
+    {
+        String M2_PROJ_GRP_NAME = getProperty( "M2_DELETE_PROJ_GRP_NAME" );
+        goToProjectGroupsSummaryPage();
+        
+        // delete project - delete icon
+        addMaven2Project( M2_PROJ_GRP_NAME );
+        clickLinkWithText( M2_PROJ_GRP_NAME );
+        clickLinkWithXPath( "//tbody/tr['0']/td['10']/a/img[@alt='Delete']" );
+        assertTextPresent( "Delete Continuum Project" );
+        clickButtonWithValue( "Delete" );
+        assertPage( "Continuum - Project Group" );
+        assertLinkNotPresent( M2_PROJ_GRP_NAME );
+        
+        // remove group for next test
+        removeProjectGroup( M2_PROJ_GRP_NAME );
+        
+        // delete project - "Delete Project(s)" button
+        addMaven2Project( M2_PROJ_GRP_NAME );
+        clickLinkWithText( M2_PROJ_GRP_NAME );
+        checkField( "//tbody/tr['0']/td['0']/input[@name='selectedProjects']" );
+        clickButtonWithValue( "Delete Project(s)" );
+        assertTextPresent( "Delete Continuum Projects" );
+        clickButtonWithValue( "Delete" );
+        assertPage( "Continuum - Project Group" );
+        assertLinkNotPresent( M2_PROJ_GRP_NAME );
+        
+        // remove project group
+        removeProjectGroup( M2_PROJ_GRP_NAME );
+    }
+    
+    private void addMaven2Project( String groupName )
+        throws Exception
+    {
+        String M2_POM_URL = getProperty( "M2_DELETE_POM_URL" );
+        String M2_POM_USERNAME = getProperty( "M2_POM_USERNAME" );
+        String M2_POM_PASSWORD = getProperty( "M2_POM_PASSWORD" );
+        String M2_PROJ_GRP_DESCRIPTION = getProperty( "M2_DELETE_PROJ_GRP_DESCRIPTION" );
+        
+        addMavenTwoProject( M2_POM_URL, M2_POM_USERNAME, M2_POM_PASSWORD, null, true );
+        goToProjectGroupsSummaryPage();
+        assertLinkPresent( groupName );
+    }
 }

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ProjectGroupTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ProjectGroupTest.java?rev=820614&r1=820613&r2=820614&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ProjectGroupTest.java
(original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ProjectGroupTest.java
Thu Oct  1 11:32:19 2009
@@ -139,4 +139,30 @@
         clickButtonWithValue( "Release" );
         assertReleaseSuccess();
     }
+
+    @Test( dependsOnMethods = { "testAddProjectGroup" } )
+    public void testDeleteProjectGroup()
+        throws Exception
+    {
+        String TEST_GRP_NAME = getProperty( "TEST_DELETE_GRP_NAME" );
+        String TEST_GRP_ID = getProperty( "TEST_DELETE_GRP_ID" );
+        String TEST_GRP_DESCRIPTION = getProperty( "TEST_DELETE_GRP_DESCRIPTION" );
+        
+        // delete group - delete icon
+        addProjectGroup( TEST_GRP_NAME, TEST_GRP_ID, TEST_GRP_DESCRIPTION, true );
+        assertLinkPresent( TEST_GRP_NAME );
+        clickLinkWithXPath( "//tbody/tr['0']/td['4']/a/img[@alt='Delete Group']" );
+        assertTextPresent( "Project Group Removal" );
+        clickButtonWithValue( "Delete" );
+        assertProjectGroupsSummaryPage();
+        assertLinkNotPresent( TEST_GRP_NAME );
+        
+        // delete group - "Delete Group" button
+        addProjectGroup( TEST_GRP_NAME, TEST_GRP_ID, TEST_GRP_DESCRIPTION, true );
+        assertLinkPresent( TEST_GRP_NAME );
+        removeProjectGroup( TEST_GRP_NAME );
+        assertLinkNotPresent( TEST_GRP_NAME );
+        assertProjectGroupsSummaryPage();
+        assertLinkNotPresent( TEST_GRP_NAME );
+    }
 }

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=820614&r1=820613&r2=820614&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
Thu Oct  1 11:32:19 2009
@@ -293,6 +293,17 @@
         clickButtonWithValue( "Save" );
         assertProjectGroupsSummaryPage();
     }
+    
+    public void removeProjectGroup( String groupName )
+        throws Exception
+    {
+        goToProjectGroupsSummaryPage();
+        clickLinkWithText( groupName );
+        clickButtonWithValue( "Delete Group" );
+        assertTextPresent( "Project Group Removal" );
+        clickButtonWithValue( "Delete" );
+        assertProjectGroupsSummaryPage();
+    }
 
     public void editProjectGroup(String name,String groupId,String description,String newName,String
newDescription )
         throws Exception



Mime
View raw message