continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r825340 - in /continuum/trunk/continuum-webapp-test/src/test: resources/testng.properties testng/org/apache/continuum/web/test/ProjectGroupTest.java testng/org/apache/continuum/web/test/parent/AbstractContinuumTest.java
Date Wed, 14 Oct 2009 23:21:57 GMT
Author: ctan
Date: Wed Oct 14 23:21:56 2009
New Revision: 825340

URL: http://svn.apache.org/viewvc?rev=825340&view=rev
Log:
[CONTINUUM-2387] added selenium test

Modified:
    continuum/trunk/continuum-webapp-test/src/test/resources/testng.properties
    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=825340&r1=825339&r2=825340&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/resources/testng.properties (original)
+++ continuum/trunk/continuum-webapp-test/src/test/resources/testng.properties Wed Oct 14
23:21:56 2009
@@ -101,6 +101,14 @@
 TEST_DELETE_GRP_ID=test.delete.project.group
 TEST_DELETE_GRP_DESCRIPTION=Test Delete Project Group Description
 
+# Test properties for testProjectGroupMembers
+TEST_PROJ_GRP_NAME_ONE=Group
+TEST_PROJ_GRP_ID_ONE=Group Id
+TEST_PROJ_GRP_DESCRIPTION_ONE=Project group for members test
+TEST_PROJ_GRP_NAME_TWO=Group-Two
+TEST_PROJ_GRP_ID_TWO=Group Id Two
+TEST_PROJ_GRP_DESCRIPTION_TWO=Project group two for members test
+
 ########################
 # notifier group 
 ########################

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=825340&r1=825339&r2=825340&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
Wed Oct 14 23:21:56 2009
@@ -165,4 +165,40 @@
         assertProjectGroupsSummaryPage();
         assertLinkNotPresent( TEST_GRP_NAME );
     }
+
+    public void testProjectGroupMembers()
+        throws Exception
+    {
+        String GRP_NAME_ONE = getProperty( "TEST_PROJ_GRP_NAME_ONE" );
+        String GRP_ID_ONE = getProperty( "TEST_PROJ_GRP_ID_ONE" );
+        String GRP_DESCRIPTION_ONE = getProperty( "TEST_PROJ_GRP_DESCRIPTION_ONE" );
+        String GRP_NAME_TWO = getProperty( "TEST_PROJ_GRP_NAME_TWO" );
+        String GRP_ID_TWO = getProperty( "TEST_PROJ_GRP_ID_TWO" );
+        String GRP_DESCRIPTION_TWO = getProperty( "TEST_PROJ_GRP_DESCRIPTION_TWO" );
+
+        addProjectGroup( GRP_NAME_ONE, GRP_ID_ONE, GRP_DESCRIPTION_ONE, true );
+        assertLinkPresent( GRP_NAME_ONE );
+
+        addProjectGroup( GRP_NAME_TWO, GRP_ID_TWO, GRP_DESCRIPTION_TWO, true );
+        assertLinkPresent( GRP_NAME_TWO );
+
+        createAndAddUserAsDeveloperToGroup( "username1", "user1", "user1@something.com",
"password123", GRP_NAME_ONE );
+        createAndAddUserAsDeveloperToGroup( "username2", "user2", "user2@something.com",
"password123", GRP_NAME_ONE );
+        createAndAddUserAsDeveloperToGroup( "username3", "user3", "user3@something.com",
"password123", GRP_NAME_TWO );
+
+        showMembers( GRP_NAME_ONE, GRP_ID_ONE, GRP_DESCRIPTION_ONE );
+        assertUserPresent( "username1", "user1", "user1@something.com" );
+        assertUserPresent( "username2", "user2", "user2@something.com" );
+        assertUserNotPresent( "username3", "user3", "user3@something.com" );
+
+        showMembers( GRP_NAME_TWO, GRP_ID_TWO, GRP_DESCRIPTION_TWO );
+        assertUserNotPresent( "username1", "user1", "user1@something.com" );
+        assertUserNotPresent( "username2", "user2", "user2@something.com" );
+        assertUserPresent( "username3", "user3", "user3@something.com" );
+
+        removeProjectGroup( GRP_NAME_ONE );
+        assertLinkNotPresent( GRP_NAME_ONE );
+        removeProjectGroup( GRP_NAME_TWO );
+        assertLinkNotPresent( GRP_NAME_TWO );
+    }
 }

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=825340&r1=825339&r2=825340&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 Oct 14 23:21:56 2009
@@ -771,4 +771,49 @@
         String t = getTitle();
         Assert.assertTrue( t.contains( title ) );
     }
+
+    public void createAndAddUserAsDeveloperToGroup( String username, String name, String
email, String password, String groupName )
+    {
+        clickLinkWithText( "Users" );
+        assertPage( "[Admin] User List" );
+        assertTextNotPresent( username );
+        clickButtonWithValue( "Create New User" );
+        assertPage( "[Admin] User Create" );
+        setFieldValue( "user.fullName", name );
+        setFieldValue( "user.username", username );
+        setFieldValue( "user.email", email );
+        setFieldValue( "user.password", password );
+        setFieldValue( "user.confirmPassword", password );
+        clickButtonWithValue( "Create User" );
+        assertPage( "[Admin] User Edit" );
+        clickLinkWithXPath( "//input[@name='addDSelectedRoles' and @value='Project Developer
- " + groupName + "']", false );
+        clickButtonWithValue( "Submit" );
+        assertPage( "[Admin] User List" );
+        assertTextPresent( username );
+        assertTextPresent( name );
+        assertTextPresent( email );
+    }
+
+    public void showMembers( String name, String groupId, String description )
+        throws Exception
+    {
+        showProjectGroup( name, groupId, description );
+        clickLinkWithText( "Members" );
+        assertTextPresent( "Member Projects of " + name + " group" );
+        assertTextPresent( "Users" );
+    }
+
+    public void assertUserPresent( String username, String name, String email )
+    {
+        assertTextPresent( username );
+        assertTextPresent( name );
+        assertTextPresent( email );
+    }
+
+    public void assertUserNotPresent( String username, String name, String email )
+    {
+        assertTextNotPresent( username );
+        assertTextNotPresent( name );
+        assertTextNotPresent( email );
+    }
 }



Mime
View raw message