continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r827903 - in /continuum/trunk/continuum-webapp-test/src/test: resources/ testng/config/ testng/org/apache/continuum/web/test/ testng/org/apache/continuum/web/test/parent/
Date Wed, 21 Oct 2009 06:53:24 GMT
Author: ctan
Date: Wed Oct 21 06:53:24 2009
New Revision: 827903

URL: http://svn.apache.org/viewvc?rev=827903&view=rev
Log:
- fixed testDeleteMavenTwoProject
- removed SecurityTest and moved tests to UserRolesManagementTest

Removed:
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/SecurityTest.java
Modified:
    continuum/trunk/continuum-webapp-test/src/test/resources/testng.properties
    continuum/trunk/continuum-webapp-test/src/test/testng/config/testng.xml
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/LoginTest.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/UserRolesManagementTest.java
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractContinuumTest.java
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractUserRolesManagementTest.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=827903&r1=827902&r2=827903&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 21
06:53:24 2009
@@ -275,12 +275,3 @@
 BUILD_AGENT_NAME3 =Third_Agent
 BUILD_AGENT_DESCRIPTION3 =Agent_description3
 BUILD_AGENT_GROUPNAME =agent_groupname
-
-########################
-# security
-########################
-PROJECT_ADMIN_USERNAME=project_admin
-PROJECT_ADMIN_NAME=project_admin_name
-PROJECT_ADMIN_EMAIL=project_admin@something.com
-PROJECT_ADMIN_OLD_PASSWORD=password123
-PROJECT_ADMIN_NEW_PASSWORD=projectadmin123
\ No newline at end of file

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/config/testng.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/config/testng.xml?rev=827903&r1=827902&r2=827903&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/config/testng.xml (original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/config/testng.xml Wed Oct 21 06:53:24
2009
@@ -61,7 +61,6 @@
 				<include name="buildDefinitionTemplate" />
 				<include name="userroles"/>
 				<include name="agent"/>
-				<include name="security" />
 			</run>
 		</groups>
 		<packages>

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/LoginTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/LoginTest.java?rev=827903&r1=827902&r2=827903&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/LoginTest.java
(original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/LoginTest.java
Wed Oct 21 06:53:24 2009
@@ -78,60 +78,7 @@
         assertTextPresent( "You have entered an incorrect username and/or password" );
     }
 
-    @Test( dependsOnMethods = { "testWithEmptyPassword" } )
-    public void testWithCreatedProjectAdminUser()
-    {
-        goToLoginPage();
-        getSelenium().type( "loginForm_username", getProperty( "ADMIN_USERNAME" ) );
-        getSelenium().type( "loginForm_password", getProperty( "ADMIN_PASSWORD" ) );
-        getSelenium().click( "loginForm__login" );
-        getSelenium().waitForPageToLoad( maxWaitTimeInMs );
-
-        clickLinkWithText( "Configuration" );
-        clickLinkWithLocator( "configuration_distributedBuildEnabled", false );
-
-        String username = getProperty( "PROJECT_ADMIN_USERNAME" );
-        String name = getProperty( "PROJECT_ADMIN_NAME" );
-        String email = getProperty( "PROJECT_ADMIN_EMAIL" );
-        String oldPassword = getProperty( "PROJECT_ADMIN_OLD_PASSWORD" );
-        String newPassword = getProperty( "PROJECT_ADMIN_NEW_PASSWORD" );
-
-        createNewUser( username, name, email, oldPassword );
-        assignContinuumRoleToUser( "Continuum Group Project Administrator" );
-        clickButtonWithValue( "Submit" );
-        assertUserCreatedPage();
-        assertLinkPresent( username );
-        assertTextPresent( name );
-        assertTextPresent( email );
-
-        clickLinkWithText( username );
-        assertUserEditPage( username, name, email );
-        assertTextNotPresent( "Last Login:" );
-        assertTextPresent( "Continuum Group Project User" );
-        assertTextPresent( "Continuum Group Project Developer" );
-        assertTextPresent( "Continuum Group Project Administrator" );
-        clickLinkWithText( "Logout" );
-        goToLoginPage();
-
-        getSelenium().type( "loginForm_username", username );
-        getSelenium().type( "loginForm_password", oldPassword );
-        getSelenium().click( "loginForm__login" );
-        getSelenium().waitForPageToLoad( maxWaitTimeInMs );
-        assertChangePasswordPage();
-        
-        getSelenium().type( "passwordForm_existingPassword", oldPassword );
-        getSelenium().type( "passwordForm_newPassword", newPassword );
-        getSelenium().type( "passwordForm_newPasswordConfirm", newPassword );
-        getSelenium().click( "passwordForm__submit" );
-        getSelenium().waitForPageToLoad( maxWaitTimeInMs );
-
-        assertLinkPresent( "Edit Details" );
-        assertLinkPresent( "Logout" );
-        
-        clickLinkWithText( "Logout" );
-    }
-
-    @Test( groups = { "loginSuccess" }, dependsOnMethods = { "testWithCreatedProjectAdminUser"
}, alwaysRun = true )
+    @Test( groups = { "loginSuccess" }, dependsOnMethods = { "testWithEmptyPassword" }, alwaysRun
= true )
     public void testWithCorrectUsernamePassword()
     {
         goToLoginPage();

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=827903&r1=827902&r2=827903&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
Wed Oct 21 06:53:24 2009
@@ -215,6 +215,7 @@
         assertTextPresent( "Delete Continuum Project" );
         clickButtonWithValue( "Delete" );
         assertPage( "Continuum - Project Group" );
+        assertTextNotPresent( "Unable to delete project" );
         assertLinkNotPresent( M2_PROJ_GRP_NAME );
         assertTextNotPresent( M2_PROJ_GRP_SCM_ROOT_URL );
 
@@ -235,6 +236,7 @@
         assertTextPresent( "Delete Continuum Projects" );
         clickButtonWithValue( "Delete" );
         assertPage( "Continuum - Project Group" );
+        assertTextNotPresent( "Unable to delete project" );
         assertLinkNotPresent( M2_PROJ_GRP_NAME );
         assertTextNotPresent( M2_PROJ_GRP_SCM_ROOT_URL );
 

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/UserRolesManagementTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/UserRolesManagementTest.java?rev=827903&r1=827902&r2=827903&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/UserRolesManagementTest.java
(original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/UserRolesManagementTest.java
Wed Oct 21 06:53:24 2009
@@ -31,28 +31,29 @@
 
         createUser( username, fullname, getUserEmail(), getUserRolePassword(), true );
         assertCreatedUserInfo( username );
-        checkUserRoleWithValue( fullname );
-	clickButtonWithValue( "Submit" );
+        //checkUserRoleWithValue( fullname );
+        clickLinkWithLocator( "addRolesToUser_addNDSelectedRoles", false );
+        clickButtonWithValue( "Submit" );
         clickLinkWithText( "Logout" );
 
         login( username, getUserRolePassword() );
         changePassword( getUserRolePassword(), getUserRoleNewPassword() );
-	assertTextPresent( "Password successfully changed" );        
+        //assertTextPresent( "Password successfully changed" );        
         clickLinkWithText( "Logout" );
     }
 
     @Test( dependsOnMethods = { "testAddUserWithGuestRole" } )
     public void testGuestUserRoleFunction()
     {
-	username = getProperty( "GUEST_USERNAME" );
+        username = getProperty( "GUEST_USERNAME" );
         fullname = getProperty( "GUEST_FULLNAME" );
-	login( username, getUserRoleNewPassword() );
-	assertLeftNavMenuWithRole( fullname );
-	goToAboutPage();
-	clickLinkWithText( "Show Project Groups" );
-	assertTextPresent( "Project Groups list is empty" );
-	clickLinkWithText( "Logout" );
-	login( getAdminUsername(), getAdminPassword() );
+        login( username, getUserRoleNewPassword() );
+        assertLeftNavMenuWithRole( fullname );
+        goToAboutPage();
+        clickLinkWithText( "Show Project Groups" );
+        assertTextPresent( "Project Groups list is empty" );
+        clickLinkWithText( "Logout" );
+        login( getAdminUsername(), getAdminPassword() );
     }
 
 
@@ -70,12 +71,12 @@
         createUser( username, fullname, getUserEmail(), getUserRolePassword(), true );
         assertCreatedUserInfo( username );
         checkUserRoleWithValue( fullname );
-	clickButtonWithValue( "Submit" );
+        clickButtonWithValue( "Submit" );
         clickLinkWithText( "Logout" );
 
         login( username, getUserRolePassword() );
         changePassword( getUserRolePassword(), getUserRoleNewPassword() );
-	assertTextPresent( "Password successfully changed" );
+        assertTextPresent( "Password successfully changed" );
 
         clickLinkWithText( "Logout" );
         // assertTextPresent("You are already logged in.");
@@ -84,11 +85,11 @@
     @Test( dependsOnMethods = { "testAddUserWithRegisteredUserRole" } )
     public void testRegisteredRoleFunction()
     {
-	username = getProperty( "REGISTERED_USERNAME" );
+        username = getProperty( "REGISTERED_USERNAME" );
         fullname = getProperty( "REGISTERED_FULLNAME" );
-	login( username, getUserRoleNewPassword() );
+        login( username, getUserRoleNewPassword() );
         assertLeftNavMenuWithRole( fullname );
-	goToAboutPage();
+        goToAboutPage();
         clickLinkWithText( "Show Project Groups" );
         assertTextPresent( "Project Groups list is empty." );
         clickLinkWithText( "Logout" );
@@ -112,13 +113,13 @@
         createUser( username, fullname, getUserEmail(), getUserRolePassword(), true );
         assertCreatedUserInfo( username );
         checkUserRoleWithValue( fullname );
-	clickButtonWithValue( "Submit" );
+        clickButtonWithValue( "Submit" );
 
         clickLinkWithText( "Logout" );
 
         login( username, getUserRolePassword() );
         changePassword( getUserRolePassword(), getUserRoleNewPassword() );
-	assertTextPresent( "Password successfully changed" );
+        assertTextPresent( "Password successfully changed" );
 
         clickLinkWithText( "Logout" );
     }
@@ -126,13 +127,13 @@
     @Test( dependsOnMethods = { "testAddUserWithSystemAdminRole" } )
     public void testSystemAdminRoleFunction()
     {
-	username = getProperty( "SYSAD_USERNAME" );
+	    username = getProperty( "SYSAD_USERNAME" );
         fullname = getProperty( "SYSAD_FULLNAME" );
-	login( username, getUserRoleNewPassword() );
+        login( username, getUserRoleNewPassword() );
         assertLeftNavMenuWithRole( fullname );
         clickLinkWithText( "Show Project Groups" );
         assertTextNotPresent( "Project Groups list is empty." );
-	assertLinkPresent( "Default Project Group" );
+        assertLinkPresent( "Default Project Group" );
 	
         clickLinkWithText( "Logout" );
         login( getAdminUsername(), getAdminPassword() );
@@ -152,14 +153,14 @@
 
         createUser( username, fullname, getUserEmail(), getUserRolePassword(), true );
         assertCreatedUserInfo( username );
-            checkUserRoleWithValue( fullname );
+        checkUserRoleWithValue( fullname );
 		clickButtonWithValue( "Submit" );
 
         clickLinkWithText( "Logout" );
 
         login( username, getUserRolePassword() );
         changePassword( getUserRolePassword(), getUserRoleNewPassword() );
-	assertTextPresent( "Password successfully changed" );
+        assertTextPresent( "Password successfully changed" );
 
         clickLinkWithText( "Logout" );
     }
@@ -167,31 +168,31 @@
     @Test( dependsOnMethods = { "testAddUserWithUserAdminRole" } )
     public void testUserAdminFunction()
     {
-	username = getProperty( "USERADMIN_USERNAME" );
+        username = getProperty( "USERADMIN_USERNAME" );
         fullname = getProperty( "USERADMIN_FULLNAME" );
-	login( username, getUserRoleNewPassword() );
+        login( username, getUserRoleNewPassword() );
         assertLeftNavMenuWithRole( fullname );
         clickLinkWithText( "Show Project Groups" );
         assertTextPresent( "Project Groups list is empty." );
-	// add user
-	clickLinkWithText( "Users" );
-	clickButtonWithValue( "Create New User" );
-	assertCreateUserPage();
-	setFieldValue( "user.username", "guest0" );
+        // add user
+        clickLinkWithText( "Users" );
+        clickButtonWithValue( "Create New User" );
+	    assertCreateUserPage();
+	    setFieldValue( "user.username", "guest0" );
         setFieldValue( "user.fullName", "guest0" );
         setFieldValue( "user.email", "guest0@guest0.com" );
         setFieldValue( "user.password", "pass" );
         setFieldValue( "user.confirmPassword", "pass" );
         submit();
-	assertUserRolesPage( );
+        assertUserRolesPage( );
         clickButtonWithValue( "Submit" );
-	selectValue( "name=ec_rd", "50" );
+        selectValue( "name=ec_rd", "50" );
         waitPage();
-	// delete user	
-	deleteUser( "guest0", "guest0", "guest0@guest0.com" );	
-	// TODO edit user
+        // delete user	
+        deleteUser( "guest0", "guest0", "guest0@guest0.com" );	
+        // TODO edit user
 
-	clickLinkWithText( "Logout" );
+        clickLinkWithText( "Logout" );
         login( getAdminUsername(), getAdminPassword() );
     }
 
@@ -212,41 +213,63 @@
         assertCreatedUserInfo( username );
         checkUserRoleWithValue( fullname );
         clickButtonWithValue( "Submit" );
-	clickLinkWithText( "Logout" );
+
+        // enable distributed build
+        clickLinkWithText( "Configuration" );
+        clickLinkWithLocator( "configuration_distributedBuildEnabled", false );
+        clickButtonWithValue( "Save" );
+
+        clickLinkWithText( "Logout" );
 
         login( username, getUserRolePassword() );
         changePassword( getUserRolePassword(), getUserRoleNewPassword() );
-	assertTextPresent( "Password successfully changed" );
+        assertTextPresent( "Password successfully changed" );
+
+	    assertProjectAdministratorAccess();
+
+        clickLinkWithText( "Logout" );
+
+        login( getAdminUsername(), getAdminPassword() );
+        // disable distributed build
+        clickLinkWithText( "Configuration" );
+        clickLinkWithLocator( "configuration_distributedBuildEnabled", false );
+        clickButtonWithValue( "Save" );
+
+        clickLinkWithText( "Logout" );
+
+        login( username, getUserRoleNewPassword() );
+        assertProjectAdministratorAccess();
+
         clickLinkWithText( "Logout" );
     }
 
     @Test( dependsOnMethods = { "testAddUserWithContinuumGroupProjectAdminRole" } )
     public void testContinuumGroupProjectAdmin_AddProjectGroup() throws Exception
     {
-	username = getProperty( "GROUPPROJECTADMIN_USERNAME" );
+        username = getProperty( "GROUPPROJECTADMIN_USERNAME" );
         fullname = getProperty( "GROUPPROJECTADMIN_FULLNAME" );
-	login( username, getUserRoleNewPassword() );
+        login( username, getUserRoleNewPassword() );
         assertLeftNavMenuWithRole( fullname );
-	clickLinkWithText( "Show Project Groups" );
+        clickLinkWithText( "Show Project Groups" );
         assertTextNotPresent( "Project Groups list is empty." );
-	// test add project group
-	clickButtonWithValue( "Add Project Group" );
-	setFieldValue( "name", "Test Group" );
+        // test add project group
+        clickButtonWithValue( "Add Project Group" );
+        setFieldValue( "name", "Test Group" );
         setFieldValue( "groupId", "Test Group" );
         setFieldValue( "description", "testing project group" );
-	submit();
+        submit();
     }
 
     @Test( dependsOnMethods = { "testContinuumGroupProjectAdmin_AddProjectGroup" } )
     public void testContinuumGroupProjectAdmin_AddProjectToProjectGroup() throws Exception
     {
-	clickLinkWithText( "Test Group" );
-	clickButtonWithValue( "Add" );	
-	assertAddMavenTwoProjectPage();
-	setFieldValue( "m2PomUrl", "https://svn.apache.org/repos/asf/continuum/sandbox/continuum-build-queue-test-data/pom.xml"
);
+        clickLinkWithText( "Test Group" );
+        clickButtonWithValue( "Add" );	
+        assertAddMavenTwoProjectPage();
+        setFieldValue( "m2PomUrl", "https://svn.apache.org/repos/asf/continuum/sandbox/continuum-build-queue-test-data/pom.xml"
);
         clickButtonWithValue( "Add" );
-	String title;
-	boolean success = true;
+        String title;
+        boolean success = true;
         if ( success )
         {
             title = "Continuum - Project Group";
@@ -256,25 +279,25 @@
             title = "Continuum - Add Maven 2 Project";
         }
         waitAddProject( title );
-	assertTextPresent( "ContinuumBuildQueueTestData" );
+        assertTextPresent( "ContinuumBuildQueueTestData" );
     }
     
     @Test( dependsOnMethods = { "testContinuumGroupProjectAdmin_AddProjectToProjectGroup"
} )
     public void testContinuumGroupProjectAdmin_BuildProject() throws Exception
     {
-	buildProjectGroup( "Test Group", "Test Group", "testing project group", "ContinuumBuildQueueTestData"
);
+        buildProjectGroup( "Test Group", "Test Group", "testing project group", "ContinuumBuildQueueTestData"
);
     }
 
     @Test( dependsOnMethods = { "testContinuumGroupProjectAdmin_BuildProject" } )
     public void testContinuumGroupProjectAdmin_AssignUserToAGroup()
     {
-	clickLinkWithText( "Users" );
-	clickLinkWithText( "guest1" );
-	clickLinkWithText( "Edit Roles" );
-	checkUserRoleWithValue( "Guest" );
-	checkResourceRoleWithValue( "Project Developer - Test Group" );
-	submit();
-	clickLinkWithText( "Logout" );
+        clickLinkWithText( "Users" );
+        clickLinkWithText( "guest1" );
+        clickLinkWithText( "Edit Roles" );
+        checkUserRoleWithValue( "Guest" );
+        checkResourceRoleWithValue( "Project Developer - Test Group" );
+        submit();
+        clickLinkWithText( "Logout" );
         login( getAdminUsername(), getAdminPassword() );
     }
 
@@ -334,12 +357,12 @@
         createUser( username, fullname, getUserEmail(), getUserRolePassword(), true );
         assertCreatedUserInfo( username );
         checkUserRoleWithValue( fullname );
-	clickButtonWithValue( "Submit" );
+        clickButtonWithValue( "Submit" );
         clickLinkWithText( "Logout" );
 
         login( username, getUserRolePassword() );
         changePassword( getUserRolePassword(), getUserRoleNewPassword() );
-	assertTextPresent( "Password successfully changed" );
+        assertTextPresent( "Password successfully changed" );
         clickLinkWithText( "Logout" );
 
         login( username, getUserRoleNewPassword() );
@@ -357,12 +380,12 @@
         createUser( username, fullname, getUserEmail(), getUserRolePassword(), true );
         assertCreatedUserInfo( username );
         checkUserRoleWithValue( fullname );
-	clickButtonWithValue( "Submit" );
+        clickButtonWithValue( "Submit" );
         clickLinkWithText( "Logout" );
 
         login( username, getUserRolePassword() );
         changePassword( getUserRolePassword(), getUserRoleNewPassword() );
-	assertTextPresent( "Password successfully changed" );
+        assertTextPresent( "Password successfully changed" );
         clickLinkWithText( "Logout" );
 
         login( username, getUserRoleNewPassword() );
@@ -380,12 +403,12 @@
         createUser( username, fullname, getUserEmail(), getUserRolePassword(), true );
         assertCreatedUserInfo( username );
         checkUserRoleWithValue( fullname );
-	clickButtonWithValue( "Submit" );
+        clickButtonWithValue( "Submit" );
         clickLinkWithText( "Logout" );
 
         login( username, getUserRolePassword() );
         changePassword( getUserRolePassword(), getUserRoleNewPassword() );
-	assertTextPresent( "Password successfully changed" );	
+        assertTextPresent( "Password successfully changed" );	
         clickLinkWithText( "Logout" );
 
         login( username, getUserRoleNewPassword() );
@@ -403,12 +426,12 @@
         createUser( username, fullname, getUserEmail(), getUserRolePassword(), true );
         assertCreatedUserInfo( username );
         checkUserRoleWithValue( fullname );
-	clickButtonWithValue( "Submit" );
+        clickButtonWithValue( "Submit" );
         clickLinkWithText( "Logout" );
 
         login( username, getUserRolePassword() );
         changePassword( getUserRolePassword(), getUserRoleNewPassword() );
-	assertTextPresent( "Password successfully changed" );
+        assertTextPresent( "Password successfully changed" );
         clickLinkWithText( "Logout" );
 
         login( username, getUserRoleNewPassword() );
@@ -426,12 +449,12 @@
         createUser( username, fullname, getUserEmail(), getUserRolePassword(), true );
         assertCreatedUserInfo( username );
         checkUserRoleWithValue( fullname );
-	clickButtonWithValue( "Submit" );
+        clickButtonWithValue( "Submit" );
         clickLinkWithText( "Logout" );
 
         login( username, getUserRolePassword() );
         changePassword( getUserRolePassword(), getUserRoleNewPassword() );
-	assertTextPresent( "Password successfully changed" );
+        assertTextPresent( "Password successfully changed" );
         clickLinkWithText( "Logout" );
 
         login( username, getUserRoleNewPassword() );
@@ -449,12 +472,12 @@
         createUser( username, fullname, getUserEmail(), getUserRolePassword(), true );
         assertCreatedUserInfo( username );
         checkUserRoleWithValue( fullname );
-	clickButtonWithValue( "Submit" );
+        clickButtonWithValue( "Submit" );
         clickLinkWithText( "Logout" );
 
         login( username, getUserRolePassword() );
         changePassword( getUserRolePassword(), getUserRoleNewPassword() );
-	assertTextPresent( "Password successfully changed" );
+        assertTextPresent( "Password successfully changed" );
         clickLinkWithText( "Logout" );
 
         login( username, getUserRoleNewPassword() );
@@ -472,12 +495,12 @@
         createUser( username, fullname, getUserEmail(), getUserRolePassword(), true );
         assertCreatedUserInfo( username );
         checkUserRoleWithValue( fullname );
-	clickButtonWithValue( "Submit" );
+        clickButtonWithValue( "Submit" );
         clickLinkWithText( "Logout" );
 
         login( username, getUserRolePassword() );
         changePassword( getUserRolePassword(), getUserRoleNewPassword() );
-	assertTextPresent( "Password successfully changed" );
+        assertTextPresent( "Password successfully changed" );
         clickLinkWithText( "Logout" );
 
         login( username, getUserRoleNewPassword() );
@@ -495,12 +518,12 @@
         createUser( username, fullname, getUserEmail(), getUserRolePassword(), true );
         assertCreatedUserInfo( username );
         checkUserRoleWithValue( fullname );
-	clickButtonWithValue( "Submit" );
+	    clickButtonWithValue( "Submit" );
         clickLinkWithText( "Logout" );
 
         login( username, getUserRolePassword() );
         changePassword( getUserRolePassword(), getUserRoleNewPassword() );
-	assertTextPresent( "Password successfully changed" );
+        assertTextPresent( "Password successfully changed" );
         clickLinkWithText( "Logout" );
 
         login( username, getUserRoleNewPassword() );
@@ -518,12 +541,12 @@
         createUser( username, fullname, getUserEmail(), getUserRolePassword(), true );
         assertCreatedUserInfo( username );
         checkUserRoleWithValue( fullname );
-	clickButtonWithValue( "Submit" );
+        clickButtonWithValue( "Submit" );
         clickLinkWithText( "Logout" );
 
         login( username, getUserRolePassword() );
         changePassword( getUserRolePassword(), getUserRoleNewPassword() );
-	assertTextPresent( "Password successfully changed" );
+        assertTextPresent( "Password successfully changed" );
         clickLinkWithText( "Logout" );
 
         login( username, getUserRoleNewPassword() );
@@ -541,12 +564,12 @@
         createUser( username, fullname, getUserEmail(), getUserRolePassword(), true );
         assertCreatedUserInfo( username );
         checkResourceRoleWithValue( fullname );
-	clickButtonWithValue( "Submit" );
+        clickButtonWithValue( "Submit" );
         clickLinkWithText( "Logout" );
 
         login( username, getUserRolePassword() );
         changePassword( getUserRolePassword(), getUserRoleNewPassword() );
-	assertTextPresent( "Password successfully changed" );
+        assertTextPresent( "Password successfully changed" );
         clickLinkWithText( "Logout" );
 
         login( username, getUserRoleNewPassword() );
@@ -564,12 +587,12 @@
         createUser( username, fullname, getUserEmail(), getUserRolePassword(), true );
         assertCreatedUserInfo( username );
         checkResourceRoleWithValue( fullname );
-	clickButtonWithValue( "Submit" );
+        clickButtonWithValue( "Submit" );
         clickLinkWithText( "Logout" );
 
         login( username, getUserRolePassword() );
         changePassword( getUserRolePassword(), getUserRoleNewPassword() );
-	assertTextPresent( "Password successfully changed" );
+        assertTextPresent( "Password successfully changed" );
         clickLinkWithText( "Logout" );
 
         login( username, getUserRoleNewPassword() );
@@ -587,12 +610,12 @@
         createUser( username, fullname, getUserEmail(), getUserRolePassword(), true );
         assertCreatedUserInfo( username );
         checkResourceRoleWithValue( fullname );
-	clickButtonWithValue( "Submit" );
+        clickButtonWithValue( "Submit" );
         clickLinkWithText( "Logout" );
 
         login( username, getUserRolePassword() );
         changePassword( getUserRolePassword(), getUserRoleNewPassword() );
-	assertTextPresent( "Password successfully changed" );
+        assertTextPresent( "Password successfully changed" );
         clickLinkWithText( "Logout" );
 
         login( username, getUserRoleNewPassword() );

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=827903&r1=827902&r2=827903&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 21 06:53:24 2009
@@ -855,7 +855,7 @@
     {
         int currentIt = 1;
         int maxIt = 10;
-        while ( isElementPresent( "//img[@alt='Checking Out']" ) || isElementPresent( "//img[@alt='Updating']")
)
+        while ( isElementPresent( "//img[@alt='Checking Out']" ) )
         {
             Thread.sleep( 10000 );
             getSelenium().refresh();
@@ -866,7 +866,6 @@
             }
             currentIt++;
         }
-        Thread.sleep( 10000 );
     }
 
     public void createNewUser( String username, String name, String email, String password
)
@@ -902,27 +901,4 @@
         assertLinkPresent( "admin" );
         assertLinkPresent( "guest" );
     }
-
-    public void assertProjectAdministratorAccess()
-    {
-        assertLinkPresent( "About" );
-        assertLinkPresent( "Show Project Groups" );
-        assertLinkPresent( "Maven 2.0.x Project" );
-        assertLinkPresent( "Maven 1.x Project" );
-        assertLinkPresent( "Ant Project" );
-        assertLinkPresent( "Shell Project" );
-        assertLinkPresent( "Schedules" );
-        assertLinkPresent( "Queues" );
-        assertLinkPresent( "Users" );
-        assertLinkPresent( "Roles" );
-        assertLinkNotPresent( "Local Repositories" );
-        assertLinkNotPresent( "Purge Configurations" );
-        assertLinkNotPresent( "Installations" );
-        assertLinkNotPresent( "Build Environments" );
-        assertLinkNotPresent( "Build Definition Templates" );
-        assertLinkNotPresent( "Configuration" );
-        assertLinkNotPresent( "Appearance" );
-        assertLinkNotPresent( "Build Queue" );
-        assertLinkNotPresent( "Build Agent" );
-    }
 }

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractUserRolesManagementTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractUserRolesManagementTest.java?rev=827903&r1=827902&r2=827903&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractUserRolesManagementTest.java
(original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractUserRolesManagementTest.java
Wed Oct 21 06:53:24 2009
@@ -198,13 +198,13 @@
     		for( String navmenu : arrayNavMenu )
     			assertLinkPresent( navmenu );
     	}
-	else if( role == "Project Administrator - Default Project Group" )
-	{
+    	else if( role == "Project Administrator - Default Project Group" )
+    	{
     		String navMenu = "About,Show Project Groups,Queues,Users,Roles";
     		String[] arrayNavMenu = navMenu.split( "," );
     		for( String navmenu : arrayNavMenu )
     			assertLinkPresent( navmenu );
-	}
+    	}
     	else if( role == "Project Developer - Default Project Group" || role == "Project User
- Default Project Group" )
     	{
     		String navMenu = "About,Show Project Groups,Queues";
@@ -224,14 +224,37 @@
 
 	}
 
-	public void assertDeleteUserPage( String username )
-	 {
-	        assertPage( "[Admin] User Delete" ); //TODO
-	        assertTextPresent( "[Admin] User Delete" );
-	        assertTextPresent( "The following user will be deleted:" );
-	        assertTextPresent( "Username: " + username );
-	        assertButtonWithValuePresent( "Delete User" );
-	 }
+    public void assertDeleteUserPage( String username )
+    {
+        assertPage( "[Admin] User Delete" ); //TODO
+        assertTextPresent( "[Admin] User Delete" );
+        assertTextPresent( "The following user will be deleted:" );
+        assertTextPresent( "Username: " + username );
+        assertButtonWithValuePresent( "Delete User" );
+    }
+
+	public void assertProjectAdministratorAccess()
+    {
+        assertLinkPresent( "About" );
+        assertLinkPresent( "Show Project Groups" );
+        assertLinkPresent( "Maven 2.0.x Project" );
+        assertLinkPresent( "Maven 1.x Project" );
+        assertLinkPresent( "Ant Project" );
+        assertLinkPresent( "Shell Project" );
+        assertLinkPresent( "Schedules" );
+        assertLinkPresent( "Queues" );
+        assertLinkPresent( "Users" );
+        assertLinkPresent( "Roles" );
+        assertLinkNotPresent( "Local Repositories" );
+        assertLinkNotPresent( "Purge Configurations" );
+        assertLinkNotPresent( "Installations" );
+        assertLinkNotPresent( "Build Environments" );
+        assertLinkNotPresent( "Build Definition Templates" );
+        assertLinkNotPresent( "Configuration" );
+        assertLinkNotPresent( "Appearance" );
+        assertLinkNotPresent( "Build Queue" );
+        assertLinkNotPresent( "Build Agent" );
+    }
 
 	/////////////////////////////////////////
 	// User Roles Management
@@ -279,74 +302,74 @@
 	}
 
 
-	 public void login( String username, String password )
-	    {
-	        login( username, password, true, "Login Page" );
-	    }
+	public void login( String username, String password )
+	{
+	    login( username, password, true, "Login Page" );
+	}
 
-		public void login( String username, String password, boolean valid, String assertReturnPage
)
+    public void login( String username, String password, boolean valid, String assertReturnPage
)
+	{
+        if ( isLinkPresent( "Login" ) )
 	    {
-	        if ( isLinkPresent( "Login" ) )
-	        {
-	            goToLoginPage();
+            goToLoginPage();
 
-	            submitLoginPage( username, password, false, valid, assertReturnPage );
-	        }
+            submitLoginPage( username, password, false, valid, assertReturnPage );
 	    }
+    }
 
-		public void submitLoginPage( String username, String password )
-	    {
-	        submitLoginPage( username, password, false, true, "Login Page" );
-	    }
+    public void submitLoginPage( String username, String password )
+    {
+        submitLoginPage( username, password, false, true, "Login Page" );
+    }
 
-	    public void submitLoginPage( String username, String password, boolean validUsernamePassword
)
-	    {
-	        submitLoginPage( username, password, false, validUsernamePassword, "Login Page"
);
-	    }
+    public void submitLoginPage( String username, String password, boolean validUsernamePassword
)
+    {
+        submitLoginPage( username, password, false, validUsernamePassword, "Login Page" );
+    }
 
-	    public void submitLoginPage( String username, String password, boolean rememberMe, boolean
validUsernamePassword,
+    public void submitLoginPage( String username, String password, boolean rememberMe, boolean
validUsernamePassword,
                                  String assertReturnPage )
-	    {
-	        assertLoginPage();
-	        setFieldValue( "username", username );
-	        setFieldValue( "password", password );
-	        if ( rememberMe )
-	        {
-	            checkField( "rememberMe" );
-	        }
-	        clickButtonWithValue( "Login" );
-
-	        if ( validUsernamePassword )
-	        {
-	            assertTextPresent( "Current User:" );
-	            assertTextPresent( username );
-	            assertLinkPresent( "Edit Details" );
-	            assertLinkPresent( "Logout" );
-	        }
-	        else
-	        {
-	            if ( "Login Page".equals( assertReturnPage ) )
-	            {
-	                assertLoginPage();
-	            }
-	            else
-	            {
-	                assertPage( assertReturnPage );
-	            }
-	        }
-	    }
+    {
+        assertLoginPage();
+        setFieldValue( "username", username );
+        setFieldValue( "password", password );
+        if ( rememberMe )
+        {
+            checkField( "rememberMe" );
+        }
+        clickButtonWithValue( "Login" );
+
+        if ( validUsernamePassword )
+        {
+            assertTextPresent( "Current User:" );
+            assertTextPresent( username );
+            assertLinkPresent( "Edit Details" );
+            assertLinkPresent( "Logout" );
+        }
+        else
+        {
+            if ( "Login Page".equals( assertReturnPage ) )
+            {
+                assertLoginPage();
+            }
+            else
+            {
+                assertPage( assertReturnPage );
+            }
+        }
+    }
 
 	public void deleteUser( String userName, String fullName, String emailAdd )
     {
         deleteUser( userName, fullName, emailAdd, false, false );
     }
 
-	public void deleteUser( String userName, String fullName, String emailAd, boolean validated,
boolean locked )
-	{
-		//clickLinkWithText( "userlist" );
-		clickLinkWithXPath( "//table[@id='ec_table']/tbody[2]/tr[3]/td[7]/a/img" );
-		assertDeleteUserPage( userName );
+    public void deleteUser( String userName, String fullName, String emailAd, boolean validated,
boolean locked )
+    {
+	    //clickLinkWithText( "userlist" );
+        clickLinkWithXPath( "//table[@id='ec_table']/tbody[2]/tr[3]/td[7]/a/img" );
+        assertDeleteUserPage( userName );
         submit();
         assertElementNotPresent( userName );
-	}
+    }
 }



Mime
View raw message