Author: vrockai
Date: 2009-04-03 10:21:49 -0400 (Fri, 03 Apr 2009)
New Revision: 13148
Modified:
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardTestCase.java
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/IdentityAdminTestCase.java
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/PortalSamplesTestCase.java
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/UserLoginTestCase.java
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/WSRPTestCase.java
Log:
[selenium] - test descriptions in javadoc
Modified:
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardTestCase.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardTestCase.java 2009-04-02
23:22:35 UTC (rev 13147)
+++
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardTestCase.java 2009-04-03
14:21:49 UTC (rev 13148)
@@ -12,6 +12,8 @@
public class DashboardTestCase extends JBossPortalSeleniumTestCase {
+ private static final String MSG_POWER = "Powered by JBoss Enterprise Portal
Platform";
+
public String casePfx = "dash.";
private final String LNK_POR_WEA_EDIT = getProp(casePfx + "lnk.por.wea.edit",
"//body/div[2]/div/div/div[2]/div/div/div/div/div/div/table/tbody/tr/td[2]/div/div/div[2]/span/a");
@@ -61,7 +63,7 @@
@Test(enabled = true)
public void testCreatePage() {
selenium.click(LNK_DASHBOARD);
-
+ selenium.setSpeed("5000");
// selenium.waitForPageToLoad(PAGE_LOAD);
wait(5000);
@@ -75,10 +77,11 @@
selenium.click(LNK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
+ waitFor(AJAX_LOAD);
Assert.assertTrue(selenium.isElementPresent("link=" + pageName));
selenium.click("link=" + pageName);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isTextPresent("Powered by JBoss Portal"));
+ Assert.assertTrue(selenium.isTextPresent(MSG_POWER));
}
@Test(enabled = true, dependsOnMethods = { "testCreatePage" })
@@ -100,10 +103,11 @@
selenium.click(LNK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
+ waitFor(AJAX_LOAD);
Assert.assertTrue(selenium.isElementPresent("link=" + pageName));
selenium.click("link=" + pageName);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isTextPresent("Powered by JBoss Portal"));
+ Assert.assertTrue(selenium.isTextPresent(MSG_POWER));
// then rename it
selenium.click(LNK_CONFIGURE_DASHBOARD);
@@ -334,7 +338,7 @@
selenium.click("link=" + pageName);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isTextPresent("Powered by JBoss Portal"));
+ Assert.assertTrue(selenium.isTextPresent(MSG_POWER));
// add weather portlet
selenium.open("/portal/");
Modified:
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/IdentityAdminTestCase.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/IdentityAdminTestCase.java 2009-04-02
23:22:35 UTC (rev 13147)
+++
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/IdentityAdminTestCase.java 2009-04-03
14:21:49 UTC (rev 13148)
@@ -14,7 +14,7 @@
@Test(groups = { "admin_ui" }, enabled = true)
public class IdentityAdminTestCase extends JBossPortalSeleniumTestCase {
-
+ /** prefix for locator properties */
public String casePfx = "iden.man.";
private final String INP_USER_SEARCH_PREV = getProp(casePfx +
"inp.user.search.prev",
"//input[contains(@id,'search-user-form1:prev-page')]");
@@ -118,6 +118,12 @@
* }
*/
+ /**
+ * Test create user is responsible for user creation.
+ * It creates a user named "tempUser" with password "TempPassword"
and e-mail "tempUser(a)redhat.com".
+ * Then it tries to look up the user with search function.
+ * At the end, it deletes the temp user.
+ */
@Test(enabled = true, description = "Creation of new user.")
public void testCreateUser() {
createUser("tempUser", "tempPassword",
"tempUser(a)redhat.com");
@@ -125,6 +131,13 @@
deleteUser("tempUser", "tempUser(a)redhat.com");
}
+ /**
+ * Test create existing user is respnosible for testing already created user creation.
+ * It creates a user named "tempUser" with password "TempPassword"
and e-mail "tempUser(a)redhat.com".
+ * Then it tries to look up the user with search function.
+ * After success it tries to create the same user again and asserts that it is not
possible.
+ * At the end, it deletes the temp user.
+ */
@Test(enabled = true, dependsOnMethods = { "testCreateUser" }, description =
"Creation of already existing user.")
public void testCreateExistingUser() {
createUser("tempUser", "tempPassword",
"tempUser(a)redhat.com");
@@ -133,6 +146,11 @@
deleteUser("tempUser", "tempUser(a)redhat.com");
}
+ /**
+ * Test create role is responsible for user creation.
+ * It creates a role named "tempRole" with display name
"tempRoleDisplay".
+ * At the end, it deletes the temp user.
+ */
@Test(enabled = true, description = "Creation of new role.")
public void testCreateRole() {
String role = "tempRole";
@@ -140,12 +158,25 @@
deleteRole(role);
}
+ /**
+ * Test delete user is responsible for deleting a user.
+ * At first it creates user "deleteMe" with password "deleterPass"
and e-mail "disableMe(a)redhat.com"
+ * At the end it deletes the 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 disable user is responsible for disabling a user.
+ * At first it creates user "disableMe" with password "disablePass"
and e-mail "disableMe(a)redhat.com"
+ * After that, it logs out and try to login as disableMe/disablePass.
+ * After success it logs out again, and login as admin.
+ * It disables the disableMe user and tries to login as disableMe/disablePass again
asserting that login is not possible ( message about disabled account has to appear ).
+ *
+ */
@Test(enabled = true, description = "Creating and disabling a user.")
public void testDisableUser() {
final String userName = "disableMe";
@@ -194,6 +225,13 @@
deleteUser(userName, userMail);
}
+ /**
+ * Test enable user is responsible for enabling a user.
+ * At first it creates user "enableMe" with password "enableMe" and
e-mail "enableMe(a)redhat.com"
+ * Then it disables the user, asserts the user is really disabled and at the end it
enables the user.
+ * Only the appereance (or non-appereance ) of the "Enable" button for the
user is used for assertions.
+ */
+ //TODO better chcecking of the user status should be reconsidered (logging in)
@Test(enabled = true, dependsOnMethods = { "testDisableUser" }, description =
"Enabling disabled user.")
public void testEnableUser() {
final String userName = "enableMe";
@@ -224,6 +262,13 @@
deleteUser(userName, userMail);
}
+ /**
+ * Test edit user is responsible for user editing.
+ * At first it creates user "editMe" with password "editPass" and
e-mail "editMe(a)redhat.com".
+ * Then it searches for the user and click on edit link. The e-mail of user is changed
to "editMe2(a)redhat.com".
+ * The user is searched again and assert for his e-mail is made at the end.
+ * The user is deleted at the end of this test.
+ */
@Test(enabled = true, description = "Editing a user.")
public void testEditUser() {
final String userName = "editMe";
@@ -251,26 +296,7 @@
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.type(INP_EDIT_USER_EMAIL, "editMe2(a)redhat.com");
- /*
- * selenium.select("profile-form:timezone",
- * "label=(GMT -12:00 hours) Eniwetok, Kwajalein");
- * selenium.select("profile-form:theme",
"label=portal.industrial");
- * selenium.select("profile-form:locale", "label=Albanian");
- * selenium.type("profile-form:givenname", "Edit");
- * selenium.type("profile-form:lastname", "Meme");
- * selenium.type("profile-form:location", "Editoland");
- * selenium.type("profile-form:skype", "editor");
- * selenium.type("profile-form:icq", "112113114");
- * selenium.type("profile-form:aim", "83838495");
- * selenium.type("profile-form:msnm", "u8u8i9o0");
- * selenium.type("profile-form:yim", "99384875");
- * selenium.type("profile-form:xmmp", "10309128");
- * selenium.type("profile-form:homepage", "http://www.edit.com");
- * selenium.type("profile-form:occupation", "editor");
- * selenium.type("profile-form:interests", "editing");
- * selenium.type("profile-form:signature", "----\n\ni like to
edit");
- * selenium.type("profile-form:extra", "me edit good");
- */
+
selenium.click(SUB_EDIT_PROF);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent("editMe2(a)redhat.com"), "Edited
e-mail adress not visible.");
@@ -279,6 +305,12 @@
}
+ /**
+ * Test edit user change password is responsible for testing the change of password for
a user.
+ * At first it creates user "changePass" with password
"changePassPass" and e-mail "changePass(a)redhat.com".
+ * Then the password change orm is filled, but canceled. The next step is submitting the
password change to new value "changePass2".
+ * At the end the test tries to login with the new password and then it deletes the
"changePass" user.
+ */
@Test(enabled = true, description = "Editing a user - changing of password.")
public void testEditUserChangePassword() {
final String userName = "changePass";
@@ -338,6 +370,14 @@
deleteUser(userName, userMail);
}
+ /**
+ * Test role members is responsible for role assignment.
+ * At first it creates user "newRoleMember" with password
"newRoleMember" and e-mail "newRoleMem(a)redhatqa.com".
+ * Then it creates role with name "membersRole" and display name
"membersRoleDisplay".
+ * At next step it assignes the role to the user.
+ * It click for the "members" button for the "membersRole" and tries
to find "newRoleMember".
+ * At the end it deletes the "newRoleMember" user and "membersRole"
role.
+ */
@Test(enabled = true, description = "Managing members of role.")
public void testRoleMembers() {
final String roleName = "membersRole";
@@ -377,6 +417,11 @@
deleteUser(userName, userMail);
}
+ /**
+ * Test role edit is responsible for testing of role editing.
+ * At first it creates role with name "editRole" and display name
"editRoleDisplay".
+ * At the end it change the display name to "editedRoleDisplay" and delete the
role.
+ */
@Test(enabled = true, description = "Creation of new role.")
public void testRoleEdit() {
final String roleName = "editRole";
@@ -429,6 +474,10 @@
deleteRole(roleName);
}
+ /**
+ * @deprecated
+ * Test many users creates 25 users. The test is disabled.
+ */
@Test(enabled = false)
public void testManyUsers() {
for (int i = 0; i < 25; i++) {
@@ -436,6 +485,12 @@
}
}
+ /**
+ * Test search user count is responsible for the search functions for users..
+ * The test creates 95 users named man0us - man94us.
+ * Then it tests the paginator of the search functions. It sets count of results to
10,50 and 100,
+ * traverse through paginator and check, whether the amount of returned results is
correct.
+ */
@Test(enabled = true, description = "Altering the number of rows in user
search")
public void testSearchUserCount() {
Modified:
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/PortalSamplesTestCase.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/PortalSamplesTestCase.java 2009-04-02
23:22:35 UTC (rev 13147)
+++
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/PortalSamplesTestCase.java 2009-04-03
14:21:49 UTC (rev 13148)
@@ -5,107 +5,117 @@
import org.testng.annotations.Test;
import static org.testng.Assert.*;
-
@Test(groups = { "test_samples" }, enabled = true)
public class PortalSamplesTestCase extends JBossPortalSeleniumTestCase {
-
+
public static long AJAX_TIMEOUT = 4500;
-
+
public static String casePfx = "samples.";
-
- private final String SES_LNK_INVALIDATE =
getProp(casePfx+"ses.lnk.invalidate","link=invalidate");
- private final String RES_DIV_RTEXT =
getProp(casePfx+"res.div.rtext","repeat-text");
- private final String RES_DIV_PTEXT =
getProp(casePfx+"res.div.ptext","product-text");
- private final String RES_LNK_P3 =
getProp(casePfx+"res.lnk.p3","link=Product3");
- private final String RES_LNK_P2 =
getProp(casePfx+"res.lnk.p2","link=Product2");
- private final String RES_LNK_P1 =
getProp(casePfx+"res.lnk.p1","link=Product1");
- private final String RES_INP = getProp(casePfx+"res.inp","repeat");
- private final String RES_LNK =
getProp(casePfx+"res.lnk","link=serveResource Demo");
- private final String WIN_DIV_CON =
getProp(casePfx+"win.div.con","//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div");
- private final String WIN_LNK = getProp(casePfx+"win.lnk","link=Window id
test");
- private final String SES_TAB_PSCOPE =
getProp(casePfx+"ses.tab.pscope","//html/body/div[2]/div/div/div[2]/div[2]/div/table/tbody/tr[2]/td[2]/div/table");
- private final String SES_TAB_ASCOPE =
getProp(casePfx+"ses.tab.ascope","//html/body/div[2]/div/div/div[2]/div[2]/div/table/tbody/tr[2]/td[2]/div/table[2]");
- private final String SES_SUB_ASCOPE =
getProp(casePfx+"ses.sub.ascope","application");
- private final String SES_SUB_PSCOPE =
getProp(casePfx+"ses.sub.pscope","portlet");
- private final String SES_INP_VAL =
getProp(casePfx+"ses.inp.val","value");
- private final String SES_INP_NAM =
getProp(casePfx+"ses.inp.nam","name");
- private final String SES_LNK = getProp(casePfx+"ses.lnk","link=Session
test");
- private final String PUB_1_LNK_FOO_REM =
getProp(casePfx+"pub.1.lnk.foo.rem","link=Remove");
- private final String PUB_3_LNK_BAR_REM =
getProp(casePfx+"pub.3.lnk.bar.rem","//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[2]/td[2]/a");
- private final String PUB_3_LNK_JUU_REM =
getProp(casePfx+"pub.3.lnk.juu.rem","//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[1]/td[2]/a");
- private final String PUB_SUB_2 =
getProp(casePfx+"pub.sub.2","//div[@id='regionB']/div[1]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[3]/td/input");
- private final String PUB_SUB_1 =
getProp(casePfx+"pub.sub.1","//input[@value='Update']");
- private final String PUB_DIV_3_BAR =
getProp(casePfx+"pub.div.3.bar","//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[2]/td[2]/input");
- private final String PUB_DIV_3_JUU =
getProp(casePfx+"pub.div.3.juu","//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[1]/td[2]/input");
- private final String PUB_DIV_2_JUU =
getProp(casePfx+"pub.div.2.juu","juu");
- private final String PUB_DIV_2_FOO =
getProp(casePfx+"pub.div.2.foo","//div[@id='regionB']/div[1]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[1]/td[2]/input");
- private final String PUB_DIV_1_BAR =
getProp(casePfx+"pub.div.1.bar","bar");
- private final String PUB_DIV_1_FOO =
getProp(casePfx+"pub.div.1.foo","foo");
- private final String PUB_LNK = getProp(casePfx+"pub.lnk","link=Public
parameters test");
- private final String PEVT_DIV_P3_MAX =
getProp(casePfx+"pevt.div.p3.max","//div[@id='regionB']/div[3]/table/tbody/tr[1]/td[2]/div[2]/span[1]/a");
- private final String PEVT_DIV_P2_MAX =
getProp(casePfx+"pevt.div.p2.max","//div[@id='regionB']/div[2]/table/tbody/tr[1]/td[2]/div[2]/span[1]/a");
- private final String PEVT_DIV_L3_MAX =
getProp(casePfx+"pevt.div.l3.max","//div[@id='regionA']/div[3]/table/tbody/tr[1]/td[2]/div[2]/span[1]/a");
- private final String PEVT_DIV_L2_MAX =
getProp(casePfx+"pevt.div.l2.max","//div[@id='regionA']/div[2]/table/tbody/tr[1]/td[2]/div[2]/span[1]/a");
- private final String PEVT_DIV_P3 =
getProp(casePfx+"pevt.div.p3","//div[@id='regionB']/div[3]/table/tbody/tr[2]/td[2]/div/");
- private final String PEVT_DIV_P2 =
getProp(casePfx+"pevt.div.p2","//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/");
- private final String PEVT_DIV_P1 =
getProp(casePfx+"pevt.div.p1","//div[@id='regionB']/div[1]/table/tbody/tr[2]/td[2]/div/");
- private final String PEVT_DIV_L3 =
getProp(casePfx+"pevt.div.l3","//div[@id='regionA']/div[3]/table/tbody/tr[2]/td[2]/div/");
- private final String PEVT_DIV_L2 =
getProp(casePfx+"pevt.div.l2","//div[@id='regionA']/div[2]/table/tbody/tr[2]/td[2]/div/");
- private final String PEVT_DIV_L1 =
getProp(casePfx+"pevt.div.l1","//div[@id='regionA']/div[1]/table/tbody/tr[2]/td[2]/div/");
- private final String PEVT_LNK = getProp(casePfx+"pevt.lnk","link=Page
event test");
- private final String MOD_DIV_CON =
getProp(casePfx+"mod.div.con","//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div");
- private final String MOD_LNK = getProp(casePfx+"mod.lnk","link=Mode
test");
- private final String MPOR_DIV_CON =
getProp(casePfx+"mpor.div.con","content-container");
- private final String MPOR_LNK = getProp(casePfx+"mpor.lnk","link=Missing
portlet");
- private final String MINS_DIV_CON =
getProp(casePfx+"mins.div.con","content-container");
- private final String MINS_LNK = getProp(casePfx+"mins.lnk","link=Missing
instance");
- private final String JS_LNK_SUBMIT =
getProp(casePfx+"js.lnk.submit","link=submit");
- private final String JS_OPT_3 =
getProp(casePfx+"js.opt.3","//form[contains(@id,'_the_form')]/select/option[3]");
- private final String JS_OPT_2 =
getProp(casePfx+"js.opt.2","//form[contains(@id,'_the_form')]/select/option[2]");
- private final String JS_OPT_1 =
getProp(casePfx+"js.opt.1","//form[@id='jbpnsFormAutoSubmitPortletWindowsnpbj_the_form']/select/option[1]");
- private final String JS_LAB_C =
getProp(casePfx+"js.lab.c","label=C");
- private final String JS_LAB_B =
getProp(casePfx+"js.lab.b","label=B");
- private final String JS_LAB_A =
getProp(casePfx+"js.lab.a","label=A");
- private final String JS_SEL_LETTER =
getProp(casePfx+"js.sel.letter","//select[@onclick=\"document.getElementById('jbpnsFormAutoSubmitPortletWindowsnpbj_the_form').submit()\"]");
- private final String JS_LNK = getProp(casePfx+"js.lnk","link=Javascript
test");
- private final String HEAD_INP_CONTENT =
getProp(casePfx+"head.inp.content","Introducing-HeaderContentInput");
- private final String HEAD_DIV_CONTENT =
getProp(casePfx+"head.div.content","Introducing-HeaderContent");
- private final String HEAD_LNK = getProp(casePfx+"head.lnk","link=Header
test");
- private final String FS_LNK = getProp(casePfx+"fs.lnk","link=File system
content");
- private final String EXC_LNK_PORTLET =
getProp(casePfx+"exc.lnk.portlet","link=render PortletException");
- private final String EXC_LNK = getProp(casePfx+"exc.lnk","link=Exception
test");
- private final String EVT_SUB_COLOR =
getProp(casePfx+"evt.sub.color","//input[@type='submit']");
- private final String EVT_DIV_BLACK =
getProp(casePfx+"evt.div.black","//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/div[contains(@style,'black')]");
- private final String EVT_DIV_RED =
getProp(casePfx+"evt.div.red","//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/div[contains(@style,'red')]");
- private final String EVT_DIV_BLUE =
getProp(casePfx+"evt.div.blue","//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/div[contains(@style,'blue')]");
- private final String EVT_SEL_LAB_BLACK =
getProp(casePfx+"evt.sel.lab.black","label=black");
- private final String EVT_SEL_LAB_RED =
getProp(casePfx+"evt.sel.lab.red","label=red");
- private final String EVT_SEL_LAB_BLUE =
getProp(casePfx+"evt.sel.lab.blue","label=blue");
- private final String EVT_SEL_COL =
getProp(casePfx+"evt.sel.col","color");
- private final String EVT_LNK = getProp(casePfx+"evt.lnk","link=Event
test");
- private final String ENC_LNK = getProp(casePfx+"enc.lnk","link=Encoding
test");
- private final String ENC_INP_REN =
getProp(casePfx+"enc.inp.ren","text");
- private final String ENC_SUB_ACT =
getProp(casePfx+"enc.sub.act","//input[@value='Submit to action
phase']");
- private final String ENC_INP_ACT =
getProp(casePfx+"enc.inp.act","//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div/div[1]/form[2]/input[1]");
- private final String ENC_TEXTAREA2 =
getProp(casePfx+"enc.textarea2","//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div/div[5]/textarea");
- private final String ENC_TEXTAREA1 =
getProp(casePfx+"enc.textarea1","//textarea[@name='text']");
- private final String CHAR_ALL_SUB_CHECK =
getProp(casePfx+"char.all.sub.check","//html/body/div[2]/div/div/div[2]/div[2]/div/table/tbody/tr[2]/td[2]/div/div[8]/form/input[3]");
- private final String CHAR_INP_TEXT_SUB_CHECK =
getProp(casePfx+"char.inp.text.sub.check","//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div/div[8]/form/input[3]");
- private final String CHAR_LNK_TEXTAREA_CHECK =
getProp(casePfx+"char.lnk.textarea.check","//input[@value='check']");
- private final String CHAR_INP_TEXT =
getProp(casePfx+"char.inp.text","//input[@name='text']");
- private final String CHAR_TEXTAREA =
getProp(casePfx+"char.textarea","text");
- private final String CHAR_SUB_CHANGE =
getProp(casePfx+"char.sub.change","//input[@value='change']");
- private final String CHAR_INP_TO =
getProp(casePfx+"char.inp.to","to");
- private final String CHAR_INP_FROM =
getProp(casePfx+"char.inp.from","from");
- private final String CHAR_LNK = getProp(casePfx+"char.lnk","link=Charset
test");
- private final String CACHE_LNK = getProp(casePfx+"cache.lnk","link=Cache
test");
- private final String CACHE_LNK_2REN =
getProp(casePfx+"cache.lnk.2ren","//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/div[5]/a");
- private final String CACHE_LNK_2ACT =
getProp(casePfx+"cache.lnk.2act","//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/div[4]/a");
- private final String CACHE_LNK_1REN =
getProp(casePfx+"cache.lnk.1ren","link=render");
- private final String CACHE_LNK_1ACT =
getProp(casePfx+"cache.lnk.1act","link=action");
- private final String CACHE_2RENDER =
getProp(casePfx+"cache.2render","//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/div[2]/div");
- private final String CACHE_1RENDER =
getProp(casePfx+"cache.1render","//div[@id='regionB']/div[1]/table/tbody/tr[2]/td[2]/div/div[2]/div");
+ private final String SES_LNK_INVALIDATE = getProp(casePfx +
"ses.lnk.invalidate", "link=invalidate");
+ private final String RES_DIV_RTEXT = getProp(casePfx + "res.div.rtext",
"repeat-text");
+ private final String RES_DIV_PTEXT = getProp(casePfx + "res.div.ptext",
"product-text");
+ private final String RES_LNK_P3 = getProp(casePfx + "res.lnk.p3",
"link=Product3");
+ private final String RES_LNK_P2 = getProp(casePfx + "res.lnk.p2",
"link=Product2");
+ private final String RES_LNK_P1 = getProp(casePfx + "res.lnk.p1",
"link=Product1");
+ private final String RES_INP = getProp(casePfx + "res.inp",
"repeat");
+ private final String RES_LNK = getProp(casePfx + "res.lnk",
"link=serveResource Demo");
+ private final String WIN_DIV_CON = getProp(casePfx + "win.div.con",
"//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div");
+ private final String WIN_LNK = getProp(casePfx + "win.lnk", "link=Window
id test");
+ private final String SES_TAB_PSCOPE = getProp(casePfx + "ses.tab.pscope",
"//html/body/div[2]/div/div/div[2]/div[2]/div/table/tbody/tr[2]/td[2]/div/table");
+ private final String SES_TAB_ASCOPE = getProp(casePfx + "ses.tab.ascope",
+ "//html/body/div[2]/div/div/div[2]/div[2]/div/table/tbody/tr[2]/td[2]/div/table[2]");
+ private final String SES_SUB_ASCOPE = getProp(casePfx + "ses.sub.ascope",
"application");
+ private final String SES_SUB_PSCOPE = getProp(casePfx + "ses.sub.pscope",
"portlet");
+ private final String SES_INP_VAL = getProp(casePfx + "ses.inp.val",
"value");
+ private final String SES_INP_NAM = getProp(casePfx + "ses.inp.nam",
"name");
+ private final String SES_LNK = getProp(casePfx + "ses.lnk", "link=Session
test");
+ private final String PUB_1_LNK_FOO_REM = getProp(casePfx +
"pub.1.lnk.foo.rem", "link=Remove");
+ private final String PUB_3_LNK_BAR_REM = getProp(casePfx +
"pub.3.lnk.bar.rem",
+ "//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[2]/td[2]/a");
+ private final String PUB_3_LNK_JUU_REM = getProp(casePfx +
"pub.3.lnk.juu.rem",
+ "//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[1]/td[2]/a");
+ private final String PUB_SUB_2 = getProp(casePfx + "pub.sub.2",
"//div[@id='regionB']/div[1]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[3]/td/input");
+ private final String PUB_SUB_1 = getProp(casePfx + "pub.sub.1",
"//input[@value='Update']");
+ private final String PUB_DIV_3_BAR = getProp(casePfx + "pub.div.3.bar",
+ "//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[2]/td[2]/input");
+ private final String PUB_DIV_3_JUU = getProp(casePfx + "pub.div.3.juu",
+ "//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[1]/td[2]/input");
+ private final String PUB_DIV_2_JUU = getProp(casePfx + "pub.div.2.juu",
"juu");
+ private final String PUB_DIV_2_FOO = getProp(casePfx + "pub.div.2.foo",
+ "//div[@id='regionB']/div[1]/table/tbody/tr[2]/td[2]/div/form/table/tbody/tr[1]/td[2]/input");
+ private final String PUB_DIV_1_BAR = getProp(casePfx + "pub.div.1.bar",
"bar");
+ private final String PUB_DIV_1_FOO = getProp(casePfx + "pub.div.1.foo",
"foo");
+ private final String PUB_LNK = getProp(casePfx + "pub.lnk", "link=Public
parameters test");
+ private final String PEVT_DIV_P3_MAX = getProp(casePfx + "pevt.div.p3.max",
"//div[@id='regionB']/div[3]/table/tbody/tr[1]/td[2]/div[2]/span[1]/a");
+ private final String PEVT_DIV_P2_MAX = getProp(casePfx + "pevt.div.p2.max",
"//div[@id='regionB']/div[2]/table/tbody/tr[1]/td[2]/div[2]/span[1]/a");
+ private final String PEVT_DIV_L3_MAX = getProp(casePfx + "pevt.div.l3.max",
"//div[@id='regionA']/div[3]/table/tbody/tr[1]/td[2]/div[2]/span[1]/a");
+ private final String PEVT_DIV_L2_MAX = getProp(casePfx + "pevt.div.l2.max",
"//div[@id='regionA']/div[2]/table/tbody/tr[1]/td[2]/div[2]/span[1]/a");
+ private final String PEVT_DIV_P3 = getProp(casePfx + "pevt.div.p3",
"//div[@id='regionB']/div[3]/table/tbody/tr[2]/td[2]/div/");
+ private final String PEVT_DIV_P2 = getProp(casePfx + "pevt.div.p2",
"//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/");
+ private final String PEVT_DIV_P1 = getProp(casePfx + "pevt.div.p1",
"//div[@id='regionB']/div[1]/table/tbody/tr[2]/td[2]/div/");
+ private final String PEVT_DIV_L3 = getProp(casePfx + "pevt.div.l3",
"//div[@id='regionA']/div[3]/table/tbody/tr[2]/td[2]/div/");
+ private final String PEVT_DIV_L2 = getProp(casePfx + "pevt.div.l2",
"//div[@id='regionA']/div[2]/table/tbody/tr[2]/td[2]/div/");
+ private final String PEVT_DIV_L1 = getProp(casePfx + "pevt.div.l1",
"//div[@id='regionA']/div[1]/table/tbody/tr[2]/td[2]/div/");
+ private final String PEVT_LNK = getProp(casePfx + "pevt.lnk", "link=Page
event test");
+ private final String MOD_DIV_CON = getProp(casePfx + "mod.div.con",
"//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div");
+ private final String MOD_LNK = getProp(casePfx + "mod.lnk", "link=Mode
test");
+ private final String MPOR_DIV_CON = getProp(casePfx + "mpor.div.con",
"content-container");
+ private final String MPOR_LNK = getProp(casePfx + "mpor.lnk",
"link=Missing portlet");
+ private final String MINS_DIV_CON = getProp(casePfx + "mins.div.con",
"content-container");
+ private final String MINS_LNK = getProp(casePfx + "mins.lnk",
"link=Missing instance");
+ private final String JS_LNK_SUBMIT = getProp(casePfx + "js.lnk.submit",
"link=submit");
+ private final String JS_OPT_3 = getProp(casePfx + "js.opt.3",
"//form[contains(@id,'_the_form')]/select/option[3]");
+ private final String JS_OPT_2 = getProp(casePfx + "js.opt.2",
"//form[contains(@id,'_the_form')]/select/option[2]");
+ private final String JS_OPT_1 = getProp(casePfx + "js.opt.1",
"//form[@id='jbpnsFormAutoSubmitPortletWindowsnpbj_the_form']/select/option[1]");
+ private final String JS_LAB_C = getProp(casePfx + "js.lab.c",
"label=C");
+ private final String JS_LAB_B = getProp(casePfx + "js.lab.b",
"label=B");
+ private final String JS_LAB_A = getProp(casePfx + "js.lab.a",
"label=A");
+ private final String JS_SEL_LETTER = getProp(casePfx + "js.sel.letter",
+ "//select[@onclick=\"document.getElementById('jbpnsFormAutoSubmitPortletWindowsnpbj_the_form').submit()\"]");
+ private final String JS_LNK = getProp(casePfx + "js.lnk",
"link=Javascript test");
+ private final String HEAD_INP_CONTENT = getProp(casePfx + "head.inp.content",
"Introducing-HeaderContentInput");
+ private final String HEAD_DIV_CONTENT = getProp(casePfx + "head.div.content",
"Introducing-HeaderContent");
+ private final String HEAD_LNK = getProp(casePfx + "head.lnk",
"link=Header test");
+ private final String FS_LNK = getProp(casePfx + "fs.lnk", "link=File
system content");
+ private final String EXC_LNK_PORTLET = getProp(casePfx + "exc.lnk.portlet",
"link=render PortletException");
+ private final String EXC_LNK = getProp(casePfx + "exc.lnk",
"link=Exception test");
+ private final String EVT_SUB_COLOR = getProp(casePfx + "evt.sub.color",
"//input[@type='submit']");
+ private final String EVT_DIV_BLACK = getProp(casePfx + "evt.div.black",
+ "//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/div[contains(@style,'black')]");
+ private final String EVT_DIV_RED = getProp(casePfx + "evt.div.red",
"//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/div[contains(@style,'red')]");
+ private final String EVT_DIV_BLUE = getProp(casePfx + "evt.div.blue",
+ "//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/div[contains(@style,'blue')]");
+ private final String EVT_SEL_LAB_BLACK = getProp(casePfx +
"evt.sel.lab.black", "label=black");
+ private final String EVT_SEL_LAB_RED = getProp(casePfx + "evt.sel.lab.red",
"label=red");
+ private final String EVT_SEL_LAB_BLUE = getProp(casePfx + "evt.sel.lab.blue",
"label=blue");
+ private final String EVT_SEL_COL = getProp(casePfx + "evt.sel.col",
"color");
+ private final String EVT_LNK = getProp(casePfx + "evt.lnk", "link=Event
test");
+ private final String ENC_LNK = getProp(casePfx + "enc.lnk",
"link=Encoding test");
+ private final String ENC_INP_REN = getProp(casePfx + "enc.inp.ren",
"text");
+ private final String ENC_SUB_ACT = getProp(casePfx + "enc.sub.act",
"//input[@value='Submit to action phase']");
+ private final String ENC_INP_ACT = getProp(casePfx + "enc.inp.act",
"//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div/div[1]/form[2]/input[1]");
+ private final String ENC_TEXTAREA2 = getProp(casePfx + "enc.textarea2",
"//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div/div[5]/textarea");
+ private final String ENC_TEXTAREA1 = getProp(casePfx + "enc.textarea1",
"//textarea[@name='text']");
+ private final String CHAR_ALL_SUB_CHECK = getProp(casePfx +
"char.all.sub.check",
+ "//html/body/div[2]/div/div/div[2]/div[2]/div/table/tbody/tr[2]/td[2]/div/div[8]/form/input[3]");
+ private final String CHAR_INP_TEXT_SUB_CHECK = getProp(casePfx +
"char.inp.text.sub.check",
+ "//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div/div[8]/form/input[3]");
+ private final String CHAR_LNK_TEXTAREA_CHECK = getProp(casePfx +
"char.lnk.textarea.check", "//input[@value='check']");
+ private final String CHAR_INP_TEXT = getProp(casePfx + "char.inp.text",
"//input[@name='text']");
+ private final String CHAR_TEXTAREA = getProp(casePfx + "char.textarea",
"text");
+ private final String CHAR_SUB_CHANGE = getProp(casePfx + "char.sub.change",
"//input[@value='change']");
+ private final String CHAR_INP_TO = getProp(casePfx + "char.inp.to",
"to");
+ private final String CHAR_INP_FROM = getProp(casePfx + "char.inp.from",
"from");
+ private final String CHAR_LNK = getProp(casePfx + "char.lnk",
"link=Charset test");
+ private final String CACHE_LNK = getProp(casePfx + "cache.lnk",
"link=Cache test");
+ private final String CACHE_LNK_2REN = getProp(casePfx + "cache.lnk.2ren",
"//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/div[5]/a");
+ private final String CACHE_LNK_2ACT = getProp(casePfx + "cache.lnk.2act",
"//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/div[4]/a");
+ private final String CACHE_LNK_1REN = getProp(casePfx + "cache.lnk.1ren",
"link=render");
+ private final String CACHE_LNK_1ACT = getProp(casePfx + "cache.lnk.1act",
"link=action");
+ private final String CACHE_2RENDER = getProp(casePfx + "cache.2render",
"//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/div[2]/div");
+ private final String CACHE_1RENDER = getProp(casePfx + "cache.1render",
"//div[@id='regionB']/div[1]/table/tbody/tr[2]/td[2]/div/div[2]/div");
+
@BeforeMethod(groups = { "log" })
public void loginBeforeTest() {
selenium.open("/portal/portal/default/default");
@@ -116,34 +126,35 @@
public void logoutAfterTest() {
}
+
@Test(enabled = true)
public void cacheTest() {
selenium.click(CACHE_LNK);
selenium.waitForPageToLoad(PAGE_LOAD);
assertEquals("0", selenium.getText(CACHE_1RENDER));
assertEquals("0", selenium.getText(CACHE_2RENDER));
-
+
selenium.click(CACHE_LNK_1ACT);
selenium.waitForPageToLoad(PAGE_LOAD);
assertEquals("1", selenium.getText(CACHE_1RENDER));
assertEquals("1", selenium.getText(CACHE_2RENDER));
-
+
selenium.click(CACHE_LNK_1REN);
selenium.waitForPageToLoad(PAGE_LOAD);
assertEquals("1", selenium.getText(CACHE_1RENDER));
assertEquals("2", selenium.getText(CACHE_2RENDER));
-
+
selenium.click(CACHE_LNK_2ACT);
selenium.waitForPageToLoad(PAGE_LOAD);
assertEquals("1", selenium.getText(CACHE_1RENDER));
assertEquals("3", selenium.getText(CACHE_2RENDER));
-
+
selenium.click(CACHE_LNK_2REN);
selenium.waitForPageToLoad(PAGE_LOAD);
assertEquals("1", selenium.getText(CACHE_1RENDER));
- assertEquals("4", selenium.getText(CACHE_2RENDER));
+ assertEquals("4", selenium.getText(CACHE_2RENDER));
}
-
+
@Test(enabled = true)
public void charsetTest() {
selenium.click(CHAR_LNK);
@@ -171,9 +182,9 @@
selenium.type(CHAR_INP_TEXT, "789:;<=>?@f");
selenium.click(CHAR_ALL_SUB_CHECK);
selenium.waitForPageToLoad(PAGE_LOAD);
- assertTrue(selenium.isTextPresent("Test result: The input matched the expected
result"));
+ assertTrue(selenium.isTextPresent("Test result: The input matched the expected
result"));
}
-
+
@Test(enabled = true)
public void encodingTest() {
selenium.click(ENC_LNK);
@@ -189,9 +200,9 @@
selenium.click("//input[@value='Submit to render phase']");
selenium.waitForPageToLoad(PAGE_LOAD);
assertEquals("", selenium.getValue(ENC_TEXTAREA1));
- assertEquals("action", selenium.getValue(ENC_TEXTAREA2));
+ assertEquals("action", selenium.getValue(ENC_TEXTAREA2));
}
-
+
@Test(enabled = true)
public void eventTest() {
selenium.click(EVT_LNK);
@@ -209,32 +220,32 @@
selenium.waitForPageToLoad(PAGE_LOAD);
assertTrue(selenium.isElementPresent(EVT_DIV_BLACK));
}
-
+
@Test(enabled = true)
public void exceptionTest() {
selenium.click(EXC_LNK);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(EXC_LNK_PORTLET);
selenium.waitForPageToLoad(PAGE_LOAD);
- assertTrue(selenium.isTextPresent("javax.portlet.PortletException"));
+ assertTrue(selenium.isTextPresent("javax.portlet.PortletException"));
}
-
+
@Test(enabled = true)
public void fileSystemContentTest() {
selenium.click(FS_LNK);
selenium.waitForPageToLoad(PAGE_LOAD);
- assertTrue(selenium.isTextPresent("Bar content"));
+ assertTrue(selenium.isTextPresent("Bar content"));
}
-
+
@Test(enabled = true)
public void headerTest() {
selenium.click(HEAD_LNK);
selenium.waitForPageToLoad(PAGE_LOAD);
- assertTrue(selenium.isElementPresent(HEAD_DIV_CONTENT));
+ assertTrue(selenium.isElementPresent(HEAD_DIV_CONTENT));
selenium.click(HEAD_INP_CONTENT);
assertEquals("hello from the injected java script!", selenium.getAlert());
}
-
+
@Test(enabled = true)
public void javascriptTest() {
selenium.click(JS_LNK);
@@ -243,100 +254,100 @@
waitFor(AJAX_TIMEOUT);
selenium.click(JS_OPT_1);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
assertFalse(selenium.isSomethingSelected(JS_SEL_LETTER));
-
+
selenium.addSelection(JS_SEL_LETTER, JS_LAB_B);
waitFor(AJAX_TIMEOUT);
selenium.click(JS_OPT_2);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
assertFalse(selenium.isSomethingSelected(JS_SEL_LETTER));
-
+
selenium.addSelection(JS_SEL_LETTER, JS_LAB_C);
waitFor(AJAX_TIMEOUT);
selenium.click(JS_OPT_3);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
assertFalse(selenium.isSomethingSelected(JS_SEL_LETTER));
-
+
selenium.click(JS_LNK_SUBMIT);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
assertFalse(selenium.isSomethingSelected(JS_SEL_LETTER));
}
-
+
@Test(enabled = true)
public void missingInstanceTest() {
selenium.click(MINS_LNK);
selenium.waitForPageToLoad(PAGE_LOAD);
- assertEquals("", selenium.getText(MINS_DIV_CON));
+ assertEquals("", selenium.getText(MINS_DIV_CON));
}
-
+
@Test(enabled = true)
public void missingPortletTest() {
selenium.click(MPOR_LNK);
selenium.waitForPageToLoad(PAGE_LOAD);
- assertEquals("", selenium.getText(MPOR_DIV_CON));
+ assertEquals("", selenium.getText(MPOR_DIV_CON));
}
-
+
@Test(enabled = true)
public void modeTest() {
selenium.click(MOD_LNK);
selenium.waitForPageToLoad(PAGE_LOAD);
assertEquals("View", selenium.getText(MOD_DIV_CON));
}
-
+
@Test(enabled = true)
public void pageEventTest() {
final String portletText = "This is a simple showcase of Portal Node Event
Listener. For this portal page it ensures that in every column, only one portlet window is
in NORMAL state. Try to change the window state of other portlets and see what happens. To
learn more, read InterPortlet Communication (IPC) chapter in JBoss Portal Reference
Guide.";
final String emptyText = "";
-
+
selenium.click(PEVT_LNK);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
// Left column
-
+
assertEquals(portletText, selenium.getText(PEVT_DIV_L1));
assertEquals(emptyText, selenium.getText(PEVT_DIV_L2));
assertEquals(emptyText, selenium.getText(PEVT_DIV_L3));
-
+
selenium.click(PEVT_DIV_L2_MAX);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
assertEquals(emptyText, selenium.getText(PEVT_DIV_L1));
assertEquals(portletText, selenium.getText(PEVT_DIV_L2));
assertEquals(emptyText, selenium.getText(PEVT_DIV_L3));
-
+
selenium.click(PEVT_DIV_L3_MAX);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
assertEquals(emptyText, selenium.getText(PEVT_DIV_L1));
assertEquals(emptyText, selenium.getText(PEVT_DIV_L2));
assertEquals(portletText, selenium.getText(PEVT_DIV_L3));
-
+
// Right column
-
+
assertEquals(portletText, selenium.getText(PEVT_DIV_P1));
assertEquals(emptyText, selenium.getText(PEVT_DIV_P2));
assertEquals(emptyText, selenium.getText(PEVT_DIV_P3));
-
+
selenium.click(PEVT_DIV_P2_MAX);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
assertEquals(emptyText, selenium.getText(PEVT_DIV_P1));
assertEquals(portletText, selenium.getText(PEVT_DIV_P2));
assertEquals(emptyText, selenium.getText(PEVT_DIV_P3));
-
+
selenium.click(PEVT_DIV_P3_MAX);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
assertEquals(emptyText, selenium.getText(PEVT_DIV_P1));
assertEquals(emptyText, selenium.getText(PEVT_DIV_P2));
assertEquals(portletText, selenium.getText(PEVT_DIV_P3));
-
+
}
-
+
@Test(enabled = true)
public void publicParametersTest() {
selenium.click(PUB_LNK);
@@ -399,13 +410,12 @@
assertEquals("", selenium.getValue(PUB_DIV_3_JUU));
assertEquals("", selenium.getValue(PUB_DIV_3_BAR));
}
-
+
@Test(enabled = false)
public void secureTest() {
-
-
+
}
-
+
@Test(enabled = true)
public void sessionTest() {
selenium.click(SES_LNK);
@@ -414,54 +424,61 @@
selenium.type(SES_INP_VAL, "scopeval1");
selenium.click(SES_SUB_PSCOPE);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
int r = findTableRow(SES_TAB_PSCOPE, "scope1", 0);
- assertTrue(r>0);
+ assertTrue(r > 0);
assertEquals(findTableRow(SES_TAB_PSCOPE, "scopeval1", 1), r);
-
- //assertEquals("scope1",
selenium.getText("//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div/table[1]/tbody/tr[2]/td[1]"));
- //assertEquals("scopeval1",
selenium.getText("//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div/table[1]/tbody/tr[2]/td[2]"));
+
+ // assertEquals("scope1", selenium.getText(
+ //
"//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div/table[1]/tbody/tr[2]/td[1]"
+ // ));
+ // assertEquals("scopeval1", selenium.getText(
+ //
"//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div/table[1]/tbody/tr[2]/td[2]"
+ // ));
selenium.type(SES_INP_NAM, "app1");
selenium.type(SES_INP_VAL, "appval1");
selenium.click(SES_SUB_ASCOPE);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
r = findTableRow(SES_TAB_ASCOPE, "app1", 0);
- assertTrue(r>0);
+ assertTrue(r > 0);
assertEquals(findTableRow(SES_TAB_ASCOPE, "appval1", 1), r);
-
- //assertEquals("app1",
selenium.getText("//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div/table[2]/tbody/tr[2]/td[1]"));
- //assertEquals("appval1",
selenium.getText("//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div/table[2]/tbody/tr[2]/td[2]"));
-
+
+ // assertEquals("app1", selenium.getText(
+ //
"//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div/table[2]/tbody/tr[2]/td[1]"
+ // ));
+ // assertEquals("appval1", selenium.getText(
+ //
"//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div/table[2]/tbody/tr[2]/td[2]"
+ // ));
+
selenium.click(SES_LNK_INVALIDATE);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
assertFalse(selenium.isTextPresent("Session id"));
}
-
+
@Test(enabled = false)
public void urlPortletTest() {
-
-
+
}
-
+
@Test(enabled = true)
public void windowIdTest() {
selenium.click(WIN_LNK);
selenium.waitForPageToLoad(PAGE_LOAD);
- assertEquals("Window ID is equals to /default/Test/Window id
test/WindowIDPortletWindow", selenium.getText(WIN_DIV_CON));
+ assertEquals("Window ID is equals to /default/Test/Window id
test/WindowIDPortletWindow", selenium.getText(WIN_DIV_CON));
}
-
+
@Test(enabled = true)
public void serveResourceDemoTest() {
-
+
selenium.click(RES_LNK);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.type(RES_INP, "valtest");
selenium.typeKeys(RES_INP, " ");
-
+
waitFor(AJAX_TIMEOUT);
-
+
assertEquals("valtest", selenium.getText(RES_DIV_RTEXT));
selenium.click(RES_LNK_P1);
waitFor(AJAX_TIMEOUT);
@@ -472,9 +489,7 @@
selenium.click(RES_LNK_P3);
waitFor(AJAX_TIMEOUT);
assertEquals("Product ID: 3\n SANTA CRUZ ALLSTAR\n$256.00",
selenium.getText(RES_DIV_PTEXT));
-
+
}
-
-
-
+
}
Modified:
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/UserLoginTestCase.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/UserLoginTestCase.java 2009-04-02
23:22:35 UTC (rev 13147)
+++
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/UserLoginTestCase.java 2009-04-03
14:21:49 UTC (rev 13148)
@@ -6,12 +6,15 @@
/**
+ * Testcase responsible for testing of login form.
+ *
* @author <a href="mailto:vrockai@redhat.com">Viliam Rockai</a>
*/
@Test(groups = { "login" }, enabled = true)
public class UserLoginTestCase extends JBossPortalSeleniumTestCase {
+ /** prefix for locator properties */
public final String casePfx = "user.login.";
private final String ADR_PORTAL =
getProp(casePfx+"adr.portal","/portal");
@@ -25,7 +28,7 @@
private final String LNK_LOGIN =
getProp(casePfx+"lnk.login","link=Login");
@AfterClass(enabled = true)
- public void logoutIfNeeded()
+ private void logoutIfNeeded()
{
selenium.open(ADR_PORTAL);
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -36,8 +39,14 @@
}
}
+
+ /**
+ * Test default user login.
+ *
+ * Login as user/user and check if the message with login information appears.
+ */
@Test(enabled = true, description = "login as default user 'user' with
password 'user'.")
- public void testDefaultUserLogin() throws Exception {
+ public void testDefaultUserLogin() {
final String loginName = "user";
final String loginPass = "user";
@@ -73,8 +82,13 @@
Assert.assertFalse(selenium.isTextPresent("Logged in as:"),
"\"Logged in as:\" message with no user logged in is missing.");
}
+ /**
+ * Test admin login.
+ *
+ * Login as admin/admin and check if the message with login information appears.
+ */
@Test(enabled = true, description = "login as admin user 'admin' with
password 'admin'.")
- public void testAdminLogin() throws Exception {
+ public void testAdminLogin() {
final String loginName = "admin";
final String loginPass = "admin";
@@ -108,8 +122,13 @@
Assert.assertFalse(selenium.isTextPresent("Logged in as:"),
"\"Logged in as:\" message with no user logged in is missing.");
}
+ /**
+ * Test user login cancel.
+ *
+ * Fill the login form with user/user, but press cancel instead of login.
+ */
@Test(enabled = true, description = "canceling of the login form.")
- public void testUserLoginCancel() throws Exception {
+ public void testUserLoginCancel() {
final String loginName = "saki";
final String loginPass = "paki";
@@ -141,8 +160,13 @@
Assert.assertFalse(selenium.isTextPresent("Logged in as:"),
"\"Logged in as:\" message with no user logged in is missing.");
}
+ /**
+ * Test false name login.
+ *
+ * Try to login with us2er/user and check that you are not logged in.
+ */
@Test(enabled = true, description = "login as 'us2er' which does not
exist.")
- public void testFalseNameLogin() throws Exception {
+ public void testFalseNameLogin() {
final String loginName = "us2er";
final String loginPass = "user";
@@ -169,8 +193,14 @@
Assert.assertTrue(selenium.isTextPresent("The user doesn't exist or the
password is incorrect "), "\"Logged in as\" message missing.");
}
+
+ /**
+ * Test false password login.
+ *
+ * Try to login with user/us2er and check that you are not logged in.
+ */
@Test(enabled = true, description = "login as 'user' with wrong password
'us2er'.")
- public void testFalsePasswordLogin() throws Exception {
+ public void testFalsePasswordLogin() {
final String loginName = "user";
final String loginPass = "us2er";
Modified:
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/WSRPTestCase.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/WSRPTestCase.java 2009-04-02
23:22:35 UTC (rev 13147)
+++
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/WSRPTestCase.java 2009-04-03
14:21:49 UTC (rev 13148)
@@ -6,12 +6,16 @@
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
+
/**
+ * The Class WSRPTestCase is reponsible for testing the WSRP GUI of JBoss Portal.
+ *
* @author <a href="mailto:vrockai@redhat.com">Viliam Rockai</a>
*/
@Test(groups = { "cms_wsrp" }, enabled = true, description = "WSRP test
case.")
public class WSRPTestCase extends JBossPortalSeleniumTestCase {
+ /** prefix for locator properties */
public static String casePfx = "test.wsrp.";
private final String INP_CONSUMER_NAME =
getProp(casePfx+"inp.consumer.name","//input[contains(@id,'edit-cons-form:id')]");
@@ -44,16 +48,38 @@
private final String WSRP_CONSUMER_TABLE =
getProp(casePfx+"link.wsrp.consumer.table","//table[contains(@id,':consumer-list-form:consumersList')]");
@BeforeMethod(groups = { "log" })
- public void loginBeforeTest() {
+ private void loginBeforeTest() {
logoutIfPossible();
login("admin", "admin");
}
@AfterMethod(groups = { "log" })
- public void logoutAfterTest() {
+ private void logoutAfterTest() {
//logout();
}
+ /**
+ * Test create bea consume is responsible for creating BEA consumer named
<b>BEA</b>. Navigate to WSRP gui and create consumer with these parameters:
+ * <br/>
+ * <table>
+ * <tr>
+ * <td><b>Producer id:</b></td><td>BEA</td>
+ * </tr>
+ * <tr>
+ * <td><b>Cache expiration:</b></td><td>600</td>
+ * </tr>
+ * <tr>
+ * <td><b>Endpoint
configuration:</b></td><td>http://wsrp.bea.com:7001/producer/producer?WSDL
(using WSDL)</td>
+ * </tr>
+ * <tr>
+ * <td><b>Registration
information:</b></td><td><code>{urn:bea:wlp:prop:reg:registration}consumerRole</code>
: public</td>
+ * </tr>
+ * </table>
+ * <br/>
+ * After clicking refresh&save button, the test checks for text message about
successful refresh.
+ * Then it check whether the BEA consumer is appearing in the main consumers table.
+ */
+ //TODO checking for the resulting consumer in table should be using selenium extension
@Test(enabled = true, description = "Creating a standard BEA consumer.")
public void testCreateBeaConsumer() {
selenium.open("/portal/");
@@ -85,6 +111,11 @@
Assert.assertTrue(selenium.isTextPresent("BEA"));
}
+ /**
+ * Test bea consumer register is reponsible for registering previously deregistered
consumer <b>BEAreg</b>.
+ * It finds the <b>BEAreg</b> consumer in the main consumer table and clicks
on its register icon.
+ * After that, it checks whether the register icon changed its text to
"deregister"
+ */
@Test(enabled = true, dependsOnMethods = { "testCreateBeaConsumer",
"testBeaConsumerDeregister" }, description = "Standard BEA consumer
registering.")
public void testBeaConsumerRegister() {
@@ -109,6 +140,11 @@
Assert.assertEquals(selenium.getText(MessageFormat.format(LINK_T_CONS_DER,r)),
"Deregister");
}
+ /**
+ * Test bea consumer deregister is responsible for deleting previously created BEA
consumer.
+ * It creates BEA consumer with name BEA and values similiar to that from
{@link=testCreateBeaConsumer}.
+ * Then it clicks on deregister link for the consumer and checks whether deregister link
has changed into register link.
+ */
@Test(enabled = true, dependsOnMethods = { "testCreateBeaConsumer" },
description = "Standard BEA consumer deregistering.")
public void testBeaConsumerDeregister() {
@@ -132,6 +168,11 @@
Assert.assertEquals(selenium.getText(MessageFormat.format(LINK_T_CONS_DER,r)),
"Register");
}
+ /**
+ * Test bea consumer activate is responsible for activating previously deactivated
consumer.
+ * It works with consumer named <b>BEAact</b> and checks whether the
consumer has message showing it's inactive and refresh is needed.
+ * Then it click on activate link and check that the message has disappeared.
+ */
@Test(enabled = true, dependsOnMethods = { "testCreateBeaConsumer",
"testBeaConsumerDeactivate" }, description = "Standard BEA consumer
activating.")
public void testBeaConsumerActivate() {
selenium.open("/portal/");
@@ -153,6 +194,12 @@
}
+ /**
+ * Test bea consumer deactivate is responsible for deactivating a bea consumer.
+ * Firstly it creates bea consumer named <b>BEAact</b> with parameters
similiar to that from {@link=testCreateBeaConsumer}.
+ * Then it asserts that message signalling the consumer non-active state is missing.
+ * After clicking on deactivation link it assert, that the message signalling non-active
state of consumer has appeared.
+ */
@Test(enabled = true, dependsOnMethods = { "testCreateBeaConsumer" },
description = "Standard BEA consumer deactivating.")
public void testBeaConsumerDeactivate() {
@@ -177,11 +224,21 @@
}
+ /**
+ * Test bea consumer configure. Test is disabled - deleting of the method should be
considered.
+ */
+ //TODO deleting of the method should be considered.
@Test(enabled = false, dependsOnMethods = { "testCreateBeaConsumer" },
description = "Standard BEA consumer configuring.")
public void testBeaConsumerConfigure() {
}
+
+ /**
+ * Test bea consumer delete is responsible for deleting a bea consumer.
+ * Firstly it creates bea consumer named <b>BEAdel</b> with parameters
similiar to that from {@link=testCreateBeaConsumer}.
+ * It click on the delete icon for the consumer and then it asserts the consumer has
disappeared from the table.
+ */
@Test(enabled = true, dependsOnMethods = { "testCreateBeaConsumer" },
description = "Standard BEA consumer deleting.")
public void testBeaConsumerDelete() {
@@ -211,6 +268,22 @@
Assert.assertFalse(selenium.isTextPresent("BEAdel"));
}
+ /**
+ * Test configure producer is used for basic configuring of WSRP producer.
+ * If fills up the registration properties with these values:
+ * <table>
+ * <tr>
+ * <td><b>Name</b></td><td>testProp</td>
+ * <td><b>Label</b></td><td>testProp label</td>
+ * <td><b>Hint</b></td><td>tetsPropHint</td>
+ * </tr>
+ * </table>
+ *
+ * It saves the properties and checks they were saved.
+ * <br/>
+ * Missing: It doesn't test the function of cancel button and checkboxes in producer
configuration.
+ */
+ //TODO the function of cancel button and checkboxes in producer configuration.
@Test(enabled = true, description = "Basic configuring of WSRP producer.")
public void testConfigureProducer() {
selenium.open("/portal/");
@@ -241,6 +314,12 @@
}
+ /**
+ * Test configure consumer is responsible for configuring bea consumer.
+ * Firstly it creates bea consumer named <b>renameMe</b> with parameters
similiar to that from {@link=testCreateBeaConsumer}.
+ * Then it clicks on configure button for the consumer and rename it to
<b>renameNewMe</b>.
+ * At the end it asserts that the previous name is missing in the consumers table and
the new name has appeared.
+ */
@Test(enabled = true, description = "Renaming a consumer through the configure
button.")
public void testConfigureConsumer() {
final String name = "renameMe";