continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1549380 - in /continuum/branches/CONTINUUM-2713/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test: BuildEnvironmentTest.java NotifierTest.java ProjectGroupTest.java
Date Mon, 09 Dec 2013 04:37:09 GMT
Author: brett
Date: Mon Dec  9 04:37:08 2013
New Revision: 1549380

URL: http://svn.apache.org/r1549380
Log:
improve test repeatability

Modified:
    continuum/branches/CONTINUUM-2713/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildEnvironmentTest.java
    continuum/branches/CONTINUUM-2713/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/NotifierTest.java
    continuum/branches/CONTINUUM-2713/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ProjectGroupTest.java

Modified: continuum/branches/CONTINUUM-2713/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildEnvironmentTest.java
URL: http://svn.apache.org/viewvc/continuum/branches/CONTINUUM-2713/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildEnvironmentTest.java?rev=1549380&r1=1549379&r2=1549380&view=diff
==============================================================================
--- continuum/branches/CONTINUUM-2713/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildEnvironmentTest.java
(original)
+++ continuum/branches/CONTINUUM-2713/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildEnvironmentTest.java
Mon Dec  9 04:37:08 2013
@@ -35,6 +35,10 @@ public class BuildEnvironmentTest
 
     public static final String INSTALLATION_NAME = "varForBuildEnv";
 
+    private static final String INSTALLATION_BUILD_ENV = "installationBuildEnv";
+
+    private static final String NEW_BUILD_ENV = "NEW_BUILD_ENV";
+
     private String buildEnvName;
 
     @BeforeClass(alwaysRun = true)
@@ -92,6 +96,8 @@ public class BuildEnvironmentTest
     @Test( dependsOnMethods = { "testAddBuildEnvironment" })
     public void testAddInstallationToBuildEnvironment()
     {
+        addBuildEnvironment( INSTALLATION_BUILD_ENV, new String[]{ }, true );
+
         goToInstallationPage();
         if ( !isTextPresent( INSTALLATION_NAME ) )
         {
@@ -99,14 +105,14 @@ public class BuildEnvironmentTest
             addInstallation( INSTALLATION_NAME, "VAR_BUILD_ENV", "var_value", false, false,
true );
         }
 
-        goToEditBuildEnvironment( buildEnvName );
-        editBuildEnvironment( buildEnvName, new String[] { INSTALLATION_NAME }, true );
+        goToEditBuildEnvironment( INSTALLATION_BUILD_ENV );
+        editBuildEnvironment( INSTALLATION_BUILD_ENV, new String[] { INSTALLATION_NAME },
true );
     }
 
     @Test( dependsOnMethods = { "testAddInstallationToBuildEnvironment" })
     public void testEditInstallationOnBuildEnvironment()
     {
-        goToEditBuildEnvironment( buildEnvName );
+        goToEditBuildEnvironment( INSTALLATION_BUILD_ENV );
         clickLinkWithText( INSTALLATION_NAME );
         assertEditInstallationVariablePage();
         assert INSTALLATION_NAME.equals( getFieldValue( "installation.name" ) );
@@ -115,10 +121,10 @@ public class BuildEnvironmentTest
     @Test( dependsOnMethods = { "testEditInstallationOnBuildEnvironment" })
     public void testRemoveInstallationOnBuildEnvironment()
     {
-        goToEditBuildEnvironment( buildEnvName );
+        goToEditBuildEnvironment( INSTALLATION_BUILD_ENV );
         assertLinkPresent( INSTALLATION_NAME );
         clickImgWithAlt( "Delete" );
-        assertEditBuildEnvironmentPage( buildEnvName );
+        assertEditBuildEnvironmentPage( INSTALLATION_BUILD_ENV );
         assertLinkNotPresent( INSTALLATION_NAME );
     }
 
@@ -132,10 +138,9 @@ public class BuildEnvironmentTest
     @Test( dependsOnMethods = { "testAddBuildEnvironment" } )
     public void testEditDuplicatedBuildEnvironmentParallelBuilds()
     {
-        String newName = "NEW_BUILD_ENV";
         goToAddBuildEnvironment();
-        addBuildEnvironment( newName, new String[]{ }, true );
-        goToEditBuildEnvironment( newName );
+        addBuildEnvironment( NEW_BUILD_ENV, new String[]{ }, true );
+        goToEditBuildEnvironment( NEW_BUILD_ENV );
         editBuildEnvironment( buildEnvName, new String[]{ }, false );
         assertTextPresent( "A Build Environment with the same name already exists" );
     }
@@ -170,5 +175,7 @@ public class BuildEnvironmentTest
     public void tearDown()
     {
         removeBuildEnvironment( buildEnvName, false );
+        removeBuildEnvironment( INSTALLATION_BUILD_ENV, false );
+        removeBuildEnvironment( NEW_BUILD_ENV, false );
     }
 }

Modified: continuum/branches/CONTINUUM-2713/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/NotifierTest.java
URL: http://svn.apache.org/viewvc/continuum/branches/CONTINUUM-2713/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/NotifierTest.java?rev=1549380&r1=1549379&r2=1549380&view=diff
==============================================================================
--- continuum/branches/CONTINUUM-2713/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/NotifierTest.java
(original)
+++ continuum/branches/CONTINUUM-2713/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/NotifierTest.java
Mon Dec  9 04:37:08 2013
@@ -573,6 +573,8 @@ public class NotifierTest
     public void testDeleteProjectNotifierFromGroupNotifierPage()
         throws Exception
     {
+        String mailNotifierAddress = "testDeleteProjectNotifierFromGroupNotifierPage@test.com";
+
         goToProjectGroupsSummaryPage();
         goToProjectNotifier( projectGroupName, projectName );
         addMailNotifier( projectGroupName, projectName, mailNotifierAddress, true );
@@ -582,7 +584,7 @@ public class NotifierTest
         assertGroupNotifierPage( projectGroupName );
 
         // Delete
-        clickLinkWithXPath( "(//a[contains(@href,'deleteProjectNotifier')])/img" );
+        clickLinkWithXPath( "//preceding::td[text()='" + mailNotifierAddress + "']//following::img[@alt='Delete']"
);
         assertButtonWithValuePresent( "Delete" );
         assertButtonWithValuePresent( "Cancel" );
         clickButtonWithValue( "Delete" );

Modified: continuum/branches/CONTINUUM-2713/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ProjectGroupTest.java
URL: http://svn.apache.org/viewvc/continuum/branches/CONTINUUM-2713/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ProjectGroupTest.java?rev=1549380&r1=1549379&r2=1549380&view=diff
==============================================================================
--- continuum/branches/CONTINUUM-2713/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ProjectGroupTest.java
(original)
+++ continuum/branches/CONTINUUM-2713/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ProjectGroupTest.java
Mon Dec  9 04:37:08 2013
@@ -234,15 +234,18 @@ public class ProjectGroupTest
     public void testRemoveProjectFromMembers()
     {
         goToProjectGroupsSummaryPage();
-        addProjectGroup( projectGroupName, projectGroupId, projectGroupDescription, true
);
+        addProjectGroup( projectGroupName, projectGroupId, projectGroupDescription, true,
false );
         showProjectGroup( projectGroupName, projectGroupId, projectGroupDescription );
 
-        clickButtonWithValue( "Add" );
-        assertAddMavenTwoProjectPage();
-        setFieldValue( "m2PomUrl", getProperty( "M2_POM_URL" ) );
-        clickButtonWithValue( "Add" );
-        waitAddProject( "Continuum - Project Group" );
-        assertTextPresent( TEST_PROJECT_NAME );
+        if ( !isLinkPresent( TEST_PROJECT_NAME ) )
+        {
+            clickButtonWithValue( "Add" );
+            assertAddMavenTwoProjectPage();
+            setFieldValue( "m2PomUrl", getProperty( "M2_POM_URL" ) );
+            clickButtonWithValue( "Add" );
+            waitAddProject( "Continuum - Project Group" );
+            assertTextPresent( TEST_PROJECT_NAME );
+        }
 
         clickLinkWithText( "Members" );
         assertTextPresent( TEST_PROJECT_NAME );



Mime
View raw message