You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@continuum.apache.org by br...@apache.org on 2012/08/11 03:20:21 UTC
svn commit: r1371850 - in /continuum/trunk/continuum-webapp-test/src/test:
resources/testng.properties
testng/org/apache/continuum/web/test/NotifierTest.java
testng/org/apache/continuum/web/test/parent/AbstractNotifierTest.java
Author: brett
Date: Sat Aug 11 01:20:21 2012
New Revision: 1371850
URL: http://svn.apache.org/viewvc?rev=1371850&view=rev
Log:
make notifier tests not depend on a shared group
Removed:
continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractNotifierTest.java
Modified:
continuum/trunk/continuum-webapp-test/src/test/resources/testng.properties
continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/NotifierTest.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=1371850&r1=1371849&r2=1371850&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/resources/testng.properties (original)
+++ continuum/trunk/continuum-webapp-test/src/test/resources/testng.properties Sat Aug 11 01:20:21 2012
@@ -1,19 +1,79 @@
-#properties for integration tests
-
-#######################
# General properties
-#######################
MAX_WAIT_TIME_IN_MS=60000
MAX_PROJECT_WAIT_TIME_IN_MS=120000
WAIT_TRIES=80
+# Users
+
ADMIN_USERNAME=admin
ADMIN_FULLNAME=admin
ADMIN_PASSWORD=admin123
ADMIN_MAIL=admin@mail.com
+# Maven 2 projects to load
+
+M2_POM_URL=http://localhost:9595/example-projects/continuum-build-queue-test-data/pom.xml
+M2_POM_USERNAME=
+M2_POM_PASSWORD=
+M2_PROJECT_NAME=ContinuumBuildQueueTestData
+
+# Ant projects to load
+
+ANT_NAME=Ant Project
+ANT_DESCRIPTION=This is a sample Ant Project used for testing
+ANT_VERSION=1.0.0-SNAPSHOT
+ANT_TAG=
+ANT_SCM_URL=http://localhost:9595/example-projects/ant/
+ANT_SCM_USERNAME=
+ANT_SCM_PASSWORD=
+
+# Maven 1 projects to load
+
+M1_POM_URL=http://localhost:9595/example-projects/maven-one-projects/valid-project.xml
+M1_POM_USERNAME=
+M1_POM_PASSWORD=
+
+
+### The following properties should not be shared across groups ###
+
+# Notifier test properties
+
+NOTIFIER_PROJECT_GROUP_NAME=Notifier Project Group
+NOTIFIER_PROJECT_GROUP_ID=com.example.notifiers
+NOTIFIER_PROJECT_GROUP_DESCRIPTION=Sample projects for testing notifiers
+MAIL_NOTIFIER_ADDRESS=test@test.com
+IRC_NOTIFIER_HOST=test.com
+IRC_NOTIFIER_CHANNEL=test_channel
+JABBER_NOTIFIER_HOST=test
+JABBER_NOTIFIER_LOGIN=test_login
+JABBER_NOTIFIER_PASSWORD=hello
+JABBER_NOTIFIER_ADDRESS=test@address.com
+MSN_NOTIFIER_ADDRESS=test@address.com
+MSN_NOTIFIER_LOGIN=test
+MSN_NOTIFIER_PASSWORD=hello
+WAGON_NOTIFIER_URL=http://svn.apache.org/repos/asf/maven/pom/trunk/maven/pom.xml
+WAGON_SERVER_ID=wagoId
+
+# Maven 1 test properties
+
+M1_PROJ_GRP_NAME=Maven One Project
+M1_PROJ_GRP_ID=maven-one-project
+M1_PROJ_GRP_DESCRIPTION=This is a sample Maven One Project
+
+M1_MISS_REPO_POM_URL=http://localhost:9595/example-projects/maven-one-projects/missing-repository-element-project.xml
+M1_EXTENDED_POM_URL=http://localhost:9595/example-projects/maven-one-projects/extend-element-project.xml
+M1_UNPARSEABLE_POM_URL=http://localhost:9595/example-projects/maven-one-projects/unparseable-content-project.xml
+
+# Ant test properties
+
+ANT_PROJECT_GROUP_NAME=Ant Project Group
+ANT_PROJECT_GROUP_ID=com.example.ant
+ANT_PROJECT_GROUP_DESCRIPTION=Group for Ant test projects
+
+#####
+
DEFAULT_PROJ_GRP_NAME=Default Project Group
DEFAULT_PROJ_GRP_ID=default
DEFAULT_PROJ_GRP_DESCRIPTION=Contains all projects that do not have a group of their own
@@ -23,13 +83,10 @@ DEFAULT_PROJ_GRP_DESCRIPTION=Contains al
########################
# Properties for testAddMavenTwoProject
-M2_POM_URL=http://localhost:9595/example-projects/continuum-build-queue-test-data/pom.xml
M2_PROJ_GRP_NAME=ContinuumBuildQueueTestData
M2_PROJ_GRP_ID=org.apache.continuum
M2_PROJ_GRP_DESCRIPTION=Project for testing continuum build queue
M2_PROJ_GRP_SCM_ROOT_URL=scm:svn:${svn.base.url}/trunk/continuum-build-queue-test-data
-M2_POM_USERNAME=
-M2_POM_PASSWORD=
# Properties for testDeleteMavenTwoProject
M2_DELETE_POM_URL=http://localhost:9595/example-projects/simple-example/pom.xml
@@ -80,37 +137,6 @@ M2_FAILING_PROJ_GRP_ID=org.apache.contin
M2_FAILING_PROJ_DESCRIPTION=Sample project that has a build failure
########################
-# mavenOneProject group
-########################
-
-# Properties for testAddMavenOneProject
-M1_POM_URL=http://localhost:9595/example-projects/maven-one-projects/valid-project.xml
-M1_PROJ_GRP_NAME=Maven One Project
-M1_PROJ_GRP_ID=maven-one-project
-M1_PROJ_GRP_DESCRIPTION=This is a sample Maven One Project
-M1_POM_USERNAME=
-M1_POM_PASSWORD=
-
-M1_MISS_REPO_POM_URL=http://localhost:9595/example-projects/maven-one-projects/missing-repository-element-project.xml
-M1_EXTENDED_POM_URL=http://localhost:9595/example-projects/maven-one-projects/extend-element-project.xml
-M1_UNPARSEABLE_POM_URL=http://localhost:9595/example-projects/maven-one-projects/unparseable-content-project.xml
-
-########################
-# antProject group
-########################
-
-ANT_NAME=Ant Project
-ANT_DESCRIPTION=This is a sample Ant Project used for testing
-ANT_VERSION=1.0.0-SNAPSHOT
-ANT_TAG=
-ANT_SCM_URL=http://localhost:9595/example-projects/ant/
-ANT_SCM_USERNAME=
-ANT_SCM_PASSWORD=
-ANT_PROJECT_GROUP_NAME=Ant Project Group
-ANT_PROJECT_GROUP_ID=com.example.ant
-ANT_PROJECT_GROUP_DESCRIPTION=Group for Ant test projects
-
-########################
# shellProject group
########################
@@ -162,22 +188,6 @@ TEST_PROJ_GRP_ID_THREE=My Group Id
TEST_PROJ_GRP_DESCRIPTION_THREE=Third project group for members test
########################
-# notifier group
-########################
-WAGON_NOTIFIER_URL=http://svn.apache.org/repos/asf/maven/pom/trunk/maven/pom.xml
-WAGON_SERVER_ID=wagoId
-MAIL_NOTIFIER_ADDRESS=test@test.com
-IRC_NOTIFIER_HOST=test.com
-IRC_NOTIFIER_CHANNEL=test_channel
-JABBER_NOTIFIER_HOST=test
-JABBER_NOTIFIER_LOGIN=test_login
-JABBER_NOTIFIER_PASSWORD=hello
-JABBER_NOTIFIER_ADDRESS=test@address.com
-MSN_NOTIFIER_ADDRESS=test@address.com
-MSN_NOTIFIER_LOGIN=test
-MSN_NOTIFIER_PASSWORD=hello
-
-########################
# buildDefinition group
########################
BUILD_POM_NAME=pom.xml
Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/NotifierTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/NotifierTest.java?rev=1371850&r1=1371849&r2=1371850&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/NotifierTest.java (original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/NotifierTest.java Sat Aug 11 01:20:21 2012
@@ -19,35 +19,103 @@ package org.apache.continuum.web.test;
* under the License.
*/
-import org.apache.continuum.web.test.parent.AbstractNotifierTest;
+import org.apache.continuum.web.test.parent.AbstractAdminTest;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/**
* @author José Morales MartÃnez
* @version $Id$
*/
-@Test( groups = { "notifier" }, dependsOnMethods = { "testAddMavenTwoProjectFromRemoteSourceToNonDefaultProjectGroup" } )
+@Test( groups = { "notifier" } )
public class NotifierTest
- extends AbstractNotifierTest
+ extends AbstractAdminTest
{
+ private String projectGroupName;
+
+ private String projectGroupId;
+
+ private String projectGroupDescription;
+
+ private String projectName;
+
+ private String mailNotifierAddress;
+
+ private String ircNotifierHost;
+
+ private String ircNotifierChannel;
+
+ private String jabberNotifierHost;
+
+ private String jabberNotifierLogin;
+
+ private String jabberNotifierPassword;
+
+ private String jabberNotifierAddress;
+
+ private String msnNotifierAddress;
+
+ private String msnNotifierLogin;
+
+ private String msnNotifierPassword;
+
+ private String wagonNotifierUrl;
+
+ private String wagonServerId;
+
+ @BeforeClass
+ public void createProject()
+ {
+ projectGroupName = getProperty( "NOTIFIER_PROJECT_GROUP_NAME" );
+ projectGroupId = getProperty( "NOTIFIER_PROJECT_GROUP_ID" );
+ projectGroupDescription = getProperty( "NOTIFIER_PROJECT_GROUP_DESCRIPTION" );
+
+ projectName = getProperty( "M2_PROJECT_NAME" );
+ String projectPomUrl = getProperty( "M2_POM_URL" );
+ String pomUsername = getProperty( "M2_POM_USERNAME" );
+ String pomPassword = getProperty( "M2_POM_PASSWORD" );
+
+ loginAsAdmin();
+ addProjectGroup( projectGroupName, projectGroupId, projectGroupDescription, true, false );
+ clickLinkWithText( projectGroupName );
+ if ( !isLinkPresent( projectName ) )
+ {
+ addMavenTwoProject( projectPomUrl, pomUsername, pomPassword, projectGroupName, true );
+ }
+ }
+
+ @BeforeMethod
+ protected void setUp()
+ throws Exception
+ {
+ mailNotifierAddress = getProperty( "MAIL_NOTIFIER_ADDRESS" );
+ ircNotifierHost = getProperty( "IRC_NOTIFIER_HOST" );
+ ircNotifierChannel = getProperty( "IRC_NOTIFIER_CHANNEL" );
+ jabberNotifierHost = getProperty( "JABBER_NOTIFIER_HOST" );
+ jabberNotifierLogin = getProperty( "JABBER_NOTIFIER_LOGIN" );
+ jabberNotifierPassword = getProperty( "JABBER_NOTIFIER_PASSWORD" );
+ jabberNotifierAddress = getProperty( "JABBER_NOTIFIER_ADDRESS" );
+ msnNotifierAddress = getProperty( "MSN_NOTIFIER_ADDRESS" );
+ msnNotifierLogin = getProperty( "MSN_NOTIFIER_LOGIN" );
+ msnNotifierPassword = getProperty( "MSN_NOTIFIER_PASSWORD" );
+ wagonNotifierUrl = getProperty( "WAGON_NOTIFIER_URL" );
+ wagonServerId = getProperty( "WAGON_SERVER_ID" );
+ }
+
public void testAddValidMailProjectNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
- String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
- String MAIL_NOTIFIER_ADDRESS = getProperty( "MAIL_NOTIFIER_ADDRESS" );
- goToProjectNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME );
- addMailNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME, MAIL_NOTIFIER_ADDRESS, true );
+ goToProjectNotifier( projectGroupName, projectName );
+ addMailNotifier( projectGroupName, projectName, mailNotifierAddress, true );
}
-
+
public void testAddValidMailProjectNotifierWithInvalidValue()
throws Exception
{
- String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
- String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
- String MAIL_NOTIFIER_ADDRESS = "<script>alert('xss')</script>";
- goToProjectNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME );
- addMailNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME, MAIL_NOTIFIER_ADDRESS, false );
+ String mailNotifierAddress = "<script>alert('xss')</script>";
+ goToProjectNotifier( projectGroupName, projectName );
+ addMailNotifier( projectGroupName, projectName, mailNotifierAddress, false );
assertTextPresent( "Address is invalid" );
}
@@ -55,106 +123,77 @@ public class NotifierTest
public void testEditValidMailProjectNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
- String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
- String MAIL_NOTIFIER_ADDRESS = getProperty( "MAIL_NOTIFIER_ADDRESS" );
String newMail = "newmail@mail.com";
- goToProjectInformationPage( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME );
- editMailNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME, MAIL_NOTIFIER_ADDRESS, newMail, true );
- editMailNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME, newMail, MAIL_NOTIFIER_ADDRESS, true );
+ goToProjectInformationPage( projectGroupName, projectName );
+ editMailNotifier( projectGroupName, projectName, mailNotifierAddress, newMail, true );
+ editMailNotifier( projectGroupName, projectName, newMail, mailNotifierAddress, true );
}
@Test( dependsOnMethods = { "testAddValidMailProjectNotifier" } )
public void testEditInvalidMailProjectNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
- String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
- String MAIL_NOTIFIER_ADDRESS = getProperty( "MAIL_NOTIFIER_ADDRESS" );
- goToProjectInformationPage( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME );
- editMailNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME, MAIL_NOTIFIER_ADDRESS, "invalid_email_add", false );
+ goToProjectInformationPage( projectGroupName, projectName );
+ editMailNotifier( projectGroupName, projectName, mailNotifierAddress, "invalid_email_add", false );
}
public void testAddInvalidMailProjectNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
- String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
- goToProjectNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME );
- addMailNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME, "invalid_email_add", false );
+ goToProjectNotifier( projectGroupName, projectName );
+ addMailNotifier( projectGroupName, projectName, "invalid_email_add", false );
}
public void testAddValidMailGroupNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
- String TEST_PROJ_GRP_ID = getProperty( "TEST_PROJ_GRP_ID" );
- String TEST_PROJ_GRP_DESCRIPTION = getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
- String MAIL_NOTIFIER_ADDRESS = getProperty( "MAIL_NOTIFIER_ADDRESS" );
- goToGroupNotifier( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- addMailNotifier( TEST_PROJ_GRP_NAME, null, MAIL_NOTIFIER_ADDRESS, true );
+ goToGroupNotifier( projectGroupName, projectGroupId, projectGroupDescription );
+ addMailNotifier( projectGroupName, null, mailNotifierAddress, true );
}
@Test( dependsOnMethods = { "testAddValidMailGroupNotifier" } )
public void testEditValidMailGroupNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
- String TEST_PROJ_GRP_ID = getProperty( "TEST_PROJ_GRP_ID" );
- String TEST_PROJ_GRP_DESCRIPTION = getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
- String MAIL_NOTIFIER_ADDRESS = getProperty( "MAIL_NOTIFIER_ADDRESS" );
String newMail = "newmail@mail.com";
- showProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
+ showProjectGroup( projectGroupName, projectGroupId, projectGroupDescription );
clickLinkWithText( "Notifiers" );
- assertGroupNotifierPage( TEST_PROJ_GRP_NAME );
- editMailNotifier( TEST_PROJ_GRP_NAME, null, MAIL_NOTIFIER_ADDRESS, newMail, true );
- editMailNotifier( TEST_PROJ_GRP_NAME, null, newMail, MAIL_NOTIFIER_ADDRESS, true );
+ assertGroupNotifierPage( projectGroupName );
+ editMailNotifier( projectGroupName, null, mailNotifierAddress, newMail, true );
+ editMailNotifier( projectGroupName, null, newMail, mailNotifierAddress, true );
}
@Test( dependsOnMethods = { "testAddValidMailGroupNotifier" } )
public void testEditInvalidMailGroupNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
- String TEST_PROJ_GRP_ID = getProperty( "TEST_PROJ_GRP_ID" );
- String TEST_PROJ_GRP_DESCRIPTION = getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
- String MAIL_NOTIFIER_ADDRESS = getProperty( "MAIL_NOTIFIER_ADDRESS" );
- showProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
+ showProjectGroup( projectGroupName, projectGroupId, projectGroupDescription );
clickLinkWithText( "Notifiers" );
- assertGroupNotifierPage( TEST_PROJ_GRP_NAME );
- editMailNotifier( TEST_PROJ_GRP_NAME, null, MAIL_NOTIFIER_ADDRESS, "invalid_email_add", false );
+ assertGroupNotifierPage( projectGroupName );
+ editMailNotifier( projectGroupName, null, mailNotifierAddress, "invalid_email_add", false );
}
public void testAddInvalidMailGroupNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
- String TEST_PROJ_GRP_ID = getProperty( "TEST_PROJ_GRP_ID" );
- String TEST_PROJ_GRP_DESCRIPTION = getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
- goToGroupNotifier( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- addMailNotifier( TEST_PROJ_GRP_NAME, null, "invalid_email_add", false );
+ goToGroupNotifier( projectGroupName, projectGroupId, projectGroupDescription );
+ addMailNotifier( projectGroupName, null, "invalid_email_add", false );
}
public void testAddValidIrcProjectNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
- String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
- String IRC_NOTIFIER_HOST = getProperty( "IRC_NOTIFIER_HOST" );
- String IRC_NOTIFIER_CHANNEL = getProperty( "IRC_NOTIFIER_CHANNEL" );
- goToProjectNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME );
- addIrcNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME, IRC_NOTIFIER_HOST, IRC_NOTIFIER_CHANNEL, true );
+ goToProjectNotifier( projectGroupName, projectName );
+ addIrcNotifier( projectGroupName, projectName, ircNotifierHost, ircNotifierChannel, true );
}
public void testAddProjectNotifierWithInvalidValues()
throws Exception
{
- String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
- String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
- String IRC_NOTIFIER_HOST = "!@#$<>?etc";
- String IRC_NOTIFIER_CHANNEL = "!@#$<>?etc";
- goToProjectNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME );
- addIrcNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME, IRC_NOTIFIER_HOST, IRC_NOTIFIER_CHANNEL, false );
+ String ircNotifierHost = "!@#$<>?etc";
+ String ircNotifierChannel = "!@#$<>?etc";
+ goToProjectNotifier( projectGroupName, projectName );
+ addIrcNotifier( projectGroupName, projectName, ircNotifierHost, ircNotifierChannel, false );
assertTextPresent( "Host contains invalid character" );
assertTextPresent( "Channel contains invalid character" );
}
@@ -163,38 +202,28 @@ public class NotifierTest
public void testEditValidIrcProjectNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
- String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
- String IRC_NOTIFIER_HOST = getProperty( "IRC_NOTIFIER_HOST" );
- String IRC_NOTIFIER_CHANNEL = getProperty( "IRC_NOTIFIER_CHANNEL" );
String newHost = "new.test.com";
String newChannel = "new_test_channel";
- goToProjectInformationPage( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME );
- editIrcNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME, IRC_NOTIFIER_HOST, IRC_NOTIFIER_CHANNEL, newHost,
- newChannel, true );
- editIrcNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME, newHost, newChannel, IRC_NOTIFIER_HOST,
- IRC_NOTIFIER_CHANNEL, true );
+ goToProjectInformationPage( projectGroupName, projectName );
+ editIrcNotifier( projectGroupName, projectName, ircNotifierHost, ircNotifierChannel, newHost, newChannel,
+ true );
+ editIrcNotifier( projectGroupName, projectName, newHost, newChannel, ircNotifierHost, ircNotifierChannel,
+ true );
}
@Test( dependsOnMethods = { "testAddValidIrcProjectNotifier" } )
public void testEditInvalidIrcProjectNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
- String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
- String IRC_NOTIFIER_HOST = getProperty( "IRC_NOTIFIER_HOST" );
- String IRC_NOTIFIER_CHANNEL = getProperty( "IRC_NOTIFIER_CHANNEL" );
- goToProjectInformationPage( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME );
- editIrcNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME, IRC_NOTIFIER_HOST, IRC_NOTIFIER_CHANNEL, "", "", false );
+ goToProjectInformationPage( projectGroupName, projectName );
+ editIrcNotifier( projectGroupName, projectName, ircNotifierHost, ircNotifierChannel, "", "", false );
}
public void testAddInvalidIrcProjectNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
- String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
- goToProjectNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME );
- addIrcNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME, "", "", false );
+ goToProjectNotifier( projectGroupName, projectName );
+ addIrcNotifier( projectGroupName, projectName, "", "", false );
assertTextPresent( "Host is required" );
assertTextPresent( "Channel is required" );
}
@@ -202,56 +231,38 @@ public class NotifierTest
public void testAddValidIrcGroupNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
- String TEST_PROJ_GRP_ID = getProperty( "TEST_PROJ_GRP_ID" );
- String TEST_PROJ_GRP_DESCRIPTION = getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
- String IRC_NOTIFIER_HOST = getProperty( "IRC_NOTIFIER_HOST" );
- String IRC_NOTIFIER_CHANNEL = getProperty( "IRC_NOTIFIER_CHANNEL" );
- goToGroupNotifier( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- addIrcNotifier( TEST_PROJ_GRP_NAME, null, IRC_NOTIFIER_HOST, IRC_NOTIFIER_CHANNEL, true );
+ goToGroupNotifier( projectGroupName, projectGroupId, projectGroupDescription );
+ addIrcNotifier( projectGroupName, null, ircNotifierHost, ircNotifierChannel, true );
}
@Test( dependsOnMethods = { "testAddValidIrcGroupNotifier" } )
public void testEditValidIrcGroupNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
- String TEST_PROJ_GRP_ID = getProperty( "TEST_PROJ_GRP_ID" );
- String TEST_PROJ_GRP_DESCRIPTION = getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
- String IRC_NOTIFIER_HOST = getProperty( "IRC_NOTIFIER_HOST" );
- String IRC_NOTIFIER_CHANNEL = getProperty( "IRC_NOTIFIER_CHANNEL" );
String newHost = "new.test.com";
String newChannel = "new_test_channel";
- showProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
+ showProjectGroup( projectGroupName, projectGroupId, projectGroupDescription );
clickLinkWithText( "Notifiers" );
- assertGroupNotifierPage( TEST_PROJ_GRP_NAME );
- editIrcNotifier( TEST_PROJ_GRP_NAME, null, IRC_NOTIFIER_HOST, IRC_NOTIFIER_CHANNEL, newHost, newChannel, true );
- editIrcNotifier( TEST_PROJ_GRP_NAME, null, newHost, newChannel, IRC_NOTIFIER_HOST, IRC_NOTIFIER_CHANNEL, true );
+ assertGroupNotifierPage( projectGroupName );
+ editIrcNotifier( projectGroupName, null, ircNotifierHost, ircNotifierChannel, newHost, newChannel, true );
+ editIrcNotifier( projectGroupName, null, newHost, newChannel, ircNotifierHost, ircNotifierChannel, true );
}
@Test( dependsOnMethods = { "testAddValidIrcGroupNotifier" } )
public void testEditInvalidIrcGroupNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
- String TEST_PROJ_GRP_ID = getProperty( "TEST_PROJ_GRP_ID" );
- String TEST_PROJ_GRP_DESCRIPTION = getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
- String IRC_NOTIFIER_HOST = getProperty( "IRC_NOTIFIER_HOST" );
- String IRC_NOTIFIER_CHANNEL = getProperty( "IRC_NOTIFIER_CHANNEL" );
- showProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
+ showProjectGroup( projectGroupName, projectGroupId, projectGroupDescription );
clickLinkWithText( "Notifiers" );
- assertGroupNotifierPage( TEST_PROJ_GRP_NAME );
- editIrcNotifier( TEST_PROJ_GRP_NAME, null, IRC_NOTIFIER_HOST, IRC_NOTIFIER_CHANNEL, "", "", false );
+ assertGroupNotifierPage( projectGroupName );
+ editIrcNotifier( projectGroupName, null, ircNotifierHost, ircNotifierChannel, "", "", false );
}
public void testAddInvalidIrcGroupNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
- String TEST_PROJ_GRP_ID = getProperty( "TEST_PROJ_GRP_ID" );
- String TEST_PROJ_GRP_DESCRIPTION = getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
- goToGroupNotifier( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- addIrcNotifier( TEST_PROJ_GRP_NAME, null, "", "", false );
+ goToGroupNotifier( projectGroupName, projectGroupId, projectGroupDescription );
+ addIrcNotifier( projectGroupName, null, "", "", false );
assertTextPresent( "Host is required" );
assertTextPresent( "Channel is required" );
}
@@ -259,29 +270,19 @@ public class NotifierTest
public void testAddValidJabberProjectNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
- String JABBER_NOTIFIER_HOST = getProperty( "JABBER_NOTIFIER_HOST" );
- String JABBER_NOTIFIER_LOGIN = getProperty( "JABBER_NOTIFIER_LOGIN" );
- String JABBER_NOTIFIER_PASSWORD = getProperty( "JABBER_NOTIFIER_PASSWORD" );
- String JABBER_NOTIFIER_ADDRESS = getProperty( "JABBER_NOTIFIER_ADDRESS" );
- String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
- goToProjectNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME );
- addJabberNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME, JABBER_NOTIFIER_HOST, JABBER_NOTIFIER_LOGIN,
- JABBER_NOTIFIER_PASSWORD, JABBER_NOTIFIER_ADDRESS, true );
+ goToProjectNotifier( projectGroupName, projectName );
+ addJabberNotifier( projectGroupName, projectName, jabberNotifierHost, jabberNotifierLogin,
+ jabberNotifierPassword, jabberNotifierAddress, true );
}
-
+
public void testAddJabberProjectNotifierWithInvalidValues()
throws Exception
{
- String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
- String JABBER_NOTIFIER_HOST = "!@#$<>?etc";
- String JABBER_NOTIFIER_LOGIN = getProperty( "JABBER_NOTIFIER_LOGIN" );
- String JABBER_NOTIFIER_PASSWORD = getProperty( "JABBER_NOTIFIER_PASSWORD" );
- String JABBER_NOTIFIER_ADDRESS = "!@#$<>?etc";
- String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
- goToProjectNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME );
- addJabberNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME, JABBER_NOTIFIER_HOST, JABBER_NOTIFIER_LOGIN,
- JABBER_NOTIFIER_PASSWORD, JABBER_NOTIFIER_ADDRESS, false );
+ String jabberNotifierHost = "!@#$<>?etc";
+ String jabberNotifierAddress = "!@#$<>?etc";
+ goToProjectNotifier( projectGroupName, projectName );
+ addJabberNotifier( projectGroupName, projectName, jabberNotifierHost, jabberNotifierLogin,
+ jabberNotifierPassword, jabberNotifierAddress, false );
assertTextPresent( "Host contains invalid characters" );
assertTextPresent( "Address is invalid" );
}
@@ -290,44 +291,31 @@ public class NotifierTest
public void testEditValidJabberProjectNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
- String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
- String JABBER_NOTIFIER_HOST = getProperty( "JABBER_NOTIFIER_HOST" );
- String JABBER_NOTIFIER_LOGIN = getProperty( "JABBER_NOTIFIER_LOGIN" );
- String JABBER_NOTIFIER_PASSWORD = getProperty( "JABBER_NOTIFIER_PASSWORD" );
- String JABBER_NOTIFIER_ADDRESS = getProperty( "JABBER_NOTIFIER_ADDRESS" );
String newHost = "new_test";
String newLogin = "new_test_login";
String newPassword = "new_password";
String newAddress = "new.test@mail.com";
- goToProjectInformationPage( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME );
- editJabberNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME, JABBER_NOTIFIER_HOST, JABBER_NOTIFIER_LOGIN,
- JABBER_NOTIFIER_ADDRESS, newHost, newLogin, newPassword, newAddress, true );
- editJabberNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME, newHost, newLogin, newAddress, JABBER_NOTIFIER_HOST,
- JABBER_NOTIFIER_LOGIN, JABBER_NOTIFIER_PASSWORD, JABBER_NOTIFIER_ADDRESS, true );
+ goToProjectInformationPage( projectGroupName, projectName );
+ editJabberNotifier( projectGroupName, projectName, jabberNotifierHost, jabberNotifierLogin,
+ jabberNotifierAddress, newHost, newLogin, newPassword, newAddress, true );
+ editJabberNotifier( projectGroupName, projectName, newHost, newLogin, newAddress, jabberNotifierHost,
+ jabberNotifierLogin, jabberNotifierPassword, jabberNotifierAddress, true );
}
@Test( dependsOnMethods = { "testAddValidJabberProjectNotifier" } )
public void testEditInvalidJabberProjectNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
- String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
- String JABBER_NOTIFIER_HOST = getProperty( "JABBER_NOTIFIER_HOST" );
- String JABBER_NOTIFIER_LOGIN = getProperty( "JABBER_NOTIFIER_LOGIN" );
- String JABBER_NOTIFIER_ADDRESS = getProperty( "JABBER_NOTIFIER_ADDRESS" );
- goToProjectInformationPage( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME );
- editJabberNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME, JABBER_NOTIFIER_HOST, JABBER_NOTIFIER_LOGIN,
- JABBER_NOTIFIER_ADDRESS, "", "", "", "", false );
+ goToProjectInformationPage( projectGroupName, projectName );
+ editJabberNotifier( projectGroupName, projectName, jabberNotifierHost, jabberNotifierLogin,
+ jabberNotifierAddress, "", "", "", "", false );
}
public void testAddInvalidJabberProjectNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
- String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
- goToProjectNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME );
- addJabberNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME, "", "", "", "", false );
+ goToProjectNotifier( projectGroupName, projectName );
+ addJabberNotifier( projectGroupName, projectName, "", "", "", "", false );
assertTextPresent( "Host is required" );
assertTextPresent( "Login is required" );
assertTextPresent( "Password is required" );
@@ -337,67 +325,44 @@ public class NotifierTest
public void testAddValidJabberGroupNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
- String TEST_PROJ_GRP_ID = getProperty( "TEST_PROJ_GRP_ID" );
- String TEST_PROJ_GRP_DESCRIPTION = getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
- String JABBER_NOTIFIER_HOST = getProperty( "JABBER_NOTIFIER_HOST" );
- String JABBER_NOTIFIER_LOGIN = getProperty( "JABBER_NOTIFIER_LOGIN" );
- String JABBER_NOTIFIER_PASSWORD = getProperty( "JABBER_NOTIFIER_PASSWORD" );
- String JABBER_NOTIFIER_ADDRESS = getProperty( "JABBER_NOTIFIER_ADDRESS" );
- goToGroupNotifier( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- addJabberNotifier( TEST_PROJ_GRP_NAME, null, JABBER_NOTIFIER_HOST, JABBER_NOTIFIER_LOGIN,
- JABBER_NOTIFIER_PASSWORD, JABBER_NOTIFIER_ADDRESS, true );
+ goToGroupNotifier( projectGroupName, projectGroupId, projectGroupDescription );
+ addJabberNotifier( projectGroupName, null, jabberNotifierHost, jabberNotifierLogin, jabberNotifierPassword,
+ jabberNotifierAddress, true );
}
@Test( dependsOnMethods = { "testAddValidJabberGroupNotifier" } )
public void testEditValidJabberGroupNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
- String TEST_PROJ_GRP_ID = getProperty( "TEST_PROJ_GRP_ID" );
- String TEST_PROJ_GRP_DESCRIPTION = getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
- String JABBER_NOTIFIER_HOST = getProperty( "JABBER_NOTIFIER_HOST" );
- String JABBER_NOTIFIER_LOGIN = getProperty( "JABBER_NOTIFIER_LOGIN" );
- String JABBER_NOTIFIER_PASSWORD = getProperty( "JABBER_NOTIFIER_PASSWORD" );
- String JABBER_NOTIFIER_ADDRESS = getProperty( "JABBER_NOTIFIER_ADDRESS" );
String newHost = "new_test";
String newLogin = "new_test_login";
String newPassword = "new_password";
String newAddress = "new.test@mail.com";
- showProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
+ showProjectGroup( projectGroupName, projectGroupId, projectGroupDescription );
clickLinkWithText( "Notifiers" );
- assertGroupNotifierPage( TEST_PROJ_GRP_NAME );
- editJabberNotifier( TEST_PROJ_GRP_NAME, null, JABBER_NOTIFIER_HOST, JABBER_NOTIFIER_LOGIN,
- JABBER_NOTIFIER_ADDRESS, newHost, newLogin, newPassword, newAddress, true );
- editJabberNotifier( TEST_PROJ_GRP_NAME, null, newHost, newLogin, newAddress, JABBER_NOTIFIER_HOST,
- JABBER_NOTIFIER_LOGIN, JABBER_NOTIFIER_PASSWORD, JABBER_NOTIFIER_ADDRESS, true );
+ assertGroupNotifierPage( projectGroupName );
+ editJabberNotifier( projectGroupName, null, jabberNotifierHost, jabberNotifierLogin, jabberNotifierAddress,
+ newHost, newLogin, newPassword, newAddress, true );
+ editJabberNotifier( projectGroupName, null, newHost, newLogin, newAddress, jabberNotifierHost,
+ jabberNotifierLogin, jabberNotifierPassword, jabberNotifierAddress, true );
}
@Test( dependsOnMethods = { "testAddValidJabberGroupNotifier" } )
public void testEditInvalidJabberGroupNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
- String TEST_PROJ_GRP_ID = getProperty( "TEST_PROJ_GRP_ID" );
- String TEST_PROJ_GRP_DESCRIPTION = getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
- String JABBER_NOTIFIER_HOST = getProperty( "JABBER_NOTIFIER_HOST" );
- String JABBER_NOTIFIER_LOGIN = getProperty( "JABBER_NOTIFIER_LOGIN" );
- String JABBER_NOTIFIER_ADDRESS = getProperty( "JABBER_NOTIFIER_ADDRESS" );
- showProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- clickLinkWithText( "Notifiers" );
- assertGroupNotifierPage( TEST_PROJ_GRP_NAME );
- editJabberNotifier( TEST_PROJ_GRP_NAME, null, JABBER_NOTIFIER_HOST, JABBER_NOTIFIER_LOGIN,
- JABBER_NOTIFIER_ADDRESS, "", "", "", "", false );
+ showProjectGroup( projectGroupName, projectGroupId, projectGroupDescription );
+ clickLinkWithText( "Notifiers" );
+ assertGroupNotifierPage( projectGroupName );
+ editJabberNotifier( projectGroupName, null, jabberNotifierHost, jabberNotifierLogin, jabberNotifierAddress, "",
+ "", "", "", false );
}
public void testAddInvalidJabberGroupNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
- String TEST_PROJ_GRP_ID = getProperty( "TEST_PROJ_GRP_ID" );
- String TEST_PROJ_GRP_DESCRIPTION = getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
- goToGroupNotifier( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- addJabberNotifier( TEST_PROJ_GRP_NAME, null, "", "", "", "", false );
+ goToGroupNotifier( projectGroupName, projectGroupId, projectGroupDescription );
+ addJabberNotifier( projectGroupName, null, "", "", "", "", false );
assertTextPresent( "Host is required" );
assertTextPresent( "Login is required" );
assertTextPresent( "Password is required" );
@@ -407,27 +372,18 @@ public class NotifierTest
public void testAddValidMsnProjectNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
- String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
- String MSN_NOTIFIER_ADDRESS = getProperty( "MSN_NOTIFIER_ADDRESS" );
- String MSN_NOTIFIER_LOGIN = getProperty( "MSN_NOTIFIER_LOGIN" );
- String MSN_NOTIFIER_PASSWORD = getProperty( "MSN_NOTIFIER_PASSWORD" );
- goToProjectNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME );
- addMsnNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME, MSN_NOTIFIER_LOGIN, MSN_NOTIFIER_PASSWORD,
- MSN_NOTIFIER_ADDRESS, true );
+ goToProjectNotifier( projectGroupName, projectName );
+ addMsnNotifier( projectGroupName, projectName, msnNotifierLogin, msnNotifierPassword, msnNotifierAddress,
+ true );
}
public void testAddMsnProjectNotifierWithInvalidValues()
throws Exception
{
- String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
- String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
- String MSN_NOTIFIER_ADDRESS = "!@#$<>?etc";
- String MSN_NOTIFIER_LOGIN = getProperty( "MSN_NOTIFIER_LOGIN" );
- String MSN_NOTIFIER_PASSWORD = getProperty( "MSN_NOTIFIER_PASSWORD" );
- goToProjectNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME );
- addMsnNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME, MSN_NOTIFIER_LOGIN, MSN_NOTIFIER_PASSWORD,
- MSN_NOTIFIER_ADDRESS, false );
+ String msnNotifierAddress = "!@#$<>?etc";
+ goToProjectNotifier( projectGroupName, projectName );
+ addMsnNotifier( projectGroupName, projectName, msnNotifierLogin, msnNotifierPassword, msnNotifierAddress,
+ false );
assertTextPresent( "Address is invalid" );
}
@@ -435,41 +391,29 @@ public class NotifierTest
public void testEditValidMsnProjectNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
- String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
- String MSN_NOTIFIER_ADDRESS = getProperty( "MSN_NOTIFIER_ADDRESS" );
- String MSN_NOTIFIER_LOGIN = getProperty( "MSN_NOTIFIER_LOGIN" );
- String MSN_NOTIFIER_PASSWORD = getProperty( "MSN_NOTIFIER_PASSWORD" );
String newLogin = "new_test_login";
String newPassword = "new_password";
String newAddress = "new.test@mail.com";
- goToProjectInformationPage( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME );
- editMsnNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME, MSN_NOTIFIER_LOGIN, MSN_NOTIFIER_ADDRESS, newLogin,
- newPassword, newAddress, true );
- editMsnNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME, newLogin, newAddress, MSN_NOTIFIER_LOGIN,
- MSN_NOTIFIER_PASSWORD, MSN_NOTIFIER_ADDRESS, true );
+ goToProjectInformationPage( projectGroupName, projectName );
+ editMsnNotifier( projectGroupName, projectName, msnNotifierLogin, msnNotifierAddress, newLogin, newPassword,
+ newAddress, true );
+ editMsnNotifier( projectGroupName, projectName, newLogin, newAddress, msnNotifierLogin, msnNotifierPassword,
+ msnNotifierAddress, true );
}
@Test( dependsOnMethods = { "testAddValidMsnProjectNotifier" } )
public void testEditInvalidMsnProjectNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
- String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
- String MSN_NOTIFIER_ADDRESS = getProperty( "MSN_NOTIFIER_ADDRESS" );
- String MSN_NOTIFIER_LOGIN = getProperty( "MSN_NOTIFIER_LOGIN" );
- goToProjectInformationPage( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME );
- editMsnNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME, MSN_NOTIFIER_LOGIN, MSN_NOTIFIER_ADDRESS, "", "", "",
- false );
+ goToProjectInformationPage( projectGroupName, projectName );
+ editMsnNotifier( projectGroupName, projectName, msnNotifierLogin, msnNotifierAddress, "", "", "", false );
}
public void testAddInvalidMsnProjectNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
- String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
- goToProjectNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME );
- addMsnNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME, "", "", "", false );
+ goToProjectNotifier( projectGroupName, projectName );
+ addMsnNotifier( projectGroupName, projectName, "", "", "", false );
assertTextPresent( "Login is required" );
assertTextPresent( "Password is required" );
assertTextPresent( "Address is required" );
@@ -478,61 +422,41 @@ public class NotifierTest
public void testAddValidMsnGroupNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
- String TEST_PROJ_GRP_ID = getProperty( "TEST_PROJ_GRP_ID" );
- String TEST_PROJ_GRP_DESCRIPTION = getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
- String MSN_NOTIFIER_ADDRESS = getProperty( "MSN_NOTIFIER_ADDRESS" );
- String MSN_NOTIFIER_LOGIN = getProperty( "MSN_NOTIFIER_LOGIN" );
- String MSN_NOTIFIER_PASSWORD = getProperty( "MSN_NOTIFIER_PASSWORD" );
- goToGroupNotifier( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- addMsnNotifier( TEST_PROJ_GRP_NAME, null, MSN_NOTIFIER_LOGIN, MSN_NOTIFIER_PASSWORD, MSN_NOTIFIER_ADDRESS, true );
+ goToGroupNotifier( projectGroupName, projectGroupId, projectGroupDescription );
+ addMsnNotifier( projectGroupName, null, msnNotifierLogin, msnNotifierPassword, msnNotifierAddress, true );
}
@Test( dependsOnMethods = { "testAddValidMsnGroupNotifier" } )
public void testEditValidMsnGroupNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
- String TEST_PROJ_GRP_ID = getProperty( "TEST_PROJ_GRP_ID" );
- String TEST_PROJ_GRP_DESCRIPTION = getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
- String MSN_NOTIFIER_ADDRESS = getProperty( "MSN_NOTIFIER_ADDRESS" );
- String MSN_NOTIFIER_LOGIN = getProperty( "MSN_NOTIFIER_LOGIN" );
- String MSN_NOTIFIER_PASSWORD = getProperty( "MSN_NOTIFIER_PASSWORD" );
String newLogin = "new_test_login";
String newPassword = "new_password";
String newAddress = "new.test@mail.com";
- showProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
+ showProjectGroup( projectGroupName, projectGroupId, projectGroupDescription );
clickLinkWithText( "Notifiers" );
- assertGroupNotifierPage( TEST_PROJ_GRP_NAME );
- editMsnNotifier( TEST_PROJ_GRP_NAME, null, MSN_NOTIFIER_LOGIN, MSN_NOTIFIER_ADDRESS, newLogin, newPassword,
+ assertGroupNotifierPage( projectGroupName );
+ editMsnNotifier( projectGroupName, null, msnNotifierLogin, msnNotifierAddress, newLogin, newPassword,
newAddress, true );
- editMsnNotifier( TEST_PROJ_GRP_NAME, null, newLogin, newAddress, MSN_NOTIFIER_LOGIN, MSN_NOTIFIER_PASSWORD,
- MSN_NOTIFIER_ADDRESS, true );
+ editMsnNotifier( projectGroupName, null, newLogin, newAddress, msnNotifierLogin, msnNotifierPassword,
+ msnNotifierAddress, true );
}
@Test( dependsOnMethods = { "testAddValidMsnGroupNotifier" } )
public void testEditInvalidMsnGroupNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
- String TEST_PROJ_GRP_ID = getProperty( "TEST_PROJ_GRP_ID" );
- String TEST_PROJ_GRP_DESCRIPTION = getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
- String MSN_NOTIFIER_ADDRESS = getProperty( "MSN_NOTIFIER_ADDRESS" );
- String MSN_NOTIFIER_LOGIN = getProperty( "MSN_NOTIFIER_LOGIN" );
- showProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
+ showProjectGroup( projectGroupName, projectGroupId, projectGroupDescription );
clickLinkWithText( "Notifiers" );
- assertGroupNotifierPage( TEST_PROJ_GRP_NAME );
- editMsnNotifier( TEST_PROJ_GRP_NAME, null, MSN_NOTIFIER_LOGIN, MSN_NOTIFIER_ADDRESS, "", "", "", false );
+ assertGroupNotifierPage( projectGroupName );
+ editMsnNotifier( projectGroupName, null, msnNotifierLogin, msnNotifierAddress, "", "", "", false );
}
public void testAddInvalidMsnGroupNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
- String TEST_PROJ_GRP_ID = getProperty( "TEST_PROJ_GRP_ID" );
- String TEST_PROJ_GRP_DESCRIPTION = getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
- goToGroupNotifier( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- addMsnNotifier( TEST_PROJ_GRP_NAME, null, "", "", "", false );
+ goToGroupNotifier( projectGroupName, projectGroupId, projectGroupDescription );
+ addMsnNotifier( projectGroupName, null, "", "", "", false );
assertTextPresent( "Login is required" );
assertTextPresent( "Password is required" );
assertTextPresent( "Address is required" );
@@ -541,23 +465,16 @@ public class NotifierTest
public void testAddValidWagonProjectNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
- String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
- String WAGON_NOTIFIER_URL = getProperty( "WAGON_NOTIFIER_URL" );
- String WAGON_SERVER_ID = getProperty( "WAGON_SERVER_ID" );
- goToProjectNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME );
- addWagonNotifierPage( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME, WAGON_NOTIFIER_URL, WAGON_SERVER_ID, true );
+ goToProjectNotifier( projectGroupName, projectName );
+ addWagonNotifierPage( projectGroupName, projectName, wagonNotifierUrl, wagonServerId, true );
}
-
+
public void testAddInvalidURLWagonProjectNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
- String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
- String WAGON_NOTIFIER_URL = "!@#$<>?etc";
- String WAGON_SERVER_ID = getProperty( "WAGON_SERVER_ID" );
- goToProjectNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME );
- addWagonNotifierPage( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME, WAGON_NOTIFIER_URL, WAGON_SERVER_ID, false );
+ String wagonNotifierUrl = "!@#$<>?etc";
+ goToProjectNotifier( projectGroupName, projectName );
+ addWagonNotifierPage( projectGroupName, projectName, wagonNotifierUrl, wagonServerId, false );
assertTextPresent( "Destination URL is invalid" );
}
@@ -565,16 +482,11 @@ public class NotifierTest
public void testEditValidWagonProjectNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
- String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
- String WAGON_NOTIFIER_URL = getProperty( "WAGON_NOTIFIER_URL" );
- String WAGON_SERVER_ID = getProperty( "WAGON_SERVER_ID" );
String newId = "newId";
- goToProjectInformationPage( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME );
- editWagonNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME, WAGON_NOTIFIER_URL, WAGON_SERVER_ID,
- WAGON_NOTIFIER_URL, newId,
+ goToProjectInformationPage( projectGroupName, projectName );
+ editWagonNotifier( projectGroupName, projectName, wagonNotifierUrl, wagonServerId, wagonNotifierUrl, newId,
true );
- editWagonNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME, WAGON_NOTIFIER_URL, newId, WAGON_NOTIFIER_URL, WAGON_SERVER_ID,
+ editWagonNotifier( projectGroupName, projectName, wagonNotifierUrl, newId, wagonNotifierUrl, wagonServerId,
true );
}
@@ -582,21 +494,15 @@ public class NotifierTest
public void testEditInvalidWagonProjectNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
- String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
- String WAGON_NOTIFIER_URL = getProperty( "WAGON_NOTIFIER_URL" );
- String WAGON_SERVER_ID = getProperty( "WAGON_SERVER_ID" );
- goToProjectInformationPage( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME );
- editWagonNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME, WAGON_NOTIFIER_URL, WAGON_SERVER_ID, "", "", false );
+ goToProjectInformationPage( projectGroupName, projectName );
+ editWagonNotifier( projectGroupName, projectName, wagonNotifierUrl, wagonServerId, "", "", false );
}
public void testAddInvalidWagonProjectNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
- String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
- goToProjectNotifier( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME );
- addWagonNotifierPage( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME, "", "", false );
+ goToProjectNotifier( projectGroupName, projectName );
+ addWagonNotifierPage( projectGroupName, projectName, "", "", false );
assertTextPresent( "Destination URL is required" );
assertTextPresent( "Server Id is required" );
}
@@ -604,55 +510,37 @@ public class NotifierTest
public void testAddValidWagonGroupNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
- String TEST_PROJ_GRP_ID = getProperty( "TEST_PROJ_GRP_ID" );
- String TEST_PROJ_GRP_DESCRIPTION = getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
- String WAGON_NOTIFIER_URL = getProperty( "WAGON_NOTIFIER_URL" );
- String WAGON_SERVER_ID = getProperty( "WAGON_SERVER_ID" );
- goToGroupNotifier( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- addWagonNotifierPage( TEST_PROJ_GRP_NAME, null, WAGON_NOTIFIER_URL, WAGON_SERVER_ID, true );
+ goToGroupNotifier( projectGroupName, projectGroupId, projectGroupDescription );
+ addWagonNotifierPage( projectGroupName, null, wagonNotifierUrl, wagonServerId, true );
}
@Test( dependsOnMethods = { "testAddValidWagonGroupNotifier" } )
public void testEditValidWagonGroupNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
- String TEST_PROJ_GRP_ID = getProperty( "TEST_PROJ_GRP_ID" );
- String TEST_PROJ_GRP_DESCRIPTION = getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
- String WAGON_NOTIFIER_URL = getProperty( "WAGON_NOTIFIER_URL" );
- String WAGON_SERVER_ID = getProperty( "WAGON_SERVER_ID" );
String newId = "newId";
- showProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
+ showProjectGroup( projectGroupName, projectGroupId, projectGroupDescription );
clickLinkWithText( "Notifiers" );
- assertGroupNotifierPage( TEST_PROJ_GRP_NAME );
- editWagonNotifier( TEST_PROJ_GRP_NAME, null, WAGON_NOTIFIER_URL, WAGON_SERVER_ID, WAGON_NOTIFIER_URL, newId, true );
- editWagonNotifier( TEST_PROJ_GRP_NAME, null, WAGON_NOTIFIER_URL, newId, WAGON_NOTIFIER_URL, WAGON_SERVER_ID, true );
+ assertGroupNotifierPage( projectGroupName );
+ editWagonNotifier( projectGroupName, null, wagonNotifierUrl, wagonServerId, wagonNotifierUrl, newId, true );
+ editWagonNotifier( projectGroupName, null, wagonNotifierUrl, newId, wagonNotifierUrl, wagonServerId, true );
}
@Test( dependsOnMethods = { "testAddValidWagonGroupNotifier" } )
public void testEditInvalidWagonGroupNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
- String TEST_PROJ_GRP_ID = getProperty( "TEST_PROJ_GRP_ID" );
- String TEST_PROJ_GRP_DESCRIPTION = getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
- String WAGON_NOTIFIER_URL = getProperty( "WAGON_NOTIFIER_URL" );
- String WAGON_SERVER_ID = getProperty( "WAGON_SERVER_ID" );
- showProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
+ showProjectGroup( projectGroupName, projectGroupId, projectGroupDescription );
clickLinkWithText( "Notifiers" );
- assertGroupNotifierPage( TEST_PROJ_GRP_NAME );
- editWagonNotifier( TEST_PROJ_GRP_NAME, null, WAGON_NOTIFIER_URL, WAGON_SERVER_ID, "", "", false );
+ assertGroupNotifierPage( projectGroupName );
+ editWagonNotifier( projectGroupName, null, wagonNotifierUrl, wagonServerId, "", "", false );
}
public void testAddInvalidWagonGroupNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
- String TEST_PROJ_GRP_ID = getProperty( "TEST_PROJ_GRP_ID" );
- String TEST_PROJ_GRP_DESCRIPTION = getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
- goToGroupNotifier( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
- addWagonNotifierPage( TEST_PROJ_GRP_NAME, null, "", "", false );
+ goToGroupNotifier( projectGroupName, projectGroupId, projectGroupDescription );
+ addWagonNotifierPage( projectGroupName, null, "", "", false );
assertTextPresent( "Destination URL is required" );
assertTextPresent( "Server Id is required" );
}
@@ -661,26 +549,21 @@ public class NotifierTest
public void testDeleteGroupNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
- String TEST_PROJ_GRP_ID = getProperty( "TEST_PROJ_GRP_ID" );
- String TEST_PROJ_GRP_DESCRIPTION = getProperty( "TEST_PROJ_GRP_DESCRIPTION" );
- showProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION );
+ showProjectGroup( projectGroupName, projectGroupId, projectGroupDescription );
clickLinkWithText( "Notifiers" );
- assertGroupNotifierPage( TEST_PROJ_GRP_NAME );
+ assertGroupNotifierPage( projectGroupName );
clickLinkWithXPath( "(//a[contains(@href,'deleteProjectGroupNotifier') and contains(@href,'mail')])//img" );
assertButtonWithValuePresent( "Delete" );
assertButtonWithValuePresent( "Cancel" );
clickButtonWithValue( "Delete" );
- assertGroupNotifierPage( TEST_PROJ_GRP_NAME );
+ assertGroupNotifierPage( projectGroupName );
}
@Test( dependsOnMethods = { "testEditValidMailProjectNotifier", "testEditInvalidMailProjectNotifier" } )
public void testDeleteProjectNotifier()
throws Exception
{
- String TEST_PROJ_GRP_NAME = getProperty( "TEST_PROJ_GRP_NAME" );
- String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
- goToProjectInformationPage( TEST_PROJ_GRP_NAME, M2_PROJ_GRP_NAME );
+ goToProjectInformationPage( projectGroupName, projectName );
// Delete
clickLinkWithXPath( "(//a[contains(@href,'deleteProjectNotifier') and contains(@href,'mail')])//img" );
assertButtonWithValuePresent( "Delete" );
@@ -688,4 +571,430 @@ public class NotifierTest
clickButtonWithValue( "Delete" );
assertProjectInformationPage();
}
+
+ protected void assertGroupNotifierPage( String projectGroupName )
+ {
+ assertTextPresent( "Project Group Notifiers of group " + projectGroupName );
+ }
+
+ void assertAddNotifierPage()
+ {
+ assertPage( "Continuum - Add Notifier" );
+ assertTextPresent( "Add Notifier" );
+ assertTextPresent( "Type" );
+ assertElementPresent( "notifierType" );
+ assertElementPresent( "Cancel" );
+ }
+
+ void assertAddEditMailNotifierPage()
+ {
+ assertPage( "Continuum - Add/Edit Mail Notifier" );
+ assertTextPresent( "Add/Edit Mail Notifier" );
+ assertTextPresent( "Mail Recipient Address" );
+ assertTextPresent( "Send a mail to latest committers" );
+ assertTextPresent( "Send on Success" );
+ assertTextPresent( "Send on Failure" );
+ assertTextPresent( "Send on Error" );
+ assertTextPresent( "Send on Warning" );
+ assertTextPresent( "Send on SCM Failure" );
+ assertElementPresent( "address" );
+ assertElementPresent( "Cancel" );
+ }
+
+ 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( "Alternate Nick Name" );
+ assertElementPresent( "alternateNick" );
+
+ assertTextPresent( "User Name" );
+ assertElementPresent( "username" );
+
+ assertTextPresent( "Full Name" );
+ assertElementPresent( "fullName" );
+
+ assertTextPresent( "Password" );
+ assertElementPresent( "password" );
+
+ assertTextPresent( "SSL" );
+ assertTextPresent( "Send on Success" );
+ assertTextPresent( "Send on Failure" );
+ assertTextPresent( "Send on Error" );
+ assertTextPresent( "Send on Warning" );
+ assertTextPresent( "Send on SCM Failure" );
+ }
+
+ 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" );
+ assertTextPresent( "Send on SCM Failure" );
+ }
+
+ 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" );
+ assertTextPresent( "Send on SCM Failure" );
+ }
+
+ void assertAddEditWagonPage()
+ {
+ assertPage( "Continuum - Add/Edit Wagon Notifier" );
+
+ assertTextPresent( "Project Site URL" );
+ assertTextPresent( "Server Id (defined in your settings.xml for authentication)" );
+ assertElementPresent( "url" );
+ assertElementPresent( "id" );
+ assertTextPresent( "Send on Success" );
+ assertTextPresent( "Send on Failure" );
+ assertTextPresent( "Send on Error" );
+ assertTextPresent( "Send on Warning" );
+ }
+
+ protected void goToGroupNotifier( String projectGroupName, String projectGroupId, String projectGroupDescription )
+ {
+ showProjectGroup( projectGroupName, projectGroupId, projectGroupDescription );
+ clickLinkWithText( "Notifiers" );
+ assertGroupNotifierPage( projectGroupName );
+ clickButtonWithValue( "Add" );
+ assertAddNotifierPage();
+ }
+
+ protected void goToProjectNotifier( String projectGroupName, String projectName )
+ {
+ goToProjectInformationPage( projectGroupName, projectName );
+ clickLinkWithXPath( "//input[contains(@id,'addProjectNotifier') and @type='submit']" );
+ assertAddNotifierPage();
+ }
+
+ protected void addMailNotifier( String projectGroupName, String projectName, String email, boolean isValid )
+ {
+ selectValue( "//select", "Mail" );
+ clickButtonWithValue( "Submit" );
+ assertAddEditMailNotifierPage();
+ setFieldValue( "address", email );
+ clickButtonWithValue( "Save" );
+
+ if ( !isValid )
+ {
+ assertTextPresent( "Address is invalid" );
+ }
+ else if ( projectName != null )
+ {
+ assertProjectInformationPage();
+ }
+ else
+ {
+ assertGroupNotifierPage( projectGroupName );
+ }
+ }
+
+ protected void editMailNotifier( String projectGroupName, String projectName, String oldMail, String newMail,
+ boolean isValid )
+ {
+ if ( projectName == null )
+ {
+ clickLinkWithXPath( "(//a[contains(@href,'editProjectGroupNotifier') and contains(@href,'mail')])//img" );
+ }
+ else
+ {
+ clickLinkWithXPath( "(//a[contains(@href,'editProjectNotifier') and contains(@href,'mail')])//img" );
+ }
+ assertAddEditMailNotifierPage();
+ assertFieldValue( oldMail, "address" );
+ setFieldValue( "address", newMail );
+ clickButtonWithValue( "Save" );
+
+ if ( !isValid )
+ {
+ assertTextPresent( "Address is invalid" );
+ }
+ else if ( projectName != null )
+ {
+ assertProjectInformationPage();
+ }
+ else
+ {
+ assertGroupNotifierPage( projectGroupName );
+ }
+ }
+
+ protected void addIrcNotifier( String projectGroupName, String projectName, String host, String channel,
+ boolean isValid )
+ {
+ selectValue( "//select", "IRC" );
+ clickButtonWithValue( "Submit" );
+ assertAddEditIrcNotifierPage();
+ setFieldValue( "host", host );
+ setFieldValue( "channel", channel );
+
+ clickButtonWithValue( "Save" );
+ if ( isValid )
+ {
+ if ( projectName != null )
+ {
+ assertProjectInformationPage();
+ }
+ else
+ {
+ assertGroupNotifierPage( projectGroupName );
+ }
+ }
+ }
+
+ protected void editIrcNotifier( String projectGroupName, String projectName, String oldHost, String oldChannel,
+ String newHost, String newChannel, boolean isValid )
+ {
+ if ( projectName == null )
+ {
+ clickLinkWithXPath( "(//a[contains(@href,'editProjectGroupNotifier') and contains(@href,'irc')])//img" );
+ }
+ else
+ {
+ clickLinkWithXPath( "(//a[contains(@href,'editProjectNotifier') and contains(@href,'irc')])//img" );
+ }
+ assertAddEditIrcNotifierPage();
+ assertFieldValue( oldHost, "host" );
+ assertFieldValue( oldChannel, "channel" );
+ setFieldValue( "host", newHost );
+ setFieldValue( "channel", newChannel );
+ clickButtonWithValue( "Save" );
+
+ if ( !isValid )
+ {
+ assertTextPresent( "Host is required" );
+ assertTextPresent( "Channel is required" );
+ }
+ else if ( projectName != null )
+ {
+ assertProjectInformationPage();
+ }
+ else
+ {
+ assertGroupNotifierPage( projectGroupName );
+ }
+ }
+
+ protected void addJabberNotifier( String projectGroupName, String projectName, String host, String login,
+ String password, String address, boolean isValid )
+ {
+ selectValue( "//select", "Jabber" );
+ clickButtonWithValue( "Submit" );
+ assertAddEditJabberPage();
+ setFieldValue( "host", host );
+ setFieldValue( "login", login );
+ setFieldValue( "password", password );
+ setFieldValue( "address", address );
+ clickButtonWithValue( "Save" );
+
+ if ( isValid )
+ {
+ if ( projectName != null )
+ {
+ assertProjectInformationPage();
+ }
+ else
+ {
+ assertGroupNotifierPage( projectGroupName );
+ }
+ }
+ }
+
+ protected void editJabberNotifier( String projectGroupName, String projectName, String oldHost, String oldLogin,
+ String oldAddress, String newHost, String newLogin, String newPassword,
+ String newAddress, boolean isValid )
+ {
+ if ( projectName == null )
+ {
+ clickLinkWithXPath( "(//a[contains(@href,'editProjectGroupNotifier') and contains(@href,'jabber')])//img" );
+ }
+ else
+ {
+ clickLinkWithXPath( "(//a[contains(@href,'editProjectNotifier') and contains(@href,'jabber')])//img" );
+ }
+ assertAddEditJabberPage();
+ assertFieldValue( oldHost, "host" );
+ assertFieldValue( oldLogin, "login" );
+ assertFieldValue( oldAddress, "address" );
+ setFieldValue( "host", newHost );
+ setFieldValue( "login", newLogin );
+ setFieldValue( "password", newPassword );
+ setFieldValue( "address", newAddress );
+ clickButtonWithValue( "Save" );
+
+ if ( !isValid )
+ {
+ assertTextPresent( "Host is required" );
+ assertTextPresent( "Login is required" );
+ assertTextPresent( "Password is required" );
+ assertTextPresent( "Address is required" );
+ }
+ else if ( projectName != null )
+ {
+ assertProjectInformationPage();
+ }
+ else
+ {
+ assertGroupNotifierPage( projectGroupName );
+ }
+ }
+
+ protected void addMsnNotifier( String projectGroupName, String projectName, String login, String password,
+ String recipientAddress, boolean isValid )
+ {
+ selectValue( "//select", "MSN" );
+ clickButtonWithValue( "Submit" );
+ assertAddEditMsnPage();
+ setFieldValue( "login", login );
+ setFieldValue( "password", password );
+ setFieldValue( "address", recipientAddress );
+ clickButtonWithValue( "Save" );
+
+ if ( isValid )
+ {
+ if ( projectName != null )
+ {
+ assertProjectInformationPage();
+ }
+ else
+ {
+ assertGroupNotifierPage( projectGroupName );
+ }
+ }
+ }
+
+ protected void editMsnNotifier( String projectGroupName, String projectName, String oldLogin, String oldAddress,
+ String newLogin, String newPassword, String newAddress, boolean isValid )
+ {
+ if ( projectName == null )
+ {
+ clickLinkWithXPath( "(//a[contains(@href,'editProjectGroupNotifier') and contains(@href,'msn')])//img" );
+ }
+ else
+ {
+ clickLinkWithXPath( "(//a[contains(@href,'editProjectNotifier') and contains(@href,'msn')])//img" );
+ }
+ assertAddEditMsnPage();
+ assertFieldValue( oldLogin, "login" );
+ assertFieldValue( oldAddress, "address" );
+ setFieldValue( "login", newLogin );
+ setFieldValue( "password", newPassword );
+ setFieldValue( "address", newAddress );
+ clickButtonWithValue( "Save" );
+
+ if ( !isValid )
+ {
+ assertTextPresent( "Login is required" );
+ assertTextPresent( "Password is required" );
+ assertTextPresent( "Address is required" );
+ }
+ else if ( projectName != null )
+ {
+ assertProjectInformationPage();
+ }
+ else
+ {
+ assertGroupNotifierPage( projectGroupName );
+ }
+ }
+
+ protected void addWagonNotifierPage( String projectGroupName, String projectName, String siteUrl, String serverId,
+ boolean isValid )
+ {
+ selectValue( "//select", "Wagon" );
+ clickButtonWithValue( "Submit" );
+ assertAddEditWagonPage();
+ setFieldValue( "url", siteUrl );
+ setFieldValue( "id", serverId );
+ clickButtonWithValue( "Save" );
+
+ if ( isValid )
+ {
+ if ( projectName != null )
+ {
+ assertProjectInformationPage();
+ }
+ else
+ {
+ assertGroupNotifierPage( projectGroupName );
+ }
+ }
+ }
+
+ protected void editWagonNotifier( String projectGroupName, String projectName, String oldUrl, String oldId,
+ String newUrl, String newId, boolean isValid )
+ {
+ if ( projectName == null )
+ {
+ clickLinkWithXPath( "(//a[contains(@href,'editProjectGroupNotifier') and contains(@href,'wagon')])//img" );
+ }
+ else
+ {
+ clickLinkWithXPath( "(//a[contains(@href,'editProjectNotifier') and contains(@href,'wagon')])//img" );
+ }
+ assertAddEditWagonPage();
+ assertFieldValue( oldUrl, "url" );
+ assertFieldValue( oldId, "id" );
+ setFieldValue( "url", newUrl );
+ setFieldValue( "id", newId );
+ clickButtonWithValue( "Save" );
+
+ if ( !isValid )
+ {
+ assertTextPresent( "Destination URL is required" );
+ assertTextPresent( "Server Id is required" );
+ }
+ else if ( projectName != null )
+ {
+ assertProjectInformationPage();
+ }
+ else
+ {
+ assertGroupNotifierPage( projectGroupName );
+ }
+ }
}