JBoss Portal SVN: r13345 - branches/Enterprise_Portal_Platform_4_3_GA_CP01_JBEPP-78/testsuite/ui-tests/src/org/jboss/portal/test/selenium.
by portal-commits@lists.jboss.org
Author: mageshbk(a)jboss.com
Date: 2009-05-13 02:08:26 -0400 (Wed, 13 May 2009)
New Revision: 13345
Modified:
branches/Enterprise_Portal_Platform_4_3_GA_CP01_JBEPP-78/testsuite/ui-tests/src/org/jboss/portal/test/selenium/IdentityAdminTestCase.java
Log:
[JBEPP-79] Enabled tests
Modified: branches/Enterprise_Portal_Platform_4_3_GA_CP01_JBEPP-78/testsuite/ui-tests/src/org/jboss/portal/test/selenium/IdentityAdminTestCase.java
===================================================================
--- branches/Enterprise_Portal_Platform_4_3_GA_CP01_JBEPP-78/testsuite/ui-tests/src/org/jboss/portal/test/selenium/IdentityAdminTestCase.java 2009-05-13 05:11:57 UTC (rev 13344)
+++ branches/Enterprise_Portal_Platform_4_3_GA_CP01_JBEPP-78/testsuite/ui-tests/src/org/jboss/portal/test/selenium/IdentityAdminTestCase.java 2009-05-13 06:08:26 UTC (rev 13345)
@@ -118,14 +118,14 @@
* }
*/
- @Test(enabled = false, description = "Creation of new user.")
+ @Test(enabled = true, description = "Creation of new user.")
public void testCreateUser() {
createUser("tempUser", "tempPassword", "tempUser(a)redhat.com");
searchUser("tempUser", "tempUser(a)redhat.com");
deleteUser("tempUser", "tempUser(a)redhat.com");
}
- @Test(enabled = false, dependsOnMethods = { "testCreateUser" }, description = "Creation of already existing user.")
+ @Test(enabled = true, dependsOnMethods = { "testCreateUser" }, description = "Creation of already existing user.")
public void testCreateExistingUser() {
createUser("tempUser", "tempPassword", "tempUser(a)redhat.com");
searchUser("tempUser", "tempUser(a)redhat.com");
@@ -133,20 +133,20 @@
deleteUser("tempUser", "tempUser(a)redhat.com");
}
- @Test(enabled = false, description = "Creation of new role.")
+ @Test(enabled = true, description = "Creation of new role.")
public void testCreateRole() {
String role = "tempRole";
createRole(role, "tempRoleDisplay");
deleteRole(role);
}
- @Test(enabled = false, description = "Creating and deteling a user.")
+ @Test(enabled = true, description = "Creating and deteling a user.")
public void testDeleteUser() {
createUser("deleteMe", "deleterPass", "disableMe(a)redhat.com");
deleteUser("deleteMe", "disableMe(a)redhat.com");
}
- @Test(enabled = false, description = "Creating and disabling a user.")
+ @Test(enabled = true, description = "Creating and disabling a user.")
public void testDisableUser() {
final String userName = "disableMe";
final String userPass = "disablePass";
@@ -194,7 +194,7 @@
deleteUser(userName, userMail);
}
- @Test(enabled = false, dependsOnMethods = { "testDisableUser" }, description = "Enabling disabled user.")
+ @Test(enabled = true, dependsOnMethods = { "testDisableUser" }, description = "Enabling disabled user.")
public void testEnableUser() {
final String userName = "enableMe";
final String userPass = "enableMe";
@@ -224,7 +224,7 @@
deleteUser(userName, userMail);
}
- @Test(enabled = false, description = "Editing a user.")
+ @Test(enabled = true, description = "Editing a user.")
public void testEditUser() {
final String userName = "editMe";
final String userPass = "editPass";
@@ -279,7 +279,7 @@
}
- @Test(enabled = false, description = "Editing a user - changing of password.")
+ @Test(enabled = true, description = "Editing a user - changing of password.")
public void testEditUserChangePassword() {
final String userName = "changePass";
final String userPass = "changePassPass";
@@ -338,7 +338,7 @@
deleteUser(userName, userMail);
}
- @Test(enabled = false, description = "Managing members of role.")
+ @Test(enabled = true, description = "Managing members of role.")
public void testRoleMembers() {
final String roleName = "membersRole";
final String roleDisplayName = "membersRoleDisplay";
@@ -377,7 +377,7 @@
deleteUser(userName, userMail);
}
- @Test(enabled = false, description = "Creation of new role.")
+ @Test(enabled = true, description = "Creation of new role.")
public void testRoleEdit() {
final String roleName = "editRole";
final String roleDisplayName = "editRoleDisplay";
@@ -429,7 +429,7 @@
deleteRole(roleName);
}
- @Test(enabled = false)
+ @Test(enabled = true)
public void testManyUsers() {
for (int i = 0; i < 25; i++) {
createUser("user0" + i + "", "useruser", "user0" + i + "" + "@portal.com");
@@ -469,7 +469,7 @@
}
- @Test(enabled = false, dependsOnMethods = { "testCreateUser", "testCreateRole" }, description = "Assigning of the role to the user.")
+ @Test(enabled = true, dependsOnMethods = { "testCreateUser", "testCreateRole" }, description = "Assigning of the role to the user.")
public void testAssignRole2User() {
String user = "tempUser";
String userMail = "tempUser(a)redhat.com";
15 years
JBoss Portal SVN: r13344 - branches/Enterprise_Portal_Platform_4_3_GA_CP01_JBEPP-78/testsuite/ui-tests/src/org/jboss/portal/test/selenium.
by portal-commits@lists.jboss.org
Author: mageshbk(a)jboss.com
Date: 2009-05-13 01:11:57 -0400 (Wed, 13 May 2009)
New Revision: 13344
Modified:
branches/Enterprise_Portal_Platform_4_3_GA_CP01_JBEPP-78/testsuite/ui-tests/src/org/jboss/portal/test/selenium/IdentityAdminTestCase.java
Log:
[JBEPP-79] Added wait for pageLoad
Modified: branches/Enterprise_Portal_Platform_4_3_GA_CP01_JBEPP-78/testsuite/ui-tests/src/org/jboss/portal/test/selenium/IdentityAdminTestCase.java
===================================================================
--- branches/Enterprise_Portal_Platform_4_3_GA_CP01_JBEPP-78/testsuite/ui-tests/src/org/jboss/portal/test/selenium/IdentityAdminTestCase.java 2009-05-12 13:34:56 UTC (rev 13343)
+++ branches/Enterprise_Portal_Platform_4_3_GA_CP01_JBEPP-78/testsuite/ui-tests/src/org/jboss/portal/test/selenium/IdentityAdminTestCase.java 2009-05-13 05:11:57 UTC (rev 13344)
@@ -118,14 +118,14 @@
* }
*/
- @Test(enabled = true, description = "Creation of new user.")
+ @Test(enabled = false, description = "Creation of new user.")
public void testCreateUser() {
createUser("tempUser", "tempPassword", "tempUser(a)redhat.com");
searchUser("tempUser", "tempUser(a)redhat.com");
deleteUser("tempUser", "tempUser(a)redhat.com");
}
- @Test(enabled = true, dependsOnMethods = { "testCreateUser" }, description = "Creation of already existing user.")
+ @Test(enabled = false, dependsOnMethods = { "testCreateUser" }, description = "Creation of already existing user.")
public void testCreateExistingUser() {
createUser("tempUser", "tempPassword", "tempUser(a)redhat.com");
searchUser("tempUser", "tempUser(a)redhat.com");
@@ -133,20 +133,20 @@
deleteUser("tempUser", "tempUser(a)redhat.com");
}
- @Test(enabled = true, description = "Creation of new role.")
+ @Test(enabled = false, description = "Creation of new role.")
public void testCreateRole() {
String role = "tempRole";
createRole(role, "tempRoleDisplay");
deleteRole(role);
}
- @Test(enabled = true, description = "Creating and deteling a user.")
+ @Test(enabled = false, description = "Creating and deteling a user.")
public void testDeleteUser() {
createUser("deleteMe", "deleterPass", "disableMe(a)redhat.com");
deleteUser("deleteMe", "disableMe(a)redhat.com");
}
- @Test(enabled = true, description = "Creating and disabling a user.")
+ @Test(enabled = false, description = "Creating and disabling a user.")
public void testDisableUser() {
final String userName = "disableMe";
final String userPass = "disablePass";
@@ -194,7 +194,7 @@
deleteUser(userName, userMail);
}
- @Test(enabled = true, dependsOnMethods = { "testDisableUser" }, description = "Enabling disabled user.")
+ @Test(enabled = false, dependsOnMethods = { "testDisableUser" }, description = "Enabling disabled user.")
public void testEnableUser() {
final String userName = "enableMe";
final String userPass = "enableMe";
@@ -224,7 +224,7 @@
deleteUser(userName, userMail);
}
- @Test(enabled = true, description = "Editing a user.")
+ @Test(enabled = false, description = "Editing a user.")
public void testEditUser() {
final String userName = "editMe";
final String userPass = "editPass";
@@ -279,7 +279,7 @@
}
- @Test(enabled = true, description = "Editing a user - changing of password.")
+ @Test(enabled = false, description = "Editing a user - changing of password.")
public void testEditUserChangePassword() {
final String userName = "changePass";
final String userPass = "changePassPass";
@@ -338,7 +338,7 @@
deleteUser(userName, userMail);
}
- @Test(enabled = true, description = "Managing members of role.")
+ @Test(enabled = false, description = "Managing members of role.")
public void testRoleMembers() {
final String roleName = "membersRole";
final String roleDisplayName = "membersRoleDisplay";
@@ -377,7 +377,7 @@
deleteUser(userName, userMail);
}
- @Test(enabled = true, description = "Creation of new role.")
+ @Test(enabled = false, description = "Creation of new role.")
public void testRoleEdit() {
final String roleName = "editRole";
final String roleDisplayName = "editRoleDisplay";
@@ -444,9 +444,11 @@
}
searchSimple("man", "10");
+ selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertEquals(countTableRows(TBL_USERLIST) - 1, 10, "Wrong number of row in user table #1.");
searchSimple("man", "50");
+ selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertEquals(countTableRows(TBL_USERLIST) - 1, 50, "Wrong number of row in user table #2.");
selenium.click(INP_USER_SEARCH_NEXT);
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -456,6 +458,7 @@
Assert.assertEquals(countTableRows(TBL_USERLIST) - 1, 50, "Wrong number of row in user table #2.");
searchSimple("man", "100");
+ selenium.waitForPageToLoad(PAGE_LOAD);
//selenium.setSpeed("60000");
Assert.assertEquals(countTableRows(TBL_USERLIST) - 1, 95, "Wrong number of row in user table #4.");
//selenium.setSpeed("0");
@@ -466,7 +469,7 @@
}
- @Test(enabled = true, dependsOnMethods = { "testCreateUser", "testCreateRole" }, description = "Assigning of the role to the user.")
+ @Test(enabled = false, dependsOnMethods = { "testCreateUser", "testCreateRole" }, description = "Assigning of the role to the user.")
public void testAssignRole2User() {
String user = "tempUser";
String userMail = "tempUser(a)redhat.com";
15 years
JBoss Portal SVN: r13343 - in branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests: src/org/jboss/portal/test/selenium/cms and 1 other directory.
by portal-commits@lists.jboss.org
Author: vrockai
Date: 2009-05-12 09:34:56 -0400 (Tue, 12 May 2009)
New Revision: 13343
Modified:
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/build.xml
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/run.sh
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSArchiveUploadTestCase.java
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/testng.xml
Log:
[selenium] run.sh workspace property fix
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/build.xml 2009-05-12 13:20:33 UTC (rev 13342)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/build.xml 2009-05-12 13:34:56 UTC (rev 13343)
@@ -3,7 +3,7 @@
<property environment="env" />
- <property name="workspace" location="build.xml" />
+ <property name="workspace" location="." />
<property name="java.home" location="${env.JAVA_HOME}" />
<property name="suitename" location="testng-files" />
@@ -66,6 +66,7 @@
<target name="init">
<echo message="Browser : ${browser}" />
<echo message="Screenshot : ${screenshot}" />
+ <echo message="Workspace : ${workspace}" />
<echo message="Deleting testng report directory" />
<delete dir="${testng.output.dir}" />
<delete dir="${testng.debug.dir}" />
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/run.sh
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/run.sh 2009-05-12 13:20:33 UTC (rev 13342)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/run.sh 2009-05-12 13:34:56 UTC (rev 13343)
@@ -47,7 +47,7 @@
exit 0;
fi
ant -f build.xml copyApps
- ant -f build.xml selenium-test -Dbrowser="*firefox $2" -Dworkspace="/home/vrockai/workspace/ui-tests/" -Dscreenshot="true" -Dhtml-src="true" -Ddebug="true"
+ ant -f build.xml selenium-test -Dbrowser="*firefox $2" -Dscreenshot="true" -Dhtml-src="true" -Ddebug="true"
elif [ $1 = "end2end" ]; then
if [ -z "$2" -o ! -f "$2" ]; then
echo
@@ -55,7 +55,7 @@
exit 0;
fi
ant -f build.xml copyApps
- ant -f build.xml selenium-usecase -Dbrowser="*firefox $2" -Dworkspace="/home/vrockai/workspace/ui-tests/" -Dscreenshot="true" -Dhtml-src="true" -Ddebug="true"
+ ant -f build.xml selenium-usecase -Dbrowser="*firefox $2" -Dscreenshot="true" -Dhtml-src="true" -Ddebug="true"
elif [ $1 = "perf" ]; then
if [ -z "$2" -o ! -f "$2" ]; then
echo
@@ -63,7 +63,7 @@
exit 0;
fi
ant -f build.xml copyApps
- ant -f build.xml selenium-test -Dbrowser="*firefox $2" -Dworkspace="/home/vrockai/workspace/ui-tests/" -Dscreenshot="true" -Dhtml-src="true" -Ddebug="true"
+ ant -f build.xml selenium-test -Dbrowser="*firefox $2" -Dscreenshot="true" -Dhtml-src="true" -Ddebug="true"
elif [ $1 = "selenium" ]; then
ant -f build.xml run-src
elif [ $1 = "single" ]; then
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSArchiveUploadTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSArchiveUploadTestCase.java 2009-05-12 13:20:33 UTC (rev 13342)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSArchiveUploadTestCase.java 2009-05-12 13:34:56 UTC (rev 13343)
@@ -18,7 +18,7 @@
/** The constant defining the wait time (in ms) between attempts when checking if the file was uploaded. */
- public static final int ARCHIVE_WAITING = 5000;
+ public static final int ARCHIVE_WAITING = 1000;
/** The constant defining the the number of attempts when checking if the file was uploaded. */
public static final int ATTEMPTS = 50;
@@ -76,6 +76,9 @@
selenium.select(SEL_ACTION, "label=Upload Archive");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.waitForPopUp("_top", PAGE_LOAD);
+
+ debugPrint("CMSArchiveUploadTestCase archive location: "+WORKSPACE + "/test_files/archive.zip");
+
selenium.type(INP_ARCHIVE_FILE, WORKSPACE + "/test_files/archive.zip");
selenium.click(SUB_CANCEL_ARCH_UPLOAD);
@@ -147,6 +150,9 @@
selenium.select(SEL_ACTION, "label=Upload Archive");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.waitForPopUp("_top", PAGE_LOAD);
+
+ debugPrint("CMSArchiveUploadTestCase archive location: "+WORKSPACE + "/test_files/many_files.zip");
+
selenium.type(INP_ARCHIVE_FILE, WORKSPACE + "/test_files/many_files.zip");
selenium.click(SUB_SEND_ARCHIVE);
@@ -197,6 +203,8 @@
selenium.select(SEL_ACTION, "label=Upload Archive");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.waitForPopUp("_top", PAGE_LOAD);
+
+ debugPrint("CMSArchiveUploadTestCase archive location: "+ WORKSPACE + "/test_files/big_archive.zip");
selenium.type(INP_ARCHIVE_FILE, WORKSPACE + "/test_files/big_archive.zip");
selenium.click(SUB_SEND_ARCHIVE);
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/testng.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/testng.xml 2009-05-12 13:20:33 UTC (rev 13342)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/testng.xml 2009-05-12 13:34:56 UTC (rev 13343)
@@ -1,6 +1,6 @@
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="SeleniumTest">
-
+<!--
<test verbose="2" name="org.jboss.portal.test.selenium.UserLoginTestCase" annotations="JDK">
<classes>
<class name="org.jboss.portal.test.selenium.UserLoginTestCase"/>
@@ -117,7 +117,7 @@
<classes>
<class name="org.jboss.portal.test.selenium.portal.EndtoEndPortalAdminTestCase"></class></classes>
</test>
-
+-->
<test name="org.jboss.portal.test.selenium.cms.CMSArchiveUploadTestCase"
verbose="2" annotations="JDK">
<classes>
15 years
JBoss Portal SVN: r13342 - branches/Enterprise_Portal_Platform_4_3_GA_CP01_JBEPP-78/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms.
by portal-commits@lists.jboss.org
Author: mageshbk(a)jboss.com
Date: 2009-05-12 09:20:33 -0400 (Tue, 12 May 2009)
New Revision: 13342
Modified:
branches/Enterprise_Portal_Platform_4_3_GA_CP01_JBEPP-78/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSSecureTestCase.java
Log:
[JBEPP-79] Comparison text changed in EPP
Modified: branches/Enterprise_Portal_Platform_4_3_GA_CP01_JBEPP-78/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSSecureTestCase.java
===================================================================
--- branches/Enterprise_Portal_Platform_4_3_GA_CP01_JBEPP-78/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSSecureTestCase.java 2009-05-12 13:15:14 UTC (rev 13341)
+++ branches/Enterprise_Portal_Platform_4_3_GA_CP01_JBEPP-78/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSSecureTestCase.java 2009-05-12 13:20:33 UTC (rev 13342)
@@ -118,7 +118,7 @@
public void testSetAdminReadPer() {
login("admin", "admin");
- Assert.assertFalse(selenium.isTextPresent("Access to this resource is denied"), "Non secured resource is not visible.#1");
+ Assert.assertFalse(selenium.isTextPresent("Access Denied"), "Non secured resource is not visible.#1");
Assert.assertFalse(selenium.isTextPresent("You are not allowed to access the following resource - /default/index.html"),
"Non secured resource is not visible.#2");
@@ -142,10 +142,10 @@
logout();
- Assert.assertTrue(selenium.isTextPresent("Access to this resource is denied"), "Secured resource is visible.#1");
+ Assert.assertTrue(selenium.isTextPresent("Access Denied"), "Secured resource is visible.#1");
login("user", "user");
- Assert.assertTrue(selenium.isTextPresent("Access to this resource is denied"), "Secured resource is visible.#2");
+ Assert.assertTrue(selenium.isTextPresent("Access Denied"), "Secured resource is visible.#2");
logout();
}
@@ -157,7 +157,7 @@
login("admin", "admin");
- Assert.assertFalse(selenium.isTextPresent("Access to this resource is denied"), "Non secured resource is not visible.#1");
+ Assert.assertFalse(selenium.isTextPresent("Access Denied"), "Non secured resource is not visible.#1");
Assert.assertFalse(selenium.isTextPresent("You are not allowed to access the following resource - /default/index.html"),
"Non secured resource is not visible.#2");
@@ -182,7 +182,7 @@
login("admin", "admin");
- Assert.assertFalse(selenium.isTextPresent("Access to this resource is denied "), "Non secured resource is not visible.#1");
+ Assert.assertFalse(selenium.isTextPresent("Access Denied"), "Non secured resource is not visible.#1");
selenium.click(LNK_ADMIN);
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -201,10 +201,10 @@
logout();
- Assert.assertTrue(selenium.isTextPresent("Access to this resource is denied "), "Secured resource is visible.#1");
+ Assert.assertTrue(selenium.isTextPresent("Access Denied"), "Secured resource is visible.#1");
login("user", "user");
- Assert.assertFalse(selenium.isTextPresent("Access to this resource is denied "), "Secured resource is visible.#2");
+ Assert.assertFalse(selenium.isTextPresent("Access Denied"), "Secured resource is visible.#2");
logout();
}
@@ -215,7 +215,7 @@
assignRole("user", "user(a)portal.com", "secRole", "secRoleDisp");
- Assert.assertFalse(selenium.isTextPresent("Access to this resource is denied"), "Non secured resource is not visible.#1");
+ Assert.assertFalse(selenium.isTextPresent("Access Denied"), "Non secured resource is not visible.#1");
Assert.assertFalse(selenium.isTextPresent("You are not allowed to access the following resource - /default/index.html"),
"Non secured resource is not visible.#2");
@@ -236,10 +236,10 @@
logout();
- Assert.assertTrue(selenium.isTextPresent("Access to this resource is denied"), "Secured resource is visible after logout.");
+ Assert.assertTrue(selenium.isTextPresent("Access Denied"), "Secured resource is visible after logout.");
login("user", "user");
- Assert.assertFalse(selenium.isTextPresent("Access to this resource is denied"), "Non secured resource is not visible for the \"user\".");
+ Assert.assertFalse(selenium.isTextPresent("Access Denied"), "Non secured resource is not visible for the \"user\".");
logout();
}
@@ -250,7 +250,7 @@
deassignRole("user", "user(a)portal.com", "secRole", "secRoleDisp");
- Assert.assertFalse(selenium.isTextPresent("Access to this resource is denied"));
+ Assert.assertFalse(selenium.isTextPresent("Access Denied"));
Assert.assertFalse(selenium.isTextPresent("You are not allowed to access the following resource - /default/index.html"));
selenium.click(LNK_ADMIN);
@@ -270,11 +270,11 @@
logout();
- Assert.assertTrue(selenium.isTextPresent("Access to this resource is denied"));
+ Assert.assertTrue(selenium.isTextPresent("Access Denied"));
login("user", "user");
- Assert.assertTrue(selenium.isTextPresent("Access to this resource is denied"));
+ Assert.assertTrue(selenium.isTextPresent("Access Denied"));
logout();
}
15 years
JBoss Portal SVN: r13341 - branches/Enterprise_Portal_Platform_4_3_GA_CP01_JBEPP-78/testsuite/ui-tests.
by portal-commits@lists.jboss.org
Author: mageshbk(a)jboss.com
Date: 2009-05-12 09:15:14 -0400 (Tue, 12 May 2009)
New Revision: 13341
Modified:
branches/Enterprise_Portal_Platform_4_3_GA_CP01_JBEPP-78/testsuite/ui-tests/testng.xml
Log:
[JBEPP-79] Coordination does not work in EPP, disabling it
Modified: branches/Enterprise_Portal_Platform_4_3_GA_CP01_JBEPP-78/testsuite/ui-tests/testng.xml
===================================================================
--- branches/Enterprise_Portal_Platform_4_3_GA_CP01_JBEPP-78/testsuite/ui-tests/testng.xml 2009-05-12 13:12:20 UTC (rev 13340)
+++ branches/Enterprise_Portal_Platform_4_3_GA_CP01_JBEPP-78/testsuite/ui-tests/testng.xml 2009-05-12 13:15:14 UTC (rev 13341)
@@ -51,13 +51,13 @@
<classes>
<class name="org.jboss.portal.test.selenium.portal.PortletInstancesTestCase"></class></classes>
</test>
-
+<!--
<test name="org.jboss.portal.test.selenium.portal.PageCoordinationTestCase"
verbose="2" annotations="JDK">
<classes>
<class name="org.jboss.portal.test.selenium.portal.PageCoordinationTestCase"></class></classes>
</test>
-
+-->
<test name="org.jboss.portal.test.selenium.cms.CMSFileTestCase"
verbose="2" annotations="JDK">
<classes>
@@ -81,13 +81,13 @@
<classes>
<class name="org.jboss.portal.test.selenium.cms.CMSFileUploadTestCase"></class></classes>
</test>
-
+<!--
<test name="org.jboss.portal.test.selenium.CoordinationSamplesTestCase"
verbose="2" annotations="JDK">
<classes>
<class name="org.jboss.portal.test.selenium.CoordinationSamplesTestCase"></class></classes>
</test>
-
+-->
<test name="org.jboss.portal.test.selenium.PortalSamplesTestCase"
verbose="2" annotations="JDK">
<classes>
15 years
JBoss Portal SVN: r13340 - branches/Enterprise_Portal_Platform_4_3_GA_CP01_JBEPP-78/testsuite/ui-tests/src/org/jboss/portal/test/selenium.
by portal-commits@lists.jboss.org
Author: mageshbk(a)jboss.com
Date: 2009-05-12 09:12:20 -0400 (Tue, 12 May 2009)
New Revision: 13340
Modified:
branches/Enterprise_Portal_Platform_4_3_GA_CP01_JBEPP-78/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardTestCase.java
Log:
[JBEPP-79] testBugResetPortletSetting is not applicable for EPP, so disabling it
Modified: branches/Enterprise_Portal_Platform_4_3_GA_CP01_JBEPP-78/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardTestCase.java
===================================================================
--- branches/Enterprise_Portal_Platform_4_3_GA_CP01_JBEPP-78/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardTestCase.java 2009-05-12 10:07:09 UTC (rev 13339)
+++ branches/Enterprise_Portal_Platform_4_3_GA_CP01_JBEPP-78/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardTestCase.java 2009-05-12 13:12:20 UTC (rev 13340)
@@ -65,7 +65,7 @@
selenium.click(LNK_DASHBOARD);
// selenium.waitForPageToLoad(PAGE_LOAD);
- wait(5000);
+ wait(15000);
selenium.click(LNK_CONFIGURE_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -89,7 +89,7 @@
// firstly create page
selenium.click(LNK_DASHBOARD);
- wait(5000);
+ wait(15000);
selenium.click(LNK_CONFIGURE_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -126,10 +126,10 @@
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
// selenium.waitForPageToLoad(PAGE_LOAD);
- wait(5000);
+ wait(15000);
selectIfNotSelected(SEL_PAGE, "DashTestPage");
-
+ wait(15000);
selenium.select(SEL_THEME, "label=renaissance");
selenium.click(SUB_THEMESEL);
@@ -152,10 +152,10 @@
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
// selenium.waitForPageToLoad(PAGE_LOAD);
- wait(5000);
+ wait(15000);
selenium.windowMaximize();
selectIfNotSelected(SEL_PAGE, "DashTestPage");
-
+ wait(15000);
selenium.select(SEL_LAYOUT, "label=generic");
selenium.click(SUB_LAYOUT_UPDATE);
@@ -179,8 +179,9 @@
selenium.click(LNK_CONFIGURE_DASHBOARD);
// selenium.waitForPageToLoad(PAGE_LOAD);
- wait(5000);
+ wait(15000);
selectIfNotSelected(SEL_PAGE, "DashTestPage");
+ wait(15000);
selenium.click(LINK_PORTL2);
selenium.waitForPageToLoad(PAGE_LOAD);
waitForElement("portlet-editor-title");
@@ -206,7 +207,7 @@
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
// selenium.waitForPageToLoad(PAGE_LOAD);
- wait(5000);
+ wait(15000);
selenium.type(INP_PAGENAME, pageName);
selenium.click(SUB_CREATEPAGE);
@@ -218,12 +219,14 @@
selenium.waitForPageToLoad(PAGE_LOAD);
selectIfNotSelected(SEL_PAGE, pageName);
+ wait(15000);
selenium.click(LINK_PORTL1);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(SUB_ADDCENTER);
selenium.waitForPageToLoad(PAGE_LOAD);
selectIfNotSelected(SEL_PAGE, pageName);
+ wait(15000);
selenium.click(LINK_PORTL2);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(SUB_ADDCENTER);
@@ -247,9 +250,9 @@
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
// selenium.waitForPageToLoad(PAGE_LOAD);
- wait(5000);
+ wait(15000);
selectIfNotSelected(SEL_PAGE, pageName);
-
+ wait(15000);
selenium.addSelection(SEL_CENTER_REGION, OPT_PORTL1);
selenium.click(SUB_DOWN_CENTER_REGION);
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -270,10 +273,10 @@
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
// selenium.waitForPageToLoad(PAGE_LOAD);
- wait(5000);
+ wait(15000);
selectIfNotSelected(SEL_PAGE, "DashTestPage");
-
+ wait(15000);
selenium.addSelection(SEL_CENTER_REGION, "label=CurrentUsersPortletWindow");
selenium.click(SUB_DEL_FROM_CENTER_REGION);
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -294,8 +297,9 @@
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
// selenium.waitForPageToLoad(PAGE_LOAD);
- wait(5000);
+ wait(15000);
selectIfNotSelected(SEL_PAGE, "DashTestPage");
+ wait(15000);
selenium.select(SEL_CONTENT_TYPE, "label=widget/google");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=Band Culinaria");
@@ -313,7 +317,7 @@
// http://www.jboss.com/index.html?module=bb&op=viewtopic&t=143023
// https://jira.jboss.org/jira/browse/JBPORTAL-2177
- @Test(enabled = true)
+ @Test(enabled = false)
public void testBugResetPortletSetting() {
final String pageName = "page1";
final String pageNameNew = "page1a";
@@ -325,7 +329,7 @@
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
// selenium.waitForPageToLoad(PAGE_LOAD);
- wait(5000);
+ wait(15000);
selenium.type(INP_PAGENAME, pageName);
selenium.click(SUB_CREATEPAGE);
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -347,7 +351,7 @@
selenium.waitForPageToLoad(PAGE_LOAD);
selectIfNotSelected(SEL_PAGE, pageName);
-
+ wait(15000);
selenium.click(LINK_WEATHER_PORTLET);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(SUB_ADDLEFT);
@@ -374,10 +378,10 @@
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
// selenium.waitForPageToLoad(PAGE_LOAD);
- wait(5000);
+ wait(15000);
selectIfNotSelected(SEL_PAGE, pageName);
-
+ wait(15000);
selenium.type(INP_PAGE_RENAME, pageNameNew);
selenium.click(SUB_PAGE_RENAME);
selenium.waitForPageToLoad(PAGE_LOAD);
15 years
JBoss Portal SVN: r13339 - in branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests: src/org/jboss/portal/test/selenium and 1 other directories.
by portal-commits@lists.jboss.org
Author: vrockai
Date: 2009-05-12 06:07:09 -0400 (Tue, 12 May 2009)
New Revision: 13339
Added:
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/AdminPortalWizardTestCase.java
Modified:
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/locator.properties
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/AdminPortalTestCase.java
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/testng.xml
Log:
[selenium] - portal admin wizard test added
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/locator.properties
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/locator.properties 2009-05-11 13:19:01 UTC (rev 13338)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/locator.properties 2009-05-12 10:07:09 UTC (rev 13339)
@@ -283,6 +283,25 @@
portal.admin.sel.pp.listener=//select[contains(@id,'edit-prop-form:listener')]
portal.admin.tbl.pp.props=//table[contains(@id,'common-manage-prop-form:prop-data-table')]
+# AdminPortalWizardTestCase
+
+portal.admin.wiz.sub.sub=_jbpnsAdminPortletWindowsnpbj:j_id20:wiz-conf-form:confirm
+portal.admin.wiz.sub.can=_jbpnsAdminPortletWindowsnpbj:j_id20:wiz-conf-form:cancel
+portal.admin.wiz.lnk.reg.c=_jbpnsAdminPortletWindowsnpbj:j_id28:region-wiz-form:region-1
+portal.admin.wiz.sub.portlet.type=_jbpnsAdminPortletWindowsnpbj:j_id169:portlet-wiz-form:wiz-change
+portal.admin.wiz.sel.portlet.type=_jbpnsAdminPortletWindowsnpbj:j_id169:portlet-wiz-form:menu
+portal.admin.wiz.lnk.wiz.mode=Link=*Switch to wizard mode*
+portal.admin.wiz.inp.submit.pagecreate=//input[contains(@id,'create-page-form:create-page')]
+portal.admin.wiz.inp.pagename=//input[contains(@id,'create-page-form:pageName')]
+portal.admin.wiz.inp.portalname=//input[contains(@id,'create-portal-form:name')]
+portal.admin.wiz.inp.submit.createportal=//input[contains(@id,'create-portal-form:create-portal')]
+portal.admin.wiz.tab.portalobj.id=Link=Admin
+portal.admin.wiz.lnk.portals.id=link=*Portal Objects*
+portal.admin.wiz.tab.portal.admin=//table[contains(@id,'obj-nav-form:portal-datatable')]
+portal.admin.wiz.por.tl.main=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:object-iid-link'')]
+portal.admin.wiz.ul.paginator=//body/div[2]/div/div/div[2]/table/tbody/tr/td/div/div/div/div/div[6]/form[2]/ul[2]
+portal.admin.wiz.ul.paginator=//html/body/div[2]/div/div/div[2]/table/tbody/tr/td/div/div/div/div/div[6]/form[2]/table
+
# DashboardsTestCase
portal.dash.t.dh.sub.update=//form[contains(@id,'common-edit-theme-form')]/input[@type='submit']
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/AdminPortalTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/AdminPortalTestCase.java 2009-05-11 13:19:01 UTC (rev 13338)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/AdminPortalTestCase.java 2009-05-12 10:07:09 UTC (rev 13339)
@@ -607,7 +607,7 @@
* this page. Existence of text containing the name of window is asserted.
* At the page is loaded and the existence of the added portlet is asserted.
*/
- @Test(enabled = true, dependsOnMethods = { "testPortalCreate", "testAddPage" }, description = "Creates a \"window\" on a page")
+ @Test(enabled = true, dependsOnMethods = { "testPortalCreate", "testAddPage" }, description = "Creates a 'window' on a page")
public void testCreateWindow() {
final String portalName = "toAddWindowPortal";
Added: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/AdminPortalWizardTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/AdminPortalWizardTestCase.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/AdminPortalWizardTestCase.java 2009-05-12 10:07:09 UTC (rev 13339)
@@ -0,0 +1,189 @@
+package org.jboss.portal.test.selenium.portal;
+
+import java.text.MessageFormat;
+
+import org.jboss.portal.test.selenium.JBossPortalSeleniumTestCase;
+import org.testng.Assert;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+/**
+ * AdminPortalTestCase is responsible for testing fundamental portal admin wizard interface
+ * features of JBoss Portal.
+ *
+ * @author <a href="mailto:vrockai@redhat.com">Viliam Rockai</a>
+ *
+ */
+// TODO - adding of simple portlet - more portlet types
+@Test(groups = { "admin_portal" }, enabled = true, description = "Partal administrating.")
+public class AdminPortalWizardTestCase extends JBossPortalSeleniumTestCase {
+
+ /** prefix for locator properties = portal.admin. */
+ public final String casePfx = "portal.admin.wiz.";
+
+ private final String SUB_SUB = getLoc(casePfx + "sub.sub", "_jbpnsAdminPortletWindowsnpbj:j_id20:wiz-conf-form:confirm");
+ private final String SUB_CAN = getLoc(casePfx + "sub.can", "_jbpnsAdminPortletWindowsnpbj:j_id20:wiz-conf-form:cancel");
+ private final String LNK_REG_C = getLoc(casePfx + "lnk.reg.c", "_jbpnsAdminPortletWindowsnpbj:j_id28:region-wiz-form:region-1");
+ private final String SUB_PORTLET_TYPE = getLoc(casePfx + "sub.portlet.type", "_jbpnsAdminPortletWindowsnpbj:j_id169:portlet-wiz-form:wiz-change");
+ private final String SEL_PORTLET_TYPE = getLoc(casePfx + "sel.portlet.type", "_jbpnsAdminPortletWindowsnpbj:j_id169:portlet-wiz-form:menu");
+ private final String LNK_WIZ_MODE = getLoc(casePfx + "lnk.wiz.mode", "Link=*Switch to wizard mode*");
+ private final String INP_SUBMIT_PAGECREATE = getLoc(casePfx + "inp.submit.pagecreate", "//input[contains(@id,'create-page-form:create-page')]");
+ private final String INP_PAGENAME = getLoc(casePfx + "inp.pagename", "//input[contains(@id,'create-page-form:pageName')]");
+ private final String INP_PORTALNAME = getLoc(casePfx + "inp.portalname", "//input[contains(@id,'create-portal-form:name')]");
+ private final String INP_SUBMIT_CREATEPORTAL = getLoc(casePfx + "inp.submit.createportal", "//input[contains(@id,'create-portal-form:create-portal')]");
+ private final String TAB_PORTALOBJ_ID = getLoc(casePfx + "tab.portalobj.id", "Link=Admin");
+ private final String LNK_PORTALS_ID = getLoc(casePfx + "lnk.portals.id", "link=*Portal Objects*");
+ private final String TAB_PORTAL_ADMIN = getLoc(casePfx + "tab.portal.admin", "//table[contains(@id,'obj-nav-form:portal-datatable')]");
+ private final String POR_TL_MAIN = getLoc(casePfx + "por.tl.main", "//a[contains(@id,''obj-nav-form:portal-datatable:{0}:object-iid-link'')]");
+ private final String UL_PAGINATOR = getLoc(casePfx + "ul.paginator", "//body/div[2]/div/div/div[2]/table/tbody/tr/td/div/div/div/div/div[6]/form[2]/ul[2]");
+ private final String TAB_PORTLET_INSTANCES = getLoc(casePfx + "ul.paginator", "//html/body/div[2]/div/div/div[2]/table/tbody/tr/td/div/div/div/div/div[6]/form[2]/table");
+
+ @BeforeMethod(groups = { "log" })
+ protected void loginBeforeTest() {
+ logoutIfPossible();
+ login("admin", "admin");
+ }
+
+ @AfterMethod(groups = { "log" })
+ protected void logoutAfterTest() {
+ }
+
+ /**
+ * Simple adding of counter portlet to "TestPortal" portal into page "PageToWizard".
+ */
+ @Test(enabled = true, description = "Creates a new portal")
+ public void testSimpleWizard() {
+
+ String portalName = "TestPortal";
+ String pageName = "PageToWizard";
+ String portletType = "local";
+ String portletName = "Counter Portlet";
+
+ createPortal(portalName);
+ createPage(portalName, pageName);
+
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LNK_PORTALS_ID);
+
+ selenium.click(LNK_WIZ_MODE);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ clickPortlet(portletType, portletName);
+
+ selenium.click("Link="+portalName);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("Link="+pageName);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click(LNK_REG_C);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click(SUB_CAN);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ openAndWait("/portal/auth/portal/TestPortal/PageToWizard");
+ Assert.assertFalse(selenium.isTextPresent("Counter portlet"));
+
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LNK_PORTALS_ID);
+
+ clickPortlet(portletType, portletName);
+
+ selenium.click("Link="+portalName);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("Link="+pageName);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click(LNK_REG_C);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click(SUB_SUB);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ openAndWait("/portal/auth/portal/TestPortal/PageToWizard");
+ Assert.assertTrue(selenium.isTextPresent("Counter portlet"));
+
+ }
+
+ private void clickPortlet(String type, String portletName){
+ selenium.select(SEL_PORTLET_TYPE, "label="+type);
+ selenium.click(SUB_PORTLET_TYPE);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ if (traversePortlets(portletName, 0)>-1){
+ selenium.click("link="+portletName);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ }
+
+ }
+
+ private void createPortal(String name) {
+ selenium.open("/portal/");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LNK_PORTALS_ID);
+
+ selenium.type(INP_PORTALNAME, name);
+ selenium.click(INP_SUBMIT_CREATEPORTAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ }
+
+ private void createPage(String portalName, String pageName) {
+ selenium.open("/portal/");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LNK_PORTALS_ID);
+
+ int r = findTableRow(TAB_PORTAL_ADMIN, portalName, 0) - 1;
+
+ selenium.click(MessageFormat.format(POR_TL_MAIN, r));
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.type(INP_PAGENAME, pageName);
+ selenium.click(INP_SUBMIT_PAGECREATE);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ }
+
+ private int traversePortlets(String instance_name, int row) {
+
+ int r = -1;
+
+ r = findTableRow(TAB_PORTLET_INSTANCES, instance_name, row);
+
+ if (r >= 0)
+ return r;
+
+ String pages[] = getPages(UL_PAGINATOR);
+ for (String page : pages) {
+ if ("".equals(page.trim()))
+ continue;
+ selenium.click("link=" + page);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ r = findTableRow(TAB_PORTLET_INSTANCES, instance_name, row);
+
+ if (r >= 0)
+ break;
+ }
+
+ return r;
+ }
+
+ private String[] getPages(String paginator_location) {
+
+ String pagi = selenium.getText(paginator_location);
+ String[] pages = pagi.split(" ");
+
+ return pages;
+ }
+
+}
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/testng.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/testng.xml 2009-05-11 13:19:01 UTC (rev 13338)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/testng.xml 2009-05-12 10:07:09 UTC (rev 13339)
@@ -40,6 +40,12 @@
<class name="org.jboss.portal.test.selenium.portal.AdminPortalTestCase"></class></classes>
</test>
+ <test name="org.jboss.portal.test.selenium.portal.AdminPortalWizardTestCase"
+ verbose="2" annotations="JDK">
+ <classes>
+ <class name="org.jboss.portal.test.selenium.portal.AdminPortalWizardTestCase"></class></classes>
+ </test>
+
<test name="org.jboss.portal.test.selenium.portal.PortletDefinitionsTestCase"
verbose="2" annotations="JDK">
<classes>
15 years
JBoss Portal SVN: r13338 - in branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium: sso and 1 other directory.
by portal-commits@lists.jboss.org
Author: vrockai
Date: 2009-05-11 09:19:01 -0400 (Mon, 11 May 2009)
New Revision: 13338
Added:
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/sso/
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/sso/CASSeleniumTestCase.java
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/sso/JOSSOSeleniumTestCase.java
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/sso/TomcatSSOValveDisabledTestCase.java
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/sso/TomcatSSOValveTestCase.java
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/sso/TomcatSSOValveWithExampleTestCase.java
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/sso/TomcatSSOValveWithJMXConsoleTestCase.java
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/sso/UserRolesHelperTestCase.java
Log:
[selenium] mposolda sso tests
Added: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/sso/CASSeleniumTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/sso/CASSeleniumTestCase.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/sso/CASSeleniumTestCase.java 2009-05-11 13:19:01 UTC (rev 13338)
@@ -0,0 +1,219 @@
+package org.jboss.portal.test.selenium.sso;
+
+import org.testng.Assert;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+/**
+ * The Class CASSeleniumTestCase is reponsible for testing of the JBoss Portal with cooperation of CAS (Central Authentication Service).
+ *
+ * @author <a href="mailto:mposolda@redhat.com">Marek Posolda</a>
+ */
+@Test(groups = { "sso_tests" }, enabled = true, description = "CAS selenium test case.")
+public class CASSeleniumTestCase extends UserRolesHelperTestCase {
+
+ /** prefix for locator properties */
+ public String casePfx = "sso.cas.";
+
+ private final String PORTAL_ADMIN_USERNAME = "admin";
+ private final String PORTAL_ADMIN_PASSWORD = "admin";
+ private final String PORTAL_USER_USERNAME = "user";
+ private final String PORTAL_USER_PASSWORD = "user";
+ private final String PORTAL_CYRIL_USERNAME = "cyril";
+ private final String PORTAL_CYRIL_PASSWORD = "password";
+ private final String PORTAL_CYRIL_MAIL = "cyril(a)redhat.com";
+ private final String PORTAL_CYRIL_ROLE = "Cyril";
+
+ private final String ADR_PORTAL = getLoc(casePfx+"adr.portal","/portal");
+ private final String ADR_PORTAL_ADMIN = getLoc(casePfx+"adr.portal.admin","/portal/auth/portal/admin");
+ private final String ADR_PORTAL_DEFAULT = getLoc(casePfx+"adr.portal.default","/portal/auth/portal/default");
+
+ private final String LINK_LOGIN = getLoc(casePfx+"lnk.login", "link=Login");
+ private final String LINK_ADMIN = getLoc(casePfx+"lnk.admin", "link=Admin");
+ private final String LINK_WEATHER = getLoc(casePfx+"lnk.weather", "link=Weather");
+ private final String LINK_COPY_DASHBOARD = getLoc(casePfx+"lnk.cp.dashboard", "link=Copy to my dashboard");
+ private final String LINK_CONFIGURE_DASHBOARD = getLoc(casePfx+"lnk.conf.dashboard", "link=Configure dashboard");
+ private final String LINK_DASHBOARD = getLoc(casePfx+"lnk.dashboard", "link=Dashboard");
+ private final String LINK_LOGOUT = getLoc(casePfx+"lnk.logout", "link=Logout");
+ private final String FORBIDDEN_ELEMENT = getLoc(casePfx+"forbidden.element", "//h1");
+
+ private final String CAS_INPUT_USERNAME = getLoc(casePfx + "cas.input.username", "username");
+ private final String CAS_INPUT_PASSWORD = getLoc(casePfx + "cas.input.password", "password");
+ private final String CAS_SUBMIT_LOGIN = getLoc(casePfx + "cas.submit.login", "//input[@value='LOGIN']");
+ private final String CAS_IMAGE = getLoc(casePfx + "cas.image", "//img[@alt='Central Authentication Service']");
+
+ private final String CAS_INVALID_AUTH = getMess(casePfx + "cas.invalid.auth", "The credentials you provided cannot be determined to be authentic.");
+ private final String CAS_LOGIN_MESSAGE = getMess(casePfx + "cas.login.mess", "Enter your JA-SIG NetID and Password.");
+ private final String CAS_LOGOUT_SUCCESSFULL = getMess(casePfx + "cas.logout.succ", "Logout successful");
+
+ private final String PORTAL_LOGGED_IN_AS_MESSAGE = getMess(casePfx + "logged.in.mess", "Logged in as: ");
+ private final String PORTAL_FORBIDDEN_MESS = getMess(casePfx + "forbidden.mess", "HTTP Status 403 -");
+
+ @BeforeMethod(groups = { "log" })
+ private void logoutBeforeTest() {
+ logoutIfPossible();
+ }
+
+ /**
+ * This method tests couple of bad login attempts with usage of CAS.
+ * After clicks to "Login" link from portal, the user is redirected to CAS login screen and then he tries to login with credentials:
+ * "admin:adminadmin" , "cyril:cyril", "cyril:password"
+ */
+ @Test(enabled = true)
+ public void badLoginsToCAS() {
+ openPortalAndClickToLogin();
+ tryToLogin(PORTAL_ADMIN_USERNAME, "adminadmin");
+ Assert.assertTrue(selenium.isTextPresent(CAS_INVALID_AUTH));
+ tryToLogin(PORTAL_CYRIL_USERNAME, "cyril");
+ Assert.assertTrue(selenium.isTextPresent(CAS_INVALID_AUTH));
+ tryToLogin(PORTAL_CYRIL_USERNAME, "password");
+ Assert.assertTrue(selenium.isTextPresent(CAS_INVALID_AUTH));
+ }
+
+ /**
+ * This method tests good login attempt with usage of CAS.
+ * After clicks to "Login" link from portal, the user is redirected to CAS login screen and then he tries to login with credentials:
+ * "user:user". He is logged in and then he goes to some page. He tries the admin portal, but he ends with 403 error. Then he is logged out. After
+ * logging out, he should be redirected to default portal page.
+ */
+ @Test(enabled = true)
+ public void loginAsUserAndLoggedOut() {
+ openPortalAndClickToLogin();
+ tryToLogin(PORTAL_USER_USERNAME, PORTAL_USER_PASSWORD);
+ Assert.assertTrue(selenium.isTextPresent(PORTAL_LOGGED_IN_AS_MESSAGE + PORTAL_USER_USERNAME));
+ Assert.assertFalse(selenium.isElementPresent(CAS_IMAGE));
+ // click to dashboard as user.
+ clickAndWait(LINK_DASHBOARD);
+ Assert.assertTrue(selenium.isElementPresent(LINK_CONFIGURE_DASHBOARD));
+ // try to go to "admin" portal. This must end with 403 error, because user doesn't have permission to go to this portal.
+ openAndWait(ADR_PORTAL_ADMIN);
+ Assert.assertEquals(PORTAL_FORBIDDEN_MESS, selenium.getText(FORBIDDEN_ELEMENT));
+ // go to default portal and logout
+ openAndWait(ADR_PORTAL_DEFAULT);
+ clickAndWait(LINK_LOGOUT);
+ Assert.assertTrue(selenium.isElementPresent(CAS_IMAGE));
+ Assert.assertTrue(selenium.isTextPresent(CAS_LOGOUT_SUCCESSFULL));
+ }
+
+ /**
+ * After opening URL like: http://localhost:8080/portal/auth/portal/admin the user should be redirected to CAS login page.
+ * The User "user" should have 403 error while trying to go to admin portal, but he should be able to go to http://localhost:8080/portal/auth/portal/default
+ */
+ @Test(enabled = true)
+ public void loginAsUserWhileGoingToAuthURL() {
+ // 403 error after trying to go to admin portal as user
+ openAndWait(ADR_PORTAL_ADMIN);
+ Assert.assertTrue(selenium.isElementPresent(CAS_IMAGE));
+ tryToLogin(PORTAL_USER_USERNAME, PORTAL_USER_PASSWORD);
+ Assert.assertEquals(PORTAL_FORBIDDEN_MESS, selenium.getText(FORBIDDEN_ELEMENT));
+ // going to default portal. Everythink should be ok.
+ openAndWait(ADR_PORTAL_DEFAULT);
+ Assert.assertTrue(selenium.isTextPresent(PORTAL_LOGGED_IN_AS_MESSAGE + PORTAL_USER_USERNAME));
+ Assert.assertFalse(selenium.isElementPresent(CAS_IMAGE));
+ // click to dashboard as user.
+ clickAndWait(LINK_DASHBOARD);
+ Assert.assertTrue(selenium.isElementPresent(LINK_CONFIGURE_DASHBOARD));
+ // logout (redirected to CAS page)
+ clickAndWait(LINK_LOGOUT);
+ Assert.assertTrue(selenium.isElementPresent(CAS_IMAGE));
+ Assert.assertTrue(selenium.isTextPresent(CAS_LOGOUT_SUCCESSFULL));
+ }
+
+ /**
+ * This method tests good login attempt with usage of CAS.
+ * After clicks to "Login" link from portal, the user is redirected to CAS login screen and then he tries to login with credentials:
+ * "admin:admin". He is logged in and then he goes to admin portal, and he creates role "Cyril" and user "cyril" with password "password". Then admin logges out.
+ */
+ @Test(enabled = true, dependsOnMethods = { "badLoginsToCAS" })
+ public void loginAsAdminAndCreateNewRoleAndUser() {
+ loginToPortalAsAdmin();
+ createRole(PORTAL_CYRIL_ROLE, PORTAL_CYRIL_ROLE);
+ createUser(PORTAL_CYRIL_USERNAME, PORTAL_CYRIL_PASSWORD, PORTAL_CYRIL_MAIL);
+ Assert.assertTrue(selenium.isTextPresent(PORTAL_LOGGED_IN_AS_MESSAGE + PORTAL_ADMIN_USERNAME));
+ logoutIfPossible();
+ Assert.assertTrue(selenium.isTextPresent(CAS_LOGOUT_SUCCESSFULL));
+ }
+
+ /**
+ * This method tests good login attempt with usage of CAS.
+ * After clicks to "Login" link from portal the user is redirected to CAS login screen and then he tries to login with credentials:
+ * "cyril:cyril", which is bad and then "cyril:password" which is good. Then cyril tries to do some dashboard stuff and then logges out.
+ */
+ @Test(enabled = true, dependsOnMethods = { "loginAsAdminAndCreateNewRoleAndUser" })
+ public void loginAsCyrilAndPlayWithDashboard() {
+ openPortalAndClickToLogin();
+ tryToLogin(PORTAL_CYRIL_USERNAME, PORTAL_CYRIL_PASSWORD);
+ Assert.assertTrue(selenium.isTextPresent(PORTAL_LOGGED_IN_AS_MESSAGE + PORTAL_CYRIL_USERNAME));
+ Assert.assertFalse(selenium.isElementPresent(CAS_IMAGE));
+ // TODO: uncomment this after fixing the CMS bug with Access denied
+ // Assert.assertFalse(selenium.isTextPresent("Access Denied"));
+ waitFor(3000);
+ clickAndWait(LINK_WEATHER);
+ Assert.assertTrue(selenium.isElementPresent(LINK_COPY_DASHBOARD));
+ clickAndWait(LINK_COPY_DASHBOARD);
+ Assert.assertTrue(selenium.isElementPresent(LINK_CONFIGURE_DASHBOARD));
+ logoutIfPossible();
+ }
+
+ /**
+ * This test loggs admin in and then admin deletes Cyril role and cyril user. Then logges out.
+ */
+ @Test(enabled = true, dependsOnMethods = { "loginAsCyrilAndPlayWithDashboard" })
+ public void deleteCyrilRoleAndUser() {
+ loginToPortalAsAdmin();
+ deleteRole(PORTAL_CYRIL_ROLE);
+ deleteUser(PORTAL_CYRIL_USERNAME, PORTAL_CYRIL_MAIL);
+ Assert.assertTrue(selenium.isTextPresent(PORTAL_LOGGED_IN_AS_MESSAGE + PORTAL_ADMIN_USERNAME));
+ logoutIfPossible();
+ }
+
+ /**
+ * Loggs into portal as admin with usage of CAS.
+ */
+ private void loginToPortalAsAdmin() {
+ openPortalAndClickToLogin();
+ tryToLogin(PORTAL_ADMIN_USERNAME, PORTAL_ADMIN_PASSWORD);
+ Assert.assertTrue(selenium.isTextPresent(PORTAL_LOGGED_IN_AS_MESSAGE + PORTAL_ADMIN_USERNAME));
+ Assert.assertFalse(selenium.isElementPresent(CAS_IMAGE));
+ Assert.assertTrue(selenium.isElementPresent(LINK_ADMIN));
+ }
+
+ /**
+ * This helper method is used to open portal page (http://localhost:8080/portal) then click to 'Login' link and verifies if
+ * CAS login page is shown. Method shouldn't be called when some user is logged into portal.
+ */
+ private void openPortalAndClickToLogin() {
+ openAndWait(ADR_PORTAL);
+ clickAndWait(LINK_LOGIN);
+ Assert.assertTrue(selenium.isTextPresent(CAS_LOGIN_MESSAGE));
+ Assert.assertTrue(selenium.isElementPresent(CAS_IMAGE));
+ }
+
+ /**
+ * This method tries to login into CAS. The condition is, that CAS login page is shown when this method is called.
+ * Any test (whether login was success or not) are not performed during this method.
+ * @param username
+ * @param password
+ */
+ private void tryToLogin(String username, String password) {
+ selenium.type(CAS_INPUT_USERNAME, username);
+ selenium.type(CAS_INPUT_PASSWORD, password);
+ clickAndWait(CAS_SUBMIT_LOGIN);
+ }
+
+ /**
+ * Overriden method. Because after click to logout, the CAS page is shown.
+ */
+ @Test(enabled = false)
+ public void logoutIfPossible() {
+ selenium.open(ADDR_PORTAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ if (selenium.isElementPresent(LINK_LOGOUT)) {
+ selenium.click(LINK_LOGOUT);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(selenium.isElementPresent(CAS_IMAGE));
+ Assert.assertTrue(selenium.isTextPresent(CAS_LOGOUT_SUCCESSFULL));
+ }
+ }
+
+}
Added: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/sso/JOSSOSeleniumTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/sso/JOSSOSeleniumTestCase.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/sso/JOSSOSeleniumTestCase.java 2009-05-11 13:19:01 UTC (rev 13338)
@@ -0,0 +1,206 @@
+package org.jboss.portal.test.selenium.sso;
+
+import java.text.MessageFormat;
+
+import org.jboss.portal.test.selenium.JBossPortalSeleniumTestCase;
+import org.testng.Assert;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+/**
+ * The Class JOSSOSeleniumTestCase is reponsible for testing of the JBoss Portal with cooperation of JOSSO (Java Open Single Sign On).
+ *
+ * @author <a href="mailto:mposolda@redhat.com">Marek Posolda</a>
+ */
+@Test(groups = { "sso_tests" }, enabled = true, description = "JOSSO selenium test case.")
+public class JOSSOSeleniumTestCase extends UserRolesHelperTestCase {
+
+ /** prefix for locator properties */
+ public String casePfx = "sso.josso.";
+
+ private final String PORTAL_ADMIN_USERNAME = "admin";
+ private final String PORTAL_ADMIN_PASSWORD = "admin";
+ private final String PORTAL_USER_USERNAME = "user";
+ private final String PORTAL_USER_PASSWORD = "user";
+ private final String PORTAL_JOSEPH_USERNAME = "joseph";
+ private final String PORTAL_JOSEPH_PASSWORD = "password";
+ private final String PORTAL_JOSEPH_MAIL = "joseph(a)redhat.com";
+ private final String PORTAL_JOSEPH_ROLE = "Joseph";
+
+ private final String ADR_PORTAL = getLoc(casePfx+"adr.portal","/portal");
+ private final String ADR_PORTAL_ADMIN = getLoc(casePfx+"adr.portal.admin","/portal/auth/portal/admin");
+ private final String ADR_PORTAL_DEFAULT = getLoc(casePfx+"adr.portal.default","/portal/auth/portal/default");
+
+ private final String LINK_LOGIN = getLoc(casePfx+"lnk.login", "link=Login");
+ private final String LINK_ADMIN = getLoc(casePfx+"lnk.admin", "link=Admin");
+ private final String LINK_WEATHER = getLoc(casePfx+"lnk.weather", "link=Weather");
+ private final String LINK_COPY_DASHBOARD = getLoc(casePfx+"lnk.cp.dashboard", "link=Copy to my dashboard");
+ private final String LINK_CONFIGURE_DASHBOARD = getLoc(casePfx+"lnk.conf.dashboard", "link=Configure dashboard");
+ private final String LINK_DASHBOARD = getLoc(casePfx+"lnk.dashboard", "link=Dashboard");
+ private final String LINK_LOGOUT = getLoc(casePfx+"lnk.logout", "link=Logout");
+ private final String FORBIDDEN_ELEMENT = getLoc(casePfx+"forbidden.element", "//h1");
+
+ private final String JOSSO_INPUT_USERNAME = getLoc(casePfx + "josso.input.username", "josso_username");
+ private final String JOSSO_INPUT_PASSWORD = getLoc(casePfx + "josso.input.password", "josso_password");
+ private final String JOSSO_SUBMIT_LOGIN = getLoc(casePfx + "josso.submit.login", "//input[@value='Login']");
+ private final String JOSSO_IMAGE = getLoc(casePfx + "josso.image", "//img[@alt='Java Open Single SignOn']");
+
+ private final String JOSSO_INVALID_AUTH = getMess(casePfx + "josso.invalid.auth", "Invalid Authentication Information");
+
+ private final String PORTAL_LOGGED_IN_AS_MESSAGE = getMess(casePfx + "logged.in.mess", "Logged in as: ");
+ private final String PORTAL_FORBIDDEN_MESS = getMess(casePfx + "forbidden.mess", "HTTP Status 403 -");
+
+ @BeforeMethod(groups = { "log" })
+ private void logoutBeforeTest() {
+ logoutIfPossible();
+ }
+
+ /**
+ * This method tests couple of bad login attempts with usage of JOSSO.
+ * After clicks to "Login" link from portal, the user is redirected to JOSSO login screen and then he tries to login with credentials:
+ * "admin:adminadmin" , "joseph:joseph", "joseph:password"
+ */
+ @Test(enabled = true)
+ public void badLoginsToJOSSO() {
+ openPortalAndClickToLogin();
+ tryToLogin(PORTAL_ADMIN_USERNAME, "adminadmin");
+ Assert.assertTrue(selenium.isTextPresent(JOSSO_INVALID_AUTH));
+ tryToLogin(PORTAL_JOSEPH_USERNAME, "joseph");
+ Assert.assertTrue(selenium.isTextPresent(JOSSO_INVALID_AUTH));
+ // Joseph is not created right now, so authentication can't be good
+ tryToLogin(PORTAL_JOSEPH_USERNAME, PORTAL_JOSEPH_PASSWORD);
+ Assert.assertTrue(selenium.isTextPresent(JOSSO_INVALID_AUTH));
+ }
+
+ /**
+ * This method tests good login attempt with usage of JOSSO.
+ * After clicks to "Login" link from portal, the user is redirected to JOSSO login screen and then he tries to login with credentials:
+ * "user:user". He is logged in and then he goes to some page. He tries the admin portal, but he ends with 403 error. Then he is logged out. After
+ * logging out, he should be redirected to default portal page.
+ */
+ @Test(enabled = true)
+ public void loginAsUserAndLoggedOut() {
+ openPortalAndClickToLogin();
+ tryToLogin(PORTAL_USER_USERNAME, PORTAL_USER_PASSWORD);
+ Assert.assertTrue(selenium.isTextPresent(PORTAL_LOGGED_IN_AS_MESSAGE + PORTAL_USER_USERNAME));
+ Assert.assertFalse(selenium.isElementPresent(JOSSO_IMAGE));
+ // click to dashboard as user.
+ clickAndWait(LINK_DASHBOARD);
+ Assert.assertTrue(selenium.isElementPresent(LINK_CONFIGURE_DASHBOARD));
+ // try to go to "admin" portal. This must end with 403 error, because user doesn't have permission to go to this portal.
+ openAndWait(ADR_PORTAL_ADMIN);
+ Assert.assertEquals(PORTAL_FORBIDDEN_MESS, selenium.getText(FORBIDDEN_ELEMENT));
+ // go to default portal and logout
+ openAndWait(ADR_PORTAL_DEFAULT);
+ clickAndWait(LINK_LOGOUT);
+ Assert.assertFalse(selenium.isElementPresent(JOSSO_IMAGE));
+ Assert.assertTrue(selenium.isElementPresent(LINK_LOGIN));
+ }
+
+ /**
+ * After opening URL like: http://localhost:8080/portal/auth/portal/admin the user should be redirected to JOSSO login page.
+ * The User "user" should have 403 error while trying to go to admin portal, but he should be able to go to http://localhost:8080/portal/auth/portal/default
+ */
+ @Test(enabled = true)
+ public void loginAsUserWhileGoingToAuthURL() {
+ // 403 error after trying to go to admin portal as user
+ openAndWait(ADR_PORTAL_ADMIN);
+ Assert.assertTrue(selenium.isElementPresent(JOSSO_IMAGE));
+ tryToLogin(PORTAL_USER_USERNAME, PORTAL_USER_PASSWORD);
+ Assert.assertEquals(PORTAL_FORBIDDEN_MESS, selenium.getText(FORBIDDEN_ELEMENT));
+ // going to default portal. Everythink should be ok.
+ openAndWait(ADR_PORTAL_DEFAULT);
+ Assert.assertTrue(selenium.isTextPresent(PORTAL_LOGGED_IN_AS_MESSAGE + PORTAL_USER_USERNAME));
+ Assert.assertFalse(selenium.isElementPresent(JOSSO_IMAGE));
+ // click to dashboard as user.
+ clickAndWait(LINK_DASHBOARD);
+ Assert.assertTrue(selenium.isElementPresent(LINK_CONFIGURE_DASHBOARD));
+ // logout
+ clickAndWait(LINK_LOGOUT);
+ Assert.assertFalse(selenium.isElementPresent(JOSSO_IMAGE));
+ Assert.assertTrue(selenium.isElementPresent(LINK_LOGIN));
+ }
+
+ /**
+ * This method tests good login attempt with usage of JOSSO.
+ * After clicks to "Login" link from portal, the user is redirected to JOSSO login screen and then he tries to login with credentials:
+ * "admin:admin". He is logged in and then he goes to admin portal, and he creates role "Joseph" and user "joseph" with password "password". Then admin logges out.
+ */
+ @Test(enabled = true, dependsOnMethods = { "badLoginsToJOSSO" })
+ public void loginAsAdminAndCreateNewRoleAndUser() {
+ loginToPortalAsAdmin();
+ createRole(PORTAL_JOSEPH_ROLE, PORTAL_JOSEPH_ROLE);
+ createUser(PORTAL_JOSEPH_USERNAME, PORTAL_JOSEPH_PASSWORD, PORTAL_JOSEPH_MAIL);
+ Assert.assertTrue(selenium.isTextPresent(PORTAL_LOGGED_IN_AS_MESSAGE + PORTAL_ADMIN_USERNAME));
+ logout();
+ Assert.assertFalse(selenium.isElementPresent(JOSSO_IMAGE));
+ }
+
+ /**
+ * This method tests good login attempt with usage of JOSSO.
+ * After clicks to "Login" link from portal, the user is redirected to JOSSO login screen and then he tries to login with credentials:
+ * "joseph:joseph", which is bad and then "joseph:password" which is good. Then joseph tries to do some dashboard stuff and then logges out.
+ */
+ @Test(enabled = true, dependsOnMethods = { "loginAsAdminAndCreateNewRoleAndUser" })
+ public void loginAsJosephAndPlayWithDashboard() {
+ openPortalAndClickToLogin();
+ tryToLogin(PORTAL_JOSEPH_USERNAME, PORTAL_JOSEPH_PASSWORD);
+ Assert.assertTrue(selenium.isTextPresent(PORTAL_LOGGED_IN_AS_MESSAGE + PORTAL_JOSEPH_USERNAME));
+ Assert.assertFalse(selenium.isElementPresent(JOSSO_IMAGE));
+ // TODO: uncomment this after fixing the CMS bug with Access denied
+ // Assert.assertFalse(selenium.isTextPresent("Access Denied"));
+ waitFor(3000);
+ clickAndWait(LINK_WEATHER);
+ Assert.assertTrue(selenium.isElementPresent(LINK_COPY_DASHBOARD));
+ clickAndWait(LINK_COPY_DASHBOARD);
+ Assert.assertTrue(selenium.isElementPresent(LINK_CONFIGURE_DASHBOARD));
+ logout();
+ }
+
+ /**
+ * This test loggs admin in and then admin deletes Joseph role and joseph user. Then logges out.
+ */
+ @Test(enabled = true, dependsOnMethods = { "loginAsJosephAndPlayWithDashboard" })
+ public void deleteJosephRoleAndUser() {
+ loginToPortalAsAdmin();
+ deleteRole(PORTAL_JOSEPH_ROLE);
+ deleteUser(PORTAL_JOSEPH_USERNAME, PORTAL_JOSEPH_MAIL);
+ Assert.assertTrue(selenium.isTextPresent(PORTAL_LOGGED_IN_AS_MESSAGE + PORTAL_ADMIN_USERNAME));
+ logout();
+ Assert.assertFalse(selenium.isElementPresent(JOSSO_IMAGE));
+ }
+
+ /**
+ * Loggs into portal as admin with usage of JOSSO.
+ */
+ private void loginToPortalAsAdmin() {
+ openPortalAndClickToLogin();
+ tryToLogin(PORTAL_ADMIN_USERNAME, PORTAL_ADMIN_PASSWORD);
+ Assert.assertTrue(selenium.isTextPresent(PORTAL_LOGGED_IN_AS_MESSAGE + PORTAL_ADMIN_USERNAME));
+ Assert.assertFalse(selenium.isElementPresent(JOSSO_IMAGE));
+ Assert.assertTrue(selenium.isElementPresent(LINK_ADMIN));
+ }
+
+ /**
+ * This helper method is used to open portal page (http://localhost:8080/portal) then click to 'Login' link and verifies if
+ * JOSSO login page is shown. Method shouldn't be called when some user is logged into portal.
+ */
+ private void openPortalAndClickToLogin() {
+ openAndWait(ADR_PORTAL);
+ clickAndWait(LINK_LOGIN);
+ Assert.assertTrue(selenium.isElementPresent(JOSSO_IMAGE));
+ }
+
+ /**
+ * This method tries to login into JOSSO. The condition is, that JOSSO login page is shown when this method is called.
+ * Any test (whether login was success or not) are not performed during this method.
+ * @param username
+ * @param password
+ */
+ private void tryToLogin(String username, String password) {
+ selenium.type(JOSSO_INPUT_USERNAME, username);
+ selenium.type(JOSSO_INPUT_PASSWORD, password);
+ clickAndWait(JOSSO_SUBMIT_LOGIN);
+ }
+
+}
Added: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/sso/TomcatSSOValveDisabledTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/sso/TomcatSSOValveDisabledTestCase.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/sso/TomcatSSOValveDisabledTestCase.java 2009-05-11 13:19:01 UTC (rev 13338)
@@ -0,0 +1,116 @@
+package org.jboss.portal.test.selenium.sso;
+
+import org.testng.Assert;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+/**
+ * The Class TomcatSSOValveDisabledTestCase is reponsible for testing of the Tomcat SSO Valve when the valve is disabled.
+ * It uses JBoss Portal with TomcatSSOValveExampleApp (sample third-party web application) and jmx-console application. Various scenarios of tests are performed.
+ *
+ * @author <a href="mailto:mposolda@redhat.com">Marek Posolda</a>
+ */
+@Test(groups = { "sso_tests" }, enabled = true, description = "Tomcat SSO valve disabled test case.")
+public class TomcatSSOValveDisabledTestCase extends TomcatSSOValveTestCase {
+
+
+ @BeforeMethod(groups = { "log" })
+ private void logoutBeforeTest() {
+ logoutIfPossible();
+ logoutFromExampleIfPossible();
+ }
+
+ /**
+ * Login to TomcatSSOValveExampleApplication and then check if nobody is logged into portal.
+ * After login to JBoss Portal and logout from it, the user is still logged in TomcatSSOValveExampleApplication.
+ */
+ @Test(enabled = true)
+ public void loginInExampleAndCheckPortalNotLogged() {
+ // going to portal. 'logged in as: admin' page is not shown
+ openAndWait(ADR_PORTAL);
+ Assert.assertFalse(selenium.isTextPresent(LOGGED_IN_AS_MESSAGE + PORTAL_ADMIN_USERNAME));
+
+ // login to example app
+ logIntoExampleApp(EXAMPLE_ADMIN_USERNAME, EXAMPLE_ADMIN_PASSWORD);
+ Assert.assertTrue("false".equals(selenium.getText(EXAMPLE_AUTHORIZED_ROLE_OUTPUT)));
+
+ // going to portal. 'logged in as:' page is not shown, because user still not logged in portal. Only to example app
+ openAndWait(ADR_PORTAL);
+ Assert.assertFalse(selenium.isTextPresent(LOGGED_IN_AS_MESSAGE));
+ Assert.assertTrue(selenium.isElementPresent(LNK_LOGIN));
+ // login to portal
+ login(PORTAL_ADMIN_USERNAME, PORTAL_ADMIN_PASSWORD);
+ clickAndWait(LNK_DASHBOARD);
+ Assert.assertTrue(selenium.isElementPresent(LNK_ADMIN));
+ // logout from portal
+ logout();
+ // Going to example app. User is still logged in even if not logged in the portal.
+ openAndWait(ADR_EXAMPLE);
+ Assert.assertTrue(EXAMPLE_TITLE_OUTPUT.equals(selenium.getText(EXAMPLE_TITLE_ELEMENT)));
+ Assert.assertTrue(EXAMPLE_ADMIN_USERNAME.equals(selenium.getText(EXAMPLE_LOGGED_USER_OUTPUT)));
+ }
+
+ /**
+ * Login to JBoss Portal and then check if nobody is logged into TomcatSSOValveExampleApp.
+ * After login to example application as "user", the "admin" is still logged in JBOss Portal.
+ */
+ @Test(enabled = true)
+ public void loginIntoPortalAndCheckExample() {
+ // going to portal. 'logged in as: admin' page is not shown
+ openAndWait(ADR_PORTAL);
+ Assert.assertFalse(selenium.isTextPresent(LOGGED_IN_AS_MESSAGE + PORTAL_ADMIN_USERNAME));
+ // login to portal
+ login(PORTAL_ADMIN_USERNAME, PORTAL_ADMIN_PASSWORD);
+
+ // Going to example app. User is not logged in even if logged in the portal.
+ openAndWait(ADR_EXAMPLE);
+ Assert.assertTrue(EXAMPLE_LOGIN_FORM.equals(selenium.getText(EXAMPLE_TITLE_ELEMENT)));
+ // login to example app as user
+ logIntoExampleApp(EXAMPLE_USER_USERNAME, EXAMPLE_USER_PASSWORD);
+ Assert.assertTrue(EXAMPLE_TITLE_OUTPUT.equals(selenium.getText(EXAMPLE_TITLE_ELEMENT)));
+ Assert.assertTrue(EXAMPLE_USER_USERNAME.equals(selenium.getText(EXAMPLE_LOGGED_USER_OUTPUT)));
+
+ // Check portal. 'admin' is still logged in. Not user.
+ openAndWait(ADR_PORTAL);
+ Assert.assertTrue(selenium.isTextPresent(LOGGED_IN_AS_MESSAGE + PORTAL_ADMIN_USERNAME));
+ // go to example and logout
+ openAndWait(ADR_EXAMPLE);
+ Assert.assertTrue(EXAMPLE_USER_USERNAME.equals(selenium.getText(EXAMPLE_LOGGED_USER_OUTPUT)));
+ clickAndWait(EXAMPLE_LOGOUT);
+ Assert.assertTrue(EXAMPLE_LOGIN_FORM.equals(selenium.getText(EXAMPLE_TITLE_ELEMENT)));
+
+ // Check portal. 'admin' is still logged in.
+ openAndWait(ADR_PORTAL);
+ Assert.assertTrue(selenium.isTextPresent(LOGGED_IN_AS_MESSAGE + PORTAL_ADMIN_USERNAME));
+ }
+
+ /**
+ * Login to jmx-console and then check if nobody is logged in JBoss Portal.
+ * After login and logour from JBoss Portal, the user is still logged in jmx-console web application.
+ */
+ @Test(enabled = true)
+ public void loginToJMXConsoleAndCheckPortal() {
+ // going to portal. 'logged in as: admin' page is not shown
+ openAndWait(ADR_PORTAL);
+ Assert.assertFalse(selenium.isTextPresent(LOGGED_IN_AS_MESSAGE + PORTAL_ADMIN_USERNAME));
+
+ // login to jmx console
+ loginToJMXConsole(JMX_ADMIN_USERNAME, JMX_ADMIN_PASSWORD);
+
+ // going to portal. 'logged in as:' page is not shown, because user still not logged in portal. Only to example app
+ openAndWait(ADR_PORTAL);
+ Assert.assertFalse(selenium.isTextPresent(LOGGED_IN_AS_MESSAGE));
+ Assert.assertTrue(selenium.isElementPresent(LNK_LOGIN));
+ // login to portal
+ login(PORTAL_ADMIN_USERNAME, PORTAL_ADMIN_PASSWORD);
+ clickAndWait(LNK_DASHBOARD);
+ Assert.assertTrue(selenium.isElementPresent(LNK_ADMIN));
+ // logout from portal
+ logout();
+ // Going to example app. User is still logged in even if not logged in the portal.
+ openAndWait(ADR_JMX_CONSOLE);
+ Assert.assertTrue(selenium.isElementPresent(JMX_IMAGE));
+ Assert.assertEquals(JMX_AGENT_VIEW, selenium.getText(JMX_TITLE_ELEMENT));
+ }
+
+}
Added: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/sso/TomcatSSOValveTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/sso/TomcatSSOValveTestCase.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/sso/TomcatSSOValveTestCase.java 2009-05-11 13:19:01 UTC (rev 13338)
@@ -0,0 +1,91 @@
+package org.jboss.portal.test.selenium.sso;
+
+import org.jboss.portal.test.selenium.JBossPortalSeleniumTestCase;
+import org.testng.Assert;
+
+class TomcatSSOValveTestCase extends JBossPortalSeleniumTestCase {
+
+ /** prefix for locator properties */
+ public String casePfx = "sso.tomcat.";
+
+ protected final String ADR_PORTAL = getLoc(casePfx+"adr.portal","/portal");
+ protected final String ADR_EXAMPLE = getLoc(casePfx+"adr.example","/TomcatSSOValveExampleApp");
+ protected final String ADR_JMX_CONSOLE = getLoc(casePfx+"adr.jmx","/jmx-console/");
+ protected final String EXAMPLE_TITLE_ELEMENT = getLoc(casePfx+"ex.title","//h1");
+ protected final String EXAMPLE_INP_USERNAME = getLoc(casePfx+"ex.inp.username","j_username");
+ protected final String EXAMPLE_INP_PASSWORD = getLoc(casePfx+"ex.inp.password","j_password");
+ protected final String EXAMPLE_LOGIN = getLoc(casePfx+"ex.login","//input[@value='Login']");
+ protected final String EXAMPLE_LOGOUT = getLoc(casePfx+"ex.logout","//input[@value='Logout']");
+ protected final String EXAMPLE_LOGGED_USER_OUTPUT = getLoc(casePfx+"ex.logged.user.label","//tr[1]/td[2]/b");
+ protected final String EXAMPLE_AUTHORIZED_ROLE_OUTPUT = getLoc(casePfx+"ex.logged.user.label","//tr[4]/td[2]/b");
+ protected final String JMX_TITLE_ELEMENT = getLoc(casePfx+"jmx.title.element", "//h1");
+ protected final String JMX_IMAGE = getLoc(casePfx+"jmx.image", "//img[@alt='JBoss']");
+
+ protected final String LNK_LOGIN = getLoc(casePfx+"lnk.login","link=Login");
+ protected final String LNK_LOGOUT = getLoc(casePfx+"lnk.logout","link=Logout");
+ protected final String LNK_DEFAULT = getLoc(casePfx+"lnk.default","link=default");
+ protected final String LNK_ADMIN = getLoc(casePfx+"lnk.admin","link=Admin");
+ protected final String LNK_WSRP = getLoc(casePfx+"lnk.wsrp","link=WSRP");
+ protected final String LNK_DASHBOARD = getLoc(casePfx+"lnk.default","link=Dashboard");
+
+ protected final String EXAMPLE_ADMIN_USERNAME = "admin";
+ protected final String EXAMPLE_ADMIN_PASSWORD = "password";
+ protected final String EXAMPLE_ADMIN2_USERNAME = "admin2";
+ protected final String EXAMPLE_ADMIN2_PASSWORD = "password";
+ protected final String EXAMPLE_USER_USERNAME = "user";
+ protected final String EXAMPLE_USER_PASSWORD = "password";
+ protected final String PORTAL_ADMIN_USERNAME = "admin";
+ protected final String PORTAL_ADMIN_PASSWORD = "admin";
+ protected final String JMX_ADMIN_USERNAME = "admin";
+ protected final String JMX_ADMIN_PASSWORD = "admin";
+ protected final String PORTAL_USER_USERNAME = "user";
+ protected final String PORTAL_USER_PASSWORD = "user";
+
+ protected final String EXAMPLE_LOGIN_FORM = getMess(casePfx+"example.login.form", "Login form");
+ protected final String EXAMPLE_TITLE_OUTPUT = getMess(casePfx+"example.title.output", "Tomcat SSO valve example servlet");
+ protected final String LOGGED_IN_AS_MESSAGE = getMess(casePfx+"logged.in.mess", "Logged in as: ");
+ protected final String JMX_AGENT_VIEW = getMess(casePfx+"jmx.agnview", "JMX Agent View");
+ protected final String PORTAL_FORBIDDEN_MESS = getMess(casePfx + "forbidden.mess", "HTTP Status 403 -");
+
+ /**
+ * Login to jmx-console web application with usage of selenium framework.
+ *
+ * @param user
+ * @param password
+ */
+ protected void loginToJMXConsole(String user, String password) {
+ // TODO: this probably doesn't work in IE. So disable test while working with IE.
+ openAndWait("http://" + user + ":" + password + "@localhost:8080" + ADR_JMX_CONSOLE);
+ Assert.assertTrue(selenium.isElementPresent(JMX_IMAGE));
+ Assert.assertEquals(JMX_AGENT_VIEW, selenium.getText(JMX_TITLE_ELEMENT));
+ }
+
+ /**
+ * Login to TomcatSSOValveExampleApp (sample third-party application)
+ *
+ * @param username
+ * @param password
+ */
+ protected void logIntoExampleApp(String username, String password) {
+ openAndWait(ADR_EXAMPLE);
+ selenium.type(EXAMPLE_INP_USERNAME, username);
+ selenium.type(EXAMPLE_INP_PASSWORD, password);
+ clickAndWait(EXAMPLE_LOGIN);
+ Assert.assertTrue(EXAMPLE_TITLE_OUTPUT.equals(selenium.getText(EXAMPLE_TITLE_ELEMENT)));
+ Assert.assertTrue(username.equals(selenium.getText(EXAMPLE_LOGGED_USER_OUTPUT)));
+ }
+
+ /**
+ * Logout from TomcatSSOValveExampleApp
+ */
+ protected void logoutFromExampleIfPossible() {
+ selenium.open(ADR_EXAMPLE);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ if (selenium.isElementPresent(EXAMPLE_LOGOUT)) {
+ selenium.click(EXAMPLE_LOGOUT);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(EXAMPLE_LOGIN_FORM.equals(selenium.getText(EXAMPLE_TITLE_ELEMENT)));
+ }
+ }
+
+}
Added: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/sso/TomcatSSOValveWithExampleTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/sso/TomcatSSOValveWithExampleTestCase.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/sso/TomcatSSOValveWithExampleTestCase.java 2009-05-11 13:19:01 UTC (rev 13338)
@@ -0,0 +1,95 @@
+package org.jboss.portal.test.selenium.sso;
+
+import org.testng.Assert;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+/**
+ * The Class TomcatSSOValveWithExampleTestCase is reponsible for testing of the Tomcat SSO Valve. This class is responsible for testing
+ * with Tomcat SSO valve enabled and uses JBoss Portal with TomcatSSOValveExampleApp (sample third-party web application)
+ *
+ * @author <a href="mailto:mposolda@redhat.com">Marek Posolda</a>
+ */
+@Test(groups = { "sso_tests" }, enabled = true, description = "Tomcat SSO valve success test case.")
+public class TomcatSSOValveWithExampleTestCase extends TomcatSSOValveTestCase {
+
+
+ @BeforeMethod(groups = { "log" })
+ private void logoutBeforeTest() {
+ logoutIfPossible();
+ }
+
+ /**
+ * Login to TomcatSSOValveExampleApp and then going to JBoss Portal. The user "admin", who loggs in TomcatSSOValveExampleApp is logged
+ * in JBoss Portal too. After logout from JBoss Portal, the user is signed-off also in TomcatSSOValveExampleApp.
+ * This testCase uses "admin" user, who have only role "Admin" but not "Authenticated" in TomcatSSOValveExampleApp and so he is not enable to do everythink
+ * in JBoss Portal (After going to some page, the user should have 'Forbidden' error).
+ */
+ @Test(enabled = true)
+ public void loginInExampleAndCheckPortalUnauthorized() {
+ // going to portal. 'logged in as: admin' page is not shown
+ openAndWait(ADR_PORTAL);
+ Assert.assertFalse(selenium.isTextPresent(LOGGED_IN_AS_MESSAGE + PORTAL_ADMIN_USERNAME));
+
+ // login to example app
+ logIntoExampleApp(EXAMPLE_ADMIN_USERNAME, EXAMPLE_ADMIN_PASSWORD);
+ // user should not be in Authorized role
+ Assert.assertTrue("false".equals(selenium.getText(EXAMPLE_AUTHORIZED_ROLE_OUTPUT)));
+
+ // going to portal. 'logged in as: admin' page is shown
+ openAndWait(ADR_PORTAL);
+ Assert.assertTrue(selenium.isTextPresent(LOGGED_IN_AS_MESSAGE + PORTAL_ADMIN_USERNAME));
+
+ // The error 403 - forbidden should be thrown by portal when user clicks to some link on the page
+ clickAndWait(LNK_DASHBOARD);
+ Assert.assertTrue(selenium.isTextPresent(PORTAL_FORBIDDEN_MESS));
+ }
+
+ /**
+ * Login to TomcatSSOValveExampleApp and then going to JBoss Portal. The user "admin2", who loggs in TomcatSSOValveExampleApp is logged
+ * in JBoss Portal too. After logout from JBoss Portal, the user is signed-off also in TomcatSSOValveExampleApp.
+ * This testCase uses "admin2" user, who have both roles "Admin" and "Authenticated" in TomcatSSOValveExampleApp and so he is enable to do everythink
+ * in JBoss Portal (This user has admin privileges in JBoss Portal).
+ */
+ @Test(enabled = true)
+ public void loginInExampleAndCheckPortalAuthorized() {
+ // going to portal. 'logged in as: admin' page is not shown
+ openAndWait(ADR_PORTAL);
+ Assert.assertFalse(selenium.isTextPresent(LOGGED_IN_AS_MESSAGE + PORTAL_ADMIN_USERNAME));
+
+ // login to example app
+ logIntoExampleApp(EXAMPLE_ADMIN2_USERNAME, EXAMPLE_ADMIN2_PASSWORD);
+ // user should be in Authorized role
+ Assert.assertTrue("true".equals(selenium.getText(EXAMPLE_AUTHORIZED_ROLE_OUTPUT)));
+
+ // going to portal. 'logged in as: admin' is shown
+ openAndWait(ADR_PORTAL);
+ Assert.assertTrue(selenium.isTextPresent(LOGGED_IN_AS_MESSAGE + EXAMPLE_ADMIN2_USERNAME));
+ clickAndWait(LNK_ADMIN);
+ Assert.assertTrue(selenium.isElementPresent(LNK_WSRP));
+
+ // logout from portal and check if logout from example app
+ clickAndWait(LNK_LOGOUT);
+ openAndWait(ADR_EXAMPLE);
+ Assert.assertTrue(EXAMPLE_LOGIN_FORM.equals(selenium.getText(EXAMPLE_TITLE_ELEMENT)));
+ }
+
+ /**
+ * After login in JBoss Portal as "admin", the user should be logged in TomcatSSOValveExampleApp too.
+ */
+ @Test(enabled = true)
+ public void loginInPortalAndCheckExample() {
+ // login to portal as admin
+ login(PORTAL_ADMIN_USERNAME, PORTAL_ADMIN_PASSWORD);
+
+ // open example app and chek if login and check Authorized role. Then logout
+ selenium.open(ADR_EXAMPLE);
+ Assert.assertTrue("true".equals(selenium.getText(EXAMPLE_AUTHORIZED_ROLE_OUTPUT)));
+ clickAndWait(EXAMPLE_LOGOUT);
+
+ // Check if logout from portal
+ openAndWait(ADR_PORTAL);
+ Assert.assertTrue(selenium.isElementPresent(LNK_LOGIN));
+ }
+
+}
Added: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/sso/TomcatSSOValveWithJMXConsoleTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/sso/TomcatSSOValveWithJMXConsoleTestCase.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/sso/TomcatSSOValveWithJMXConsoleTestCase.java 2009-05-11 13:19:01 UTC (rev 13338)
@@ -0,0 +1,63 @@
+package org.jboss.portal.test.selenium.sso;
+
+import org.testng.Assert;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+/**
+ * The Class TomcatSSOValveWithJMXConsoleTestCase is reponsible for testing of the Tomcat SSO Valve. This class is responsible for testing
+ * with Tomcat SSO valve enabled and uses JBoss Portal with jmx-console application. Various scenarios of tests are performed.
+ *
+ * JMX Console is configured to roles JBossAdmin and Admin can see it (so authentication in portal enables access to JMX Console)
+ * roles.properties of JMX console looks like: admin=JBossAdmin,HttpInvoker,Admin
+ * Authenticated role is missing, so login to JMX Console doesn't enable full access to JBoss portal (after click to something in JBoss portal, 403 is thrown)
+ *
+ * @author <a href="mailto:mposolda@redhat.com">Marek Posolda</a>
+ */
+@Test(groups = { "sso_tests" }, enabled = true, description = "Tomcat SSO valve success test case.")
+public class TomcatSSOValveWithJMXConsoleTestCase extends TomcatSSOValveTestCase {
+
+ @BeforeMethod(groups = { "log" })
+ private void logoutBeforeTest() {
+ logoutIfPossible();
+ }
+
+ /**
+ * Login to portal as admin and then see jmx-console application. Admin from JBoss Portal is authorized to see jmx-console application.
+ * After logout from portal and login as "user", then access to jmx-console is forbidden.
+ */
+ @Test(enabled = true)
+ public void loginInPortalAndCheckConsole() {
+ openAndWait(ADR_PORTAL);
+ Assert.assertFalse(selenium.isTextPresent(LOGGED_IN_AS_MESSAGE + PORTAL_ADMIN_USERNAME));
+ login(PORTAL_ADMIN_USERNAME, PORTAL_ADMIN_PASSWORD);
+
+ openAndWait("http://localhost:8080" + ADR_JMX_CONSOLE);
+ Assert.assertTrue(selenium.isElementPresent(JMX_IMAGE));
+ Assert.assertEquals(JMX_AGENT_VIEW, selenium.getText(JMX_TITLE_ELEMENT));
+ // logout from portal and login as user
+ logout();
+ login(PORTAL_USER_USERNAME, PORTAL_USER_PASSWORD);
+ openAndWait("http://localhost:8080" + ADR_JMX_CONSOLE);
+ // user is not authorized to see JMX console
+ Assert.assertTrue(selenium.isTextPresent(PORTAL_FORBIDDEN_MESS));
+ Assert.assertFalse(JMX_AGENT_VIEW.equals(selenium.getText(JMX_TITLE_ELEMENT)));
+ }
+
+ /**
+ * Login to jmx-console and then user should be logged in JBoss Portal too.
+ */
+ @Test(enabled = true)
+ public void loginInConsoleAndCheckPortal() {
+ openAndWait(ADR_PORTAL);
+ Assert.assertFalse(selenium.isTextPresent(LOGGED_IN_AS_MESSAGE + PORTAL_ADMIN_USERNAME));
+ // TODO: this probably doesn't work in IE. So disable test while working with IE.
+ loginToJMXConsole(JMX_ADMIN_USERNAME, JMX_ADMIN_PASSWORD);
+
+ openAndWait(ADR_PORTAL);
+ Assert.assertTrue(selenium.isTextPresent(LOGGED_IN_AS_MESSAGE + PORTAL_ADMIN_USERNAME));
+ // The error 403 - forbidden should be thrown by portal when user clicks to some link on the page
+ clickAndWait(LNK_DASHBOARD);
+ Assert.assertTrue(selenium.isTextPresent(PORTAL_FORBIDDEN_MESS));
+ }
+}
Added: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/sso/UserRolesHelperTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/sso/UserRolesHelperTestCase.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/sso/UserRolesHelperTestCase.java 2009-05-11 13:19:01 UTC (rev 13338)
@@ -0,0 +1,178 @@
+package org.jboss.portal.test.selenium.sso;
+
+import java.text.MessageFormat;
+
+import org.jboss.portal.test.selenium.JBossPortalSeleniumTestCase;
+import org.testng.Assert;
+
+class UserRolesHelperTestCase extends JBossPortalSeleniumTestCase {
+
+ /** prefix for locator properties */
+ public String casePfx = "iden.man.";
+
+ private final String TBL_ROLELIST = getLoc(casePfx + "tbl.rolelist", "//table[contains(@id,'roles-form:userlist')]");
+
+ private final String LNK_T_ROLLIST_DEL = getLoc(casePfx + "lnk.t.rollist.del", "//a[contains(@id,''roles-form:userlist:{0}:delete-role-link'')]");
+
+ private final String SUB_CONF_CREATE_USER = getLoc(casePfx + "sub.conf.create.user", "//input[contains(@id,'confirm-form:admin')]");
+ private final String SUB_DELETE_ROLE = getLoc(casePfx + "sub.delete.role", "//input[contains(@id,'delete-role-form:confirm')]");
+ private final String SUB_ROLE_CREATE = getLoc(casePfx + "sub.role.create", "//input[contains(@id,'create-role-form:submit')]");
+ private final String INP_ROLEDISNAME = getLoc(casePfx + "inp.roledisname", "//input[contains(@id,'create-role-form:roledisplayname')]");
+ private final String INP_ROLENAME = getLoc(casePfx + "inp.rolename", "//input[contains(@id,'create-role-form:rolename')]");
+ private final String TBL_USERLIST = getLoc(casePfx + "tbl.userlist", "//table[contains(@id,'search-user-form1:userlist')]");
+ private final String LNK_ROLE_CREATE = getLoc(casePfx + "lnk.role.create", "//a[contains(@id, 'create-role-form:create-role-link')]");
+ private final String SUB_DEL_USER = getLoc(casePfx + "sub.del.user", "//input[contains(@id,'delete-user-form:submit')]");
+
+ private final String SUB_USER_ROLE = getLoc(casePfx + "sub.user.role", "//input[contains(@id,'register-role-form:submit')]");
+ private final String SUB_CREATE_USER = getLoc(casePfx + "sub.create.user", "//input[contains(@id,'register-form:submit')]");
+ private final String INP_PASSWORD_CHK = getLoc(casePfx + "inp.password.chk", "//input[contains(@id,'register-form:passwordCheck')]");
+ private final String INP_PASSWORD = getLoc(casePfx + "inp.password", "//input[contains(@id,'register-form:password')]");
+ private final String INP_USEREMAIL = getLoc(casePfx + "inp.useremail", "//input[contains(@id,'register-form:email')]");
+ private final String INP_USERNAME = getLoc(casePfx + "inp.username", "//input[contains(@id,'register-form:username')]");
+ private final String SUB_SEARCH_USER = getLoc(casePfx + "sub.search.user", "//input[contains(@id,'search-user-form:search') and @type='submit']");
+ private final String INP_SEARCH_USER = getLoc(casePfx + "inp.search.user", "//input[contains(@id,'search-user-form:searchString')]");
+ private final String LNK_SEARCH_USER = getLoc(casePfx + "lnk.search.user", "//a[contains(@id,'user-form:search-user-link')]");
+ private final String LNK_USERTAB = getLoc(casePfx + "lnk.usertab", "//a[contains(@id,'role-temp-form:manage-users')]");
+ private final String LNK_USERMAIN = getLoc(casePfx + "lnk.usermain", "//a[contains(@id,'user-temp-form1:user-adm-link')]");
+ private final String LNK_T_USRLIST_DEL = getLoc(casePfx + "lnk.t.usrlist.del", "//a[contains(@id,''search-user-form1:userlist:{0}:delete-user-link'')]");
+ private final String LNK_ROLETAB = getLoc(casePfx + "lnk.roletab", "//a[contains(@id,'user-temp-form:role-mgm-link')]");
+
+ private final String LNK_ROLEMAIN = getLoc(casePfx + "lnk.rolemain", "//a[contains(@id, 'role-temp-form1:role-admin-link')]");
+ private final String LNK_USERMANG_MAIN = getLoc(casePfx + "lnk.usermang.main", "//a[contains(@id,'user-temp-form1:assign-role-link')]");
+ private final String LNK_USERMANG_MAIN2 = getLoc(casePfx + "lnk.usermang.main2", "//a[contains(@id,'user-temp-form1:user-mgm-link')]");
+ private final String LNK_CREATE_USER = getLoc(casePfx + "lnk.create.user", "//a[contains(@id,':user-form:create-user-link')]");
+
+ private final String CHK_ROLE = getLoc(casePfx + "chk.role", "//input[contains(@name,''assign-roles-form:roles'') and @value=''{0}'']");
+ private final long SEARCH_TIMEOUT = 10000;
+
+ protected void createRole(String roleName, String roleDisplayName) {
+ selenium.open("/portal/");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link=Members");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ clickIfVisible(LNK_ROLETAB);
+ clickIfVisible(LNK_ROLEMAIN);
+
+ Assert.assertTrue(selenium.isElementPresent(LNK_ROLE_CREATE), "Button for role creating has wrong id or doesn't exist.");
+ Assert.assertEquals(selenium.getText(LNK_ROLE_CREATE), "Create role", "Button for role creating has wrong label.");
+ selenium.click(LNK_ROLE_CREATE);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertTrue(selenium.isTextPresent("Role"), "Label for role name not present or incorrect.");
+ selenium.type(INP_ROLENAME, roleName);
+ Assert.assertTrue(selenium.isTextPresent("Display name"), "Label for display role name not present or incorrect.");
+ selenium.type(INP_ROLEDISNAME, roleDisplayName);
+ selenium.click(SUB_ROLE_CREATE);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertTrue(selenium.isTextPresent(roleName), "Name of newly created role is missing.");
+ Assert.assertTrue(selenium.isTextPresent(roleDisplayName), "Display name of newly created role is missing.");
+ }
+
+ protected void deleteRole(String roleName) {
+ selenium.open("/portal/");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link=Members");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ clickIfVisible(LNK_ROLETAB);
+ clickIfVisible(LNK_ROLEMAIN);
+
+ Assert.assertTrue(selenium.isTextPresent(roleName), "Role name is missing");
+
+ int r = findTableRow(TBL_ROLELIST, roleName, 0);
+ selenium.click(MessageFormat.format(LNK_T_ROLLIST_DEL, r - 1));
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(selenium.isTextPresent("Warning! You are about to delete the role '" + roleName + "'"),
+ "Confirmation text for role deletion missing missing.");
+ selenium.click(SUB_DELETE_ROLE);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ }
+
+ protected void createUser(String userName, String userPass, String userMail) {
+ selenium.open("/portal/auth/portal/default");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.click("link=Members");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ clickIfVisible(LNK_USERTAB);
+ clickIfVisible(LNK_USERMAIN);
+ selenium.click(LNK_CREATE_USER);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertTrue(selenium.isTextPresent("Username *"), "Label for username input is wrong or missing.");
+ selenium.type(INP_USERNAME, userName);
+ Assert.assertTrue(selenium.isTextPresent("E-Mail *"), "Label for e-mail input is wrong or missing.");
+ selenium.type(INP_USEREMAIL, userMail);
+ Assert.assertTrue(selenium.isTextPresent("Password *"), "Label for password input is wrong or missing.");
+ selenium.type(INP_PASSWORD, userPass);
+ Assert.assertTrue(selenium.isTextPresent("Confirm Password *"), "Label for password confirm input is wrong or missing.");
+ selenium.type(INP_PASSWORD_CHK, userPass);
+
+ selenium.click(SUB_CREATE_USER);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertFalse(selenium.isTextPresent("This username is already taken. tempUser"), "User already exists.");
+
+ // TODO: refactor this
+ // Assert.assertTrue(selenium.isTextPresent("Joseph"), "Role Joseph is not present.");
+ selenium.click("_jbpnsIdentityAdminPortletWindowsnpbj:j_id28:register-role-form:roles:2");
+ selenium.click("_jbpnsIdentityAdminPortletWindowsnpbj:j_id28:register-role-form:roles:1");
+ clickAndWait(SUB_USER_ROLE);
+
+ Assert.assertTrue(selenium.isTextPresent("Confirmation"), "Confirmation screen is missing or corrupted.");
+ selenium.click(SUB_CONF_CREATE_USER);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(selenium.isTextPresent("User created"), "User was not created (\"User created\" text missing).");
+
+ }
+
+ protected void deleteUser(String username, String email) {
+ selenium.open("/portal/");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link=Members");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ clickIfVisible(LNK_USERTAB);
+ // user home page
+ clickIfVisible(LNK_USERMAIN);
+ clickIfVisible(LNK_USERMANG_MAIN);
+ clickIfVisible(LNK_USERMANG_MAIN2);
+
+ selenium.click(LNK_SEARCH_USER);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.type(INP_SEARCH_USER, username);
+ selenium.click(SUB_SEARCH_USER);
+ // selenium.waitForPageToLoad(PAGE_LOAD);
+ waitFor(SEARCH_TIMEOUT);
+ Assert.assertTrue(selenium.isTextPresent(username), "Username was not found.");
+ Assert.assertTrue(selenium.isTextPresent(email), "User e-mail adress was not found.");
+
+ selenium.click(butDelUsr_id(username));
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click(SUB_DEL_USER);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(selenium.isTextPresent("User deleted"), "user was not deleted (\"User deleted\" text missing).");
+ }
+
+ private String butDelUsr_id(String userName) {
+ String table = TBL_USERLIST;
+ int r = findTableRow(table, userName, 0);
+ return MessageFormat.format(LNK_T_USRLIST_DEL, r - 1);
+ }
+}
15 years
JBoss Portal SVN: r13337 - branches/JBoss_Portal_Branch_2_7_AS5/core/src/resources/portal-core-sar/conf/identity.
by portal-commits@lists.jboss.org
Author: sviluppatorefico
Date: 2009-05-11 08:56:31 -0400 (Mon, 11 May 2009)
New Revision: 13337
Modified:
branches/JBoss_Portal_Branch_2_7_AS5/core/src/resources/portal-core-sar/conf/identity/standardidentity-config.xml
Log:
You can specify more names using comma sperated values
Modified: branches/JBoss_Portal_Branch_2_7_AS5/core/src/resources/portal-core-sar/conf/identity/standardidentity-config.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7_AS5/core/src/resources/portal-core-sar/conf/identity/standardidentity-config.xml 2009-05-11 12:56:20 UTC (rev 13336)
+++ branches/JBoss_Portal_Branch_2_7_AS5/core/src/resources/portal-core-sar/conf/identity/standardidentity-config.xml 2009-05-11 12:56:31 UTC (rev 13337)
@@ -327,14 +327,16 @@
</option>
<!-- this option allows to specify the admin users so
- an external client can know them using UserModule api
+ an external client can know them using UserModule api.
+ You can specify more names using comma sperated values
<option>
<name>adminUsers</name>
<value>admin</value>
</option> -->
<!-- this option allows to specify the admin roles so
- an external client can know them using RoleModule api
+ an external client can know them using RoleModule api.
+ You can specify more names using comma sperated values
<option>
<name>adminRoles</name>
<value>Admin</value>
15 years
JBoss Portal SVN: r13336 - branches/JBoss_Portal_Branch_2_7/core/src/resources/portal-core-sar/conf/identity.
by portal-commits@lists.jboss.org
Author: sviluppatorefico
Date: 2009-05-11 08:56:20 -0400 (Mon, 11 May 2009)
New Revision: 13336
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/resources/portal-core-sar/conf/identity/standardidentity-config.xml
Log:
You can specify more names using comma sperated values
Modified: branches/JBoss_Portal_Branch_2_7/core/src/resources/portal-core-sar/conf/identity/standardidentity-config.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core/src/resources/portal-core-sar/conf/identity/standardidentity-config.xml 2009-05-11 12:52:57 UTC (rev 13335)
+++ branches/JBoss_Portal_Branch_2_7/core/src/resources/portal-core-sar/conf/identity/standardidentity-config.xml 2009-05-11 12:56:20 UTC (rev 13336)
@@ -327,14 +327,16 @@
</option>
<!-- this option allows to specify the admin users so
- an external client can know them using UserModule api
+ an external client can know them using UserModule api.
+ You can specify more names using comma sperated values
<option>
<name>adminUsers</name>
<value>admin</value>
</option> -->
<!-- this option allows to specify the admin roles so
- an external client can know them using RoleModule api
+ an external client can know them using RoleModule api.
+ You can specify more names using comma sperated values
<option>
<name>adminRoles</name>
<value>Admin</value>
15 years