continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From och...@apache.org
Subject svn commit: r531425 - in /maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test: AbstractContinuumTestCase.java AddMavenTwoProjectTest.java AntTest.java ProjectGroupTest.java SchedulesPageTest.java
Date Mon, 23 Apr 2007 10:54:52 GMT
Author: oching
Date: Mon Apr 23 03:54:47 2007
New Revision: 531425

URL: http://svn.apache.org/viewvc?view=rev&rev=531425
Log:
CONTINUUM-1237 Applied patch submitted by Teodoro Cue - additional web UI tests

Modified:
    maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AbstractContinuumTestCase.java
    maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AddMavenTwoProjectTest.java
    maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AntTest.java
    maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/ProjectGroupTest.java
    maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/SchedulesPageTest.java

Modified: maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AbstractContinuumTestCase.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AbstractContinuumTestCase.java?view=diff&rev=531425&r1=531424&r2=531425
==============================================================================
--- maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AbstractContinuumTestCase.java
(original)
+++ maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AbstractContinuumTestCase.java
Mon Apr 23 03:54:47 2007
@@ -46,6 +46,10 @@
 
     public final static String TEST_POM_PASSWORD = "dummy";
 
+    public static final String TEST_PROJECT_GROUP_NAME = "Apache Maven";
+
+    public static final String TEST_PROJECT_NAME = "Apache Maven";
+
     protected void postAdminUserCreation()
     {
         assertEditConfigurationPage();
@@ -76,6 +80,24 @@
     }
 
     //////////////////////////////////////
+    // About
+    //////////////////////////////////////
+    public void goToAboutPage()
+    {
+        clickLinkWithText( "About" );
+
+        assertAboutPage();
+    }
+
+    public void assertAboutPage()
+    {
+        assertPage( "Continuum - About" );
+        assertTextPresent( "About Continuum" );
+        assertTextPresent( "Version:" );
+        assertTextPresent( "1.1-SNAPSHOT" );
+    }
+
+    //////////////////////////////////////
     // Configuration
     //////////////////////////////////////
     public void assertEditConfigurationPage()
@@ -264,7 +286,512 @@
 
         // Confirm Project Group deletion
         clickSubmitWithLocator( "removeProjectGroup_0" );
+    }
+
+    public void editProjectGroup( String name, String groupId, String description, String
newName, String newDescription )
+        throws Exception
+    {
+        showProjectGroup( name, groupId, description );
+        clickButtonWithValue( "Edit" );
+        assertEditGroupPage( groupId );
+        setFieldValue( "saveProjectGroup_name", newName );
+        setFieldValue( "saveProjectGroup_description", newDescription );
+        clickButtonWithValue( "Save" );
+    }
+
+    public void assertEditGroupPage( String groupId ) throws Exception
+    {
+        assertPage( "Continuum - Update Project Group" );
+        assertTextPresent( "Update Project Group" );
+        assertTextPresent( "Project Group Name" );
+        assertElementPresent( "saveProjectGroup_name" );
+        assertTextPresent( "Project Group Id" );
+        assertTextPresent( groupId );
+        assertTextPresent( "Description" );
+        assertElementPresent( "saveProjectGroup_description" );
+
+        // Assert Projects actions
+        assertTextPresent( "Projects" );
+        assertTextPresent( "Project Name" );
+        assertTextPresent( "Move to Group" );
+
+        assertElementPresent( "saveProjectGroup_0" );
+        assertElementPresent( "Cancel" );
+    }
+
+    public void buildProjectGroup( String projectGroupName, String groupId, String description
) throws Exception
+    {
+        int tries = 0, maxTries = 100;
+
+        showProjectGroup( projectGroupName, groupId, description );
+        clickButtonWithValue( "Build" );
+
+        // make sure build will be completed
+        while ( isElementPresent( "//img[@alt='Updating sources']" ) )
+        {
+            Thread.sleep( 5000 );
+            showProjectGroup( projectGroupName, groupId, description );
+
+            if ( tries++ >= maxTries )
+            {
+                assertTrue( "Max tries waiting for the project to build reached.", false
);
+            }
+        }
+        // test if successfully built, then return to the original page
+        clickLinkWithText( "Apache Maven" );
+        clickLinkWithText( "Builds" );
+        clickLinkWithText( "Result" );
+        assertTextPresent( "BUILD SUCCESSFUL" );
+        clickLinkWithText( "Project Group Summary" );
+    }
+
+    public void assertReleaseSuccess()
+    {
+        assertTextPresent( "Choose Release Goal for Apache Maven" );
+    }
+
+    public void assertReleaseEmpty()
+    {
+        assertTextPresent( "Cannot release an empty group" );
+    }
+
+    public void addValidM2ProjectFromProjectGroup( String projectGroupName, String groupId,
String description,
+                                                   String m2PomUrl ) throws Exception
+    {
+        showProjectGroup( projectGroupName, groupId, description );
+        selectValue( "projectTypes", "Add M2 Project" );
+        clickButtonWithValue( "Add" );
+        assertAddMavenTwoProjectPage();
+
+        setFieldValue( "m2PomUrl", m2PomUrl );
+        clickButtonWithValue( "Add" );
+
+        // if success redirect to summary page
+        assertProjectGroupsSummaryPage();
+    }
+
+    public void goToBuildDefinitionPage( String projectGroupName, String groupId, String
description ) throws Exception
+    {
+        showProjectGroup( projectGroupName, groupId, description );
+        clickLinkWithText( "Build Definitions" );
+        assertTextPresent( "Project Group Build Definitions of " + projectGroupName + " group"
);
+
+        assertBuildDefinitionPage( projectGroupName );
 
+    }
+
+    public void assertBuildDefinitionPage( String projectGroupName )
+    {
+
+        assertTextPresent( "Project Group Build Definitions of " + projectGroupName + " group"
);
+        assertElementPresent( "buildDefinition_0" );
+    }
+
+    public void assertNotifierPage( String projectGroupName )
+    {
+        assertTextPresent( "Project Group Notifiers of " + projectGroupName + " group" );
+    }
+
+    public void assertAddNotifierPage()
+    {
+        assertPage( "Continuum - Add Notifier" );
+        assertTextPresent( "Add Notifier" );
+        assertTextPresent( "Type" );
+        assertElementPresent( "notifierType" );
+        assertElementPresent( "Cancel" );
+    }
+
+    public void assertAddEditMailNotifierPage()
+    {
+        assertPage( "Continuum - Add/Edit Mail Notifier" );
+        assertTextPresent( "Add/Edit Mail Notifier" );
+        assertTextPresent( "Mail Recipient Address" );
+        assertTextPresent( "Send on Success" );
+        assertTextPresent( "Send on Failure" );
+        assertTextPresent( "Send on Error" );
+        assertTextPresent( "Send on Warning" );
+        assertElementPresent( "address" );
+        assertElementPresent( "Cancel" );
+    }
+
+    public void assertAddEditIrcNotifierPage()
+    {
+        assertPage( "Continuum - Add/Edit IRC Notifier" );
+
+        assertTextPresent( "IRC Host" );
+        assertElementPresent( "host" );
+
+        assertTextPresent( "IRC port" );
+        assertElementPresent( "port" );
+
+        assertTextPresent( "IRC channel" );
+        assertElementPresent( "channel" );
+
+        assertTextPresent( "Nick Name" );
+        assertElementPresent( "nick" );
+
+        assertTextPresent( "Full Name" );
+        assertElementPresent( "fullName" );
+
+        assertTextPresent( "Password" );
+        assertElementPresent( "password" );
+
+        assertTextPresent( "Send on Success" );
+        assertTextPresent( "Send on Failure" );
+        assertTextPresent( "Send on Error" );
+        assertTextPresent( "Send on Warning" );
+    }
+
+    public void assertAddEditJabberPage()
+    {
+        assertPage( "Continuum - Add/Edit Jabber Notifier" );
+
+        assertTextPresent( "Jabber Host" );
+        assertElementPresent( "host" );
+        assertTextPresent( "Jabber port" );
+        assertElementPresent( "port" );
+        assertTextPresent( "Jabber login" );
+        assertElementPresent( "login" );
+        assertTextPresent( "Jabber Password" );
+        assertElementPresent( "password" );
+        assertTextPresent( "Jabber Domain Name" );
+        assertElementPresent( "domainName" );
+        assertTextPresent( "Jabber Recipient Address" );
+        assertElementPresent( "address" );
+
+        assertTextPresent( "Is it a SSL connection?" );
+        assertTextPresent( "Is it a Jabber group?" );
+        assertTextPresent( "Send on Success" );
+        assertTextPresent( "Send on Failure" );
+        assertTextPresent( "Send on Error" );
+        assertTextPresent( "Send on Warning" );
+    }
+
+    public void assertAddEditMsnPage()
+    {
+        assertPage( "Continuum - Add/Edit MSN Notifier" );
+
+        assertTextPresent( "MSN login" );
+        assertElementPresent( "login" );
+        assertTextPresent( "MSN Password" );
+        assertElementPresent( "password" );
+        assertTextPresent( "MSN Recipient Address" );
+        assertElementPresent( "address" );
+
+        assertTextPresent( "Send on Success" );
+        assertTextPresent( "Send on Failure" );
+        assertTextPresent( "Send on Error" );
+        assertTextPresent( "Send on Warning" );
+    }
+
+    public void assertAddEditWagonPage()
+    {
+        assertPage( "Continuum - Add/Edit Wagon Notifier" );
+
+        assertTextPresent( "Project Site URL" );
+        assertElementPresent( "url" );
+
+        assertTextPresent( "Send on Success" );
+        assertTextPresent( "Send on Failure" );
+        assertTextPresent( "Send on Error" );
+        assertTextPresent( "Send on Warning" );
+    }
+
+    public void addMailNotifier( String projectGroupName, String projectGroupId, String projectGroupDescription,
+                                 String email, boolean isValid ) throws Exception
+    {
+
+        showProjectGroup( projectGroupName, projectGroupId, projectGroupDescription );
+        clickLinkWithText( "Notifiers" );
+        assertNotifierPage( projectGroupName );
+
+        clickButtonWithValue( "Add" );
+        assertAddNotifierPage();
+        selectValue( "addProjectGroupNotifier_notifierType", "Mail" );
+        clickButtonWithValue( "Submit" );
+        assertAddEditMailNotifierPage();
+        setFieldValue( "address", email );
+        clickButtonWithValue( "Save" );
+
+        if ( isValid )
+        {
+            assertNotifierPage( projectGroupName );
+        }
+        else
+        {
+            assertTextPresent( "Address is invalid" );
+        }
+    }
+
+    public void addIrcNotifier( String projectGroupName, String projectGroupId, String projectGroupDescription,
+                                String host, String channel, boolean isValid ) throws Exception
+    {
+        showProjectGroup( projectGroupName, projectGroupId, projectGroupDescription );
+
+        clickLinkWithText( "Notifiers" );
+        assertNotifierPage( projectGroupName );
+
+        clickButtonWithValue( "Add" );
+        assertAddNotifierPage();
+        selectValue( "addProjectGroupNotifier_notifierType", "IRC" );
+
+        clickButtonWithValue( "Submit" );
+        assertAddEditIrcNotifierPage();
+        setFieldValue( "host", host );
+        setFieldValue( "channel", channel );
+
+        clickButtonWithValue( "Save" );
+        if ( isValid )
+        {
+            assertNotifierPage( projectGroupName );
+        }
+        else
+        {
+            assertTextPresent( "Host is required" );
+            assertTextPresent( "Channel is required" );
+        }
+    }
+
+    public void addJabberNotifier( String projectGroupName, String projectGroupId, String
projectGroupDescription,
+                                   String host, String login, String password, String address,
boolean isValid )
+        throws Exception
+    {
+        showProjectGroup( projectGroupName, projectGroupId, projectGroupDescription );
+
+        clickLinkWithText( "Notifiers" );
+        assertNotifierPage( projectGroupName );
+
+        clickButtonWithValue( "Add" );
+        assertAddNotifierPage();
+        selectValue( "addProjectGroupNotifier_notifierType", "Jabber" );
+        clickButtonWithValue( "Submit" );
+
+        assertAddEditJabberPage();
+        setFieldValue( "host", host );
+        setFieldValue( "login", login );
+        setFieldValue( "password", password );
+        setFieldValue( "address", address );
+        clickButtonWithValue( "Save" );
+
+        if ( isValid )
+        {
+            assertNotifierPage( projectGroupName );
+        }
+        else
+        {
+            assertTextPresent( "Host is required" );
+            assertTextPresent( "Login is required" );
+            assertTextPresent( "Password is required" );
+            assertTextPresent( "Address is required" );
+        }
+    }
+
+    public void addMsnNotifierPage( String projectGroupName, String projectGroupId, String
projectGroupDescription,
+                                    String login, String password, String recipientAddress,
boolean isValid )
+        throws Exception
+    {
+        showProjectGroup( projectGroupName, projectGroupId, projectGroupDescription );
+
+        clickLinkWithText( "Notifiers" );
+        assertNotifierPage( projectGroupName );
+
+        clickButtonWithValue( "Add" );
+        assertAddNotifierPage();
+        selectValue( "addProjectGroupNotifier_notifierType", "MSN" );
+        clickButtonWithValue( "Submit" );
+        assertAddEditMsnPage();
+        setFieldValue( "login", login );
+        setFieldValue( "password", password );
+        setFieldValue( "address", recipientAddress );
+        clickButtonWithValue( "Save" );
+
+        if ( isValid )
+        {
+            assertNotifierPage( projectGroupName );
+        }
+        else
+        {
+            assertTextPresent( "Login is required" );
+            assertTextPresent( "Password is required" );
+            assertTextPresent( "Address is required" );
+        }
+    }
+
+    public void addWagonNotifierPage( String projectGroupName, String projectGroupId, String
projectGroupDescription,
+                                      String siteUrl, boolean isValid ) throws Exception
+    {
+        showProjectGroup( projectGroupName, projectGroupId, projectGroupDescription );
+
+        clickLinkWithText( "Notifiers" );
+        assertNotifierPage( projectGroupName );
+
+        clickButtonWithValue( "Add" );
+        assertAddNotifierPage();
+        selectValue( "addProjectGroupNotifier_notifierType", "Wagon" );
+        clickButtonWithValue( "Submit" );
+        assertAddEditWagonPage();
+        setFieldValue( "url", siteUrl );
+        clickButtonWithValue( "Save" );
+
+        if ( isValid )
+        {
+            assertNotifierPage( projectGroupName );
+        }
+        else
+        {
+            assertTextPresent( "Destination URL is required" );
+        }
+    }
+
+    //////////////////////////////////////
+    // General Project Pages
+    //////////////////////////////////////
+    public void goToEditProjectPage( String projectGroupName, String projectName )
+    {
+        clickLinkWithText( "Show Project Groups" );
+        clickLinkWithText( projectGroupName );
+        clickLinkWithText( projectName );
+        clickButtonWithValue( "Edit" );
+
+        assertEditProjectPage();
+    }
+
+    public void assertEditProjectPage()
+    {
+        assertTextPresent( "Update Continuum Project" );
+        assertTextPresent( "Project Name*:" );
+        assertElementPresent( "name" );
+        assertTextPresent( "Version*:" );
+        assertElementPresent( "version" );
+        assertTextPresent( "SCM Url*:" );
+        assertElementPresent( "scmUrl" );
+        assertTextPresent( "Use SCM Credentials Cache, if available" );
+        assertElementPresent( "scmUseCache" );
+        assertTextPresent( "SCM Username:" );
+        assertElementPresent( "scmUsername" );
+        assertTextPresent( "SCM Password:" );
+        assertElementPresent( "scmPassword" );
+        assertTextPresent( "SCM Branch/Tag:" );
+        assertElementPresent( "scmTag" );
+    }
+
+    public void goToAddBuildDefinitionPage( String projectGroupName, String projectName )
+    {
+        clickLinkWithText( "Show Project Groups" );
+        clickLinkWithText( projectGroupName );
+        clickLinkWithText( projectName );
+        clickButtonWithValue( "Add" );
+
+        assertAddBuildDefinitionPage();
+    }
+
+    public void assertAddBuildDefinitionPage()
+    {
+        assertTextPresent( "Add/Edit Build Definition" );
+        assertTextPresent( "POM filename*:" );
+        assertElementPresent( "buildFile" );
+        assertTextPresent( "Goals:" );
+        assertElementPresent( "goals" );
+        assertTextPresent( "Arguments:" );
+        assertElementPresent( "arguments" );
+        assertTextPresent( "Build Fresh" );
+        assertElementPresent( "buildFresh" );
+        assertTextPresent( "Is it default?" );
+        assertElementPresent( "defaultBuildDefinition" );
+        assertTextPresent( "Schedule:" );
+        assertElementPresent( "scheduleId" );
+    }
+
+    public void addBuildDefinition( String projectGroupName, String projectName, String buildFile,
String goals,
+                                    String arguments, boolean buildFresh, boolean isDefault
)
+    {
+        goToAddBuildDefinitionPage( projectGroupName, projectName );
+
+        // Enter values into Add Build Definition fields, and submit
+        setFieldValue( "buildFile", buildFile );
+        setFieldValue( "goals", goals );
+        setFieldValue( "arguments", arguments );
+        if ( buildFresh )
+        {
+            checkField( "buildFresh" );
+        }
+        if ( isDefault )
+        {
+            checkField( "defaultBuildDefinition" );
+        }
+
+        submit();
+
+        assertProjectInformationPage();
+    }
+
+    public void goToAddNotifierPage( String projectGroupName, String projectName )
+    {
+        clickLinkWithText( "Show Project Groups" );
+        clickLinkWithText( projectGroupName );
+        clickLinkWithText( projectName );
+        getSelenium().click( "addProjectNotifier" );
+        clickLinkWithXPath( "//input[@id='addProjectNotifier_0']" );
+
+        assertNotifierPage();
+    }
+
+    public void assertNotifierPage()
+    {
+        assertPage( "Continuum - Add Notifier" );
+        assertTextPresent( "Add Notifier" );
+        assertTextPresent( "Type:" );
+        assertElementPresent( "notifierType" );
+    }
+
+    public void addMailNotifier( String projectGroupName, String projectName, String email,
boolean success,
+                                 boolean failure, boolean error, boolean warning )
+    {
+        goToAddNotifierPage( projectGroupName, projectName );
+        clickButtonWithValue( "Submit" );
+
+        // Enter values into Add Notifier fields, and submit
+        setFieldValue( "address", email );
+        if ( success )
+        {
+            checkField( "sendOnSuccess" );
+        }
+        if ( failure )
+        {
+            checkField( "sendOnFailure" );
+        }
+        if ( error )
+        {
+            checkField( "sendOnError" );
+        }
+        if ( warning )
+        {
+            checkField( "sendOnWarning" );
+        }
+
+        submit();
+        assertProjectInformationPage();
+    }
+
+    public void goToProjectInformationPage( String projectGroupName, String projectName )
+    {
+        clickLinkWithText( "Show Project Groups" );
+        clickLinkWithText( projectGroupName );
+        clickLinkWithText( projectName );
+
+        assertProjectInformationPage();
+    }
+
+    public void assertProjectInformationPage()
+    {
+        assertTextPresent( "Project Group Summary" );
+        assertTextPresent( "Project Information" );
+        assertTextPresent( "Builds" );
+        assertTextPresent( "Working Copy" );
+        assertTextPresent( "Build Definitions" );
+        assertTextPresent( "Notifiers" );
+        assertTextPresent( "Dependencies" );
+        assertTextPresent( "Developers" );
     }
 
     //////////////////////////////////////

Modified: maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AddMavenTwoProjectTest.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AddMavenTwoProjectTest.java?view=diff&rev=531425&r1=531424&r2=531425
==============================================================================
--- maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AddMavenTwoProjectTest.java
(original)
+++ maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AddMavenTwoProjectTest.java
Mon Apr 23 03:54:47 2007
@@ -152,4 +152,15 @@
         submitAddMavenTwoProjectPage( pomUrl, false );
         assertTextPresent( "The specified resource isn't a file or the protocol used isn't
allowed." );
     }
+
+    /**
+     * test cancel button
+     */
+    public void testCancelButton()
+    {
+        goToAboutPage();
+        goToAddMavenTwoProjectPage();
+        clickButtonWithValue( "Cancel" );
+        assertAboutPage();
+    }
 }

Modified: maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AntTest.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AntTest.java?view=diff&rev=531425&r1=531424&r2=531425
==============================================================================
--- maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AntTest.java
(original)
+++ maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AntTest.java
Mon Apr 23 03:54:47 2007
@@ -75,6 +75,34 @@
         assertTextPresent( "SCM Url is required" );
     }
 
+    public void testSubmitDoubleErrorMessages()
+    {
+        goToAddAntPage();
+        clickButtonWithValue( "Add", false );
+        clickButtonWithValue( "Add", false );
+        assertAddAntProjectPage();
+        if ( "Name is required".equals( getSelenium().getText( "//td/span" ) ) )
+        {
+            assertFalse( "Double Error Messages", "Name is required".equals( getSelenium().getText(
"//tr[2]/td/span" ) ) );
+        }
+        if ( "Version is required".equals( getSelenium().getText( "//tr[4]/td/span" ) ) )
+        {
+            assertFalse( "Double Error Messages", "Version is required".equals( getSelenium().getText(
"//tr[5]/td/span" ) ) );
+        }
+        if ( "SCM Url is required".equals( getSelenium().getText( "//tr[7]/td/span" ) ) )
+        {
+            assertFalse( "Double Error Messages", "SCM Url is required".equals( getSelenium().getText(
"//tr[8]/td/span" ) ) );
+        }
+    }
+
+    public void testCancelButton()
+    {
+        goToAboutPage();
+        goToAddAntPage();
+        clickButtonWithValue( "Cancel" );
+        assertAboutPage();
+    }
+
     private void goToAddAntPage()
     {
         clickLinkWithText( "Ant Project" );

Modified: maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/ProjectGroupTest.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/ProjectGroupTest.java?view=diff&rev=531425&r1=531424&r2=531425
==============================================================================
--- maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/ProjectGroupTest.java
(original)
+++ maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/ProjectGroupTest.java
Mon Apr 23 03:54:47 2007
@@ -86,4 +86,390 @@
         removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
     }
 
+    public void testAddBuildDefinitionWithEmptyStrings() throws Exception
+    {
+        addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+        showProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+
+        clickLinkWithText( "Build Definitions" );
+        clickButtonWithValue( "Add" );
+        clickButtonWithValue( "Save" );
+
+        assertTextPresent( "POM is required." );
+        removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+    }
+
+    public void testAddBuildDefinitionWithSpaces() throws Exception
+    {
+        addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+        showProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+
+        clickLinkWithText( "Build Definitions" );
+        clickButtonWithValue( "Add" );
+        setFieldValue( "buildFile", "" );
+        clickButtonWithValue( "Save" );
+
+        assertTextPresent( "POM is invalid." );
+        removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+    }
+
+    public void testCancelAddProjectGroup() throws Exception
+    {
+        clickLinkWithText( "Show Project Groups" );
+        clickButtonWithValue( "Add Project Group" );
+        clickButtonWithValue( "Cancel" );
+
+        assertPage( "Continuum - Group Summary" );
+        assertTextPresent( "Project Groups" );
+        assertButtonWithValuePresent( "Add Project Group" );
+    }
+
+    public void testCancelEditProjectGroup() throws Exception
+    {
+        addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+        showProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+
+        clickButtonWithValue( "Edit" );
+        clickButtonWithValue( "Cancel" );
+
+        assertProjectGroupSummaryPage( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+        removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+    }
+
+    public void testCancelDeleteProjectGroup() throws Exception
+    {
+        addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+        showProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+
+        clickButtonWithValue( "Delete" );
+        clickButtonWithValue( "Cancel" );
+
+        assertProjectGroupSummaryPage( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+        removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+    }
+
+    public void testCancelAddBuildDefinition() throws Exception
+    {
+        addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+        showProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+
+        clickLinkWithText( "Build Definitions" );
+        clickButtonWithValue( "Add" );
+        clickButtonWithValue( "Cancel" );
+
+        assertTextPresent( "Project Group Build Definitions of " + TEST_PROJ_GRP_NAME );
+        removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+    }
+
+    public void testCancelDeleteBuildDefinition() throws Exception
+    {
+        addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+        showProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+
+        clickLinkWithText( "Build Definitions" );
+        clickLinkWithXPath( "//img[@alt='Delete']" );
+        clickButtonWithValue( "Cancel" );
+
+        assertTextPresent( "Project Group Build Definitions of " + TEST_PROJ_GRP_NAME );
+        removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+    }
+
+    public void testCancelAddNotifier() throws Exception
+    {
+        addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+        showProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+
+        clickLinkWithText( "Notifiers" );
+        clickButtonWithValue( "Add" );
+        clickButtonWithValue( "Cancel" );
+
+        assertTextPresent( "Project Group Notifiers of " + TEST_PROJ_GRP_NAME );
+        removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+    }
+
+    public void testCancelDeleteNotifier() throws Exception
+    {
+        addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+        showProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+
+        clickLinkWithText( "Notifiers" );
+        clickButtonWithValue( "Add" );
+        clickButtonWithValue( "Submit" );
+        setFieldValue( "address", "email@domain.com" );
+        submit();
+        clickLinkWithXPath( "//img[@alt='Delete']" );
+        clickButtonWithValue( "Cancel" );
+
+        assertTextPresent( "Project Group Notifiers of " + TEST_PROJ_GRP_NAME );
+        removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+    }
+
+    public void testAddProjectGroupWithEmptyString() throws Exception
+    {
+        addProjectGroup( "", "", "" );
+        assertTextPresent( "Project Group Name required." );
+        assertTextPresent( "Project Group ID required." );
+    }
+
+    public void testAddProjectGroupWithWhitespaceString() throws Exception
+    {
+        addProjectGroup( " ", " ", " " );
+        assertTextPresent( "Project Group Name required." );
+        assertTextPresent( "Project Group ID required." );
+    }
+
+    public void testEditProjectGroupWithInvalidValues() throws Exception
+    {
+
+        addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+        editProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION,
"",
+                          TEST_PROJ_GRP_DESCRIPTION + "_2" );
+
+        assertTextPresent( "Project Group Name required." );
+
+        removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+    }
+
+    public void testEditProjectGroupWithValidValues() throws Exception
+    {
+        final String sNewProjectName = TEST_PROJ_GRP_NAME + "_2";
+        final String sNewProjectDescription = TEST_PROJ_GRP_DESCRIPTION + "_2";
+
+        addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+        editProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION,
sNewProjectName,
+                          sNewProjectDescription );
+
+        assertProjectGroupSummaryPage( sNewProjectName, TEST_PROJ_GRP_ID, sNewProjectDescription
);
+
+        removeProjectGroup( sNewProjectName, TEST_PROJ_GRP_ID, sNewProjectDescription );
+    }
+
+    public void testProjectGroupAllBuildSuccess() throws Exception
+    {
+        addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+
+        addValidM2ProjectFromProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION,
+                                           TEST_POM_URL );
+
+        showProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+
+        buildProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+
+        clickButtonWithValue( "Release" );
+
+        assertReleaseSuccess();
+
+        removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+    }
+
+    public void testProjectGroupNoProject() throws Exception
+    {
+        addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+        showProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+
+        clickButtonWithValue( "Release" );
+        assertReleaseEmpty();
+
+        removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+    }
+
+    public void testAddGroupProjectAnt() throws Exception
+    {
+        clickLinkWithText( "Ant Project" );
+        assertAddAntProjectPage();
+        setFieldValue( "projectName", "Foo" );
+        setFieldValue( "projectVersion", "1.0-SNAPSHOT" );
+        // TODO change to invalid url
+        setFieldValue( "projectScmUrl",
+                       "https://svn.apache.org/repos/asf/maven/continuum/trunk/continuum-test-projects/ant/"
);
+
+        // selectValue( "projectTypes", "Add M2 Project" );
+        // setselectedProjectGroup
+        clickButtonWithValue( "Add" );
+
+        assertProjectGroupsSummaryPage();
+        assertTextPresent( "Default Project Group" );
+        clickLinkWithText( "Default Project Group" );
+        assertTextPresent( "Foo" );
+
+    }
+
+    public void testfromGroupBuildDefinition() throws Exception
+    {
+        final String projectGroupName2 = TEST_PROJ_GRP_NAME + "_2";
+        final String projectgroupId2 = TEST_PROJ_GRP_ID + "_2";
+        final String projectGroupDescription2 = TEST_PROJ_GRP_DESCRIPTION + "_2";
+
+        addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+        addProjectGroup( projectGroupName2, projectgroupId2, projectGroupDescription2 );
+
+        addMavenTwoProject( TEST_POM_URL, "", "", TEST_PROJ_GRP_NAME, true );
+
+        addMavenTwoProject( TEST_POM_URL, "", "", projectGroupName2, true );
+
+        goToBuildDefinitionPage( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+        clickImgWithAlt( "Build" );
+
+        assertProjectGroupsSummaryPage();
+
+        removeProjectGroup( projectGroupName2, projectgroupId2, projectGroupDescription2
);
+        removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+    }
+
+    public void testBuildFromProjectGroupSummary() throws Exception
+    {
+        final String projectGroupName2 = TEST_PROJ_GRP_NAME + "_2";
+        final String projectgroupId2 = TEST_PROJ_GRP_ID + "_2";
+        final String projectGroupDescription2 = TEST_PROJ_GRP_DESCRIPTION + "_2";
+
+        addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+        addProjectGroup( projectGroupName2, projectgroupId2, projectGroupDescription2 );
+
+        addMavenTwoProject( TEST_POM_URL, "", "", TEST_PROJ_GRP_NAME, true );
+
+        addMavenTwoProject( TEST_POM_URL, "", "", projectGroupName2, true );
+
+        showProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+        clickButtonWithValue( "Build" );
+
+        assertProjectGroupSummaryPage( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+
+        removeProjectGroup( projectGroupName2, projectgroupId2, projectGroupDescription2
);
+        removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+
+    }
+
+    public void testDeleteProjectGroupBuild() throws Exception
+    {
+        addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+
+        addMavenTwoProject( TEST_POM_URL, "", "", TEST_PROJ_GRP_NAME, true );
+
+        showProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+        clickImgWithAlt( "Delete" );
+        assertElementPresent( "deleteProject_0" );
+        assertElementPresent( "Cancel" );
+
+        clickSubmitWithLocator( "deleteProject_0" );
+
+        removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+    }
+
+    public void testAddValidMailNotifier() throws Exception
+    {
+        addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+
+        addMailNotifier( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION,
"test@test.com", true );
+
+        removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+    }
+
+    public void testAddInvalidMailNotifier() throws Exception
+    {
+        addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+
+        addMailNotifier( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION,
"invalid_email_add", false );
+
+        removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+    }
+
+    public void testAddValidIrcNotifier() throws Exception
+    {
+        addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+
+        addIrcNotifier( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION,
"test.com", "test_channel",
+                        true );
+
+        removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+    }
+
+    public void testAddInvalidIrcNotifier() throws Exception
+    {
+        addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+
+        addIrcNotifier( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION,
"", "", false );
+
+        removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+    }
+
+    public void testAddValidJabberNotifier() throws Exception
+    {
+        addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+
+        addJabberNotifier( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION,
"test", "test_login",
+                           "hello", "test@address.com", true );
+
+        removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+    }
+
+    public void testAddInvalidJabberNotifier() throws Exception
+    {
+        addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+
+        addJabberNotifier( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION,
"", "", "", "", false );
+
+        removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+    }
+
+    public void testAddValidMsnNotifier() throws Exception
+    {
+        addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+
+        addMsnNotifierPage( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION,
"test", "hello",
+                            "test@address.com", true );
+
+        removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+    }
+
+    public void testAddInvalidMsnNotifier() throws Exception
+    {
+        addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+
+        addMsnNotifierPage( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION,
"", "", "", false );
+
+        removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+    }
+
+    public void testAddValidWagonNotifier() throws Exception
+    {
+        addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+
+        addWagonNotifierPage( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION,
TEST_POM_URL, true );
+
+        removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+    }
+
+    public void testAddInvalidWagonNotifier() throws Exception
+    {
+        addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+
+        addWagonNotifierPage( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION,
"", false );
+
+        removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+    }
+
+    public void testDeleteNotifier() throws Exception
+    {
+        addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+        showProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+
+        clickLinkWithText( "Notifiers" );
+        assertNotifierPage( TEST_PROJ_GRP_NAME );
+
+        clickButtonWithValue( "Add" );
+        assertAddNotifierPage();
+        selectValue( "addProjectGroupNotifier_notifierType", "Wagon" );
+        clickButtonWithValue( "Submit" );
+        assertAddEditWagonPage();
+        setFieldValue( "url", TEST_POM_URL );
+        clickButtonWithValue( "Save" );
+
+        assertNotifierPage( TEST_PROJ_GRP_NAME );
+
+        clickImgWithAlt( "Delete" );
+        clickSubmitWithLocator( "deleteProjectGroupNotifier_0" );
+        assertNotifierPage( TEST_PROJ_GRP_NAME );
+
+        removeProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
+    }
 }

Modified: maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/SchedulesPageTest.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/SchedulesPageTest.java?view=diff&rev=531425&r1=531424&r2=531425
==============================================================================
--- maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/SchedulesPageTest.java
(original)
+++ maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/SchedulesPageTest.java
Mon Apr 23 03:54:47 2007
@@ -196,16 +196,37 @@
         assertEditSchedulePage();
 
         HashMap fields = new HashMap();
+        fields.put( FIELD_MAXJOBEXECUTIONTIME, "" );
         boolean valid = false;
         boolean wait = false;
 
-        // test saving without editing anything from the initial edit page
+        // test saving without editing anything from the initial edit page except for Max
Job Execution Time
         inputSchedule( fields, wait, valid );
 
         assertTrue( "Name field not validated",
                     getSelenium().isElementPresent( "//tr/td[span='schedule.name.required']"
) );
         assertTrue( "Description field not validated",
                     getSelenium().isElementPresent( "//tr/td[span='schedule.version.required']"
) );
+        assertTrue( "Max Job Execution Time field not validated",
+                    getSelenium().isElementPresent( "//tr/td[span='schedule.maxJobExecutionTime.required']"
) );
+
+        // go back to the schedules page
+        clickLinkWithText( "Schedules" );
+
+        // start new schedule add session
+        clickButtonWithValue( "Add" );
+
+        // test saving using spaces for name and description
+        fields.put( FIELD_NAME, " " );
+        fields.put( FIELD_DESCRIPTION, " " );
+
+        inputSchedule( fields, wait, valid );
+
+        //TODO: Fix text validation, we need real text and not a property in the screen
+        assertTrue( "Name field not validated",
+                     getSelenium().isElementPresent( "//tr/td[span='schedule.name.required']"
) );
+        assertTrue( "Description field not validated",
+                     getSelenium().isElementPresent( "//tr/td[span='schedule.version.required']"
) );
 
         // go back to the schedules page
         clickLinkWithText( "Schedules" );
@@ -226,13 +247,62 @@
         assertFalse( "Name field improperly validated",
                      getSelenium().isElementPresent( "//tr/td[span='schedule.name.required']"
) );
         assertFalse( "Description field improperly validated",
-                     getSelenium().isElementPresent( "//tr/td[span='schedule.name.required']"
) );
+                     getSelenium().isElementPresent( "//tr/td[span='schedule.version.required']"
) );
+        assertFalse( "Max Job Execution Time field improperly validated",
+                    getSelenium().isElementPresent( "//tr/td[span='schedule.maxJobExecutionTime.required']"
) );
         assertTrue( "MaxJobExecutionTime not validated", isTextPresent( "schedule.maxJobExecutionTime.invalid"
) );
         assertTrue( "Delay not validated", isTextPresent( "schedule.delay.invalid" ) );
 
         assertEditSchedulePage();
     }
 
+
+    public void testScheduleAddEditPageDoubleErrorMessages()
+    {
+        clickButtonWithValue( "Add" );
+
+        assertEditSchedulePage();
+
+        HashMap fields = new HashMap();
+        boolean valid = false;
+        boolean wait = false;
+
+        // test double error messages issue of webworks
+        inputSchedule( fields, wait, valid );
+        clickButtonWithValue( "Save", false );
+
+        if ( "schedule.name.required".equals( getSelenium().getText( "//td/span" ) ) )
+        {
+            assertFalse( "Double Error Messages", "schedule.name.required".equals( getSelenium().getText(
"//tr[2]/td/span" ) ) );
+        }
+        if ( "schedule.version.required".equals( getSelenium().getText( "//tr[4]/td/span"
) ) )
+        {
+            assertFalse( "Double Error Messages", "schedule.version.required".equals( getSelenium().getText(
"//tr[5]/td/span" ) ) );
+        }
+
+        assertEditSchedulePage();
+    }
+
+    public void testCancelAddSchedule()
+    {
+        clickButtonWithValue( "Add" );
+        clickButtonWithValue( "Cancel" );
+        assertSchedulesPage();
+    }
+
+    public void testCancelEditSchedule()
+    {
+        clickLinkWithXPath( "//img[@alt='Edit']" );
+        clickButtonWithValue( "Cancel" );
+        assertSchedulesPage();
+    }
+
+    public void testCancelDeleteSchedule()
+    {
+        clickLinkWithXPath( "//img[@alt='Delete']" );
+        clickButtonWithValue( "Cancel" );
+        assertSchedulesPage();
+    }
 
     public void assertSchedulesPage()
     {



Mime
View raw message