Author: vrockai
Date: 2008-10-21 11:24:10 -0400 (Tue, 21 Oct 2008)
New Revision: 12117
Added:
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/DashboardsTestCase.java
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PortletDefinitionsTestCase.java
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PortletInstancesTestCase.java
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/JBossPortalSeleniumTestCase.java
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/cms/CMSFileTestCase.java
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:
portal testcases added
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 2008-10-21
15:22:11 UTC (rev 12116)
+++
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardTestCase.java 2008-10-21
15:24:10 UTC (rev 12117)
@@ -11,17 +11,17 @@
@Test(groups = { "cms_dashboard" }, enabled = true, description =
"Dashboard issues test case.")
public class DashboardTestCase extends JBossPortalSeleniumTestCase {
- private static final String SUBMIT_ADDCENTER =
"//input[contains(@id,'layoutForm:a_center";
- private static final String SUBMIT_ADDLEFT =
"//input[contains(@id,'layoutForm:a_left";
+ private static final String SUBMIT_ADDCENTER =
"//input[contains(@id,'layoutForm:a_center')]";
+ private static final String SUBMIT_ADDLEFT =
"//input[contains(@id,'layoutForm:a_left')]";
private static final String LINK_CONFIGURE_DASHBOARD = "link=Configure
dashboard";
private static final String LINK_DASHBOARD = "link=Dashboard";
- private static final String SELECT_PAGE =
"page-selector-form:pageNameSelector";
- private static final String INPUT_PAGENAME =
"//input[contains(@id,'dashboard-form:pageName";
- private static final String SUBMIT_CREATEPAGE =
"//input[contains(@id,'dashboard-form:save-button";
- private static final String SELECT_LAYOUT =
"//input[contains(@id,'dashboardLayoutForm:layoutSelector";
- private static final String SUBMIT_LAYOUTSEL =
"//input[contains(@id,'dashboardLayoutForm:update-layout";
- private static final String SELECT_THEME =
"//input[contains(@id,'dashboardThemeForm:themeSelector";
- private static final String SUBMIT_THEMESEL =
"dashboardThemeForm:update-theme";
+ private static final String SELECT_PAGE =
"//select[contains(@id,'pageNameSelector')]";
+ private static final String INPUT_PAGENAME =
"//input[contains(@id,':pageName')]";
+ private static final String SUBMIT_CREATEPAGE =
"//form[contains(@id,'j_id3')]/input[@type='submit']";
+ private static final String SELECT_LAYOUT =
"//select[contains(@id,'dashboardLayoutForm:layoutSelector')]";
+ private static final String SUBMIT_LAYOUTSEL =
"//form[contains(@id,'dashboardLayoutForm')]/input[@type='submit']";
+ private static final String SELECT_THEME =
"//select[contains(@id,'dashboardThemeForm:themeSelector')]";
+ private static final String SUBMIT_THEMESEL =
"//form[contains(@id,'dashboardThemeForm')]/input[@type='submit']";
@BeforeMethod(groups = { "log" })
public void loginBeforeTest() {
@@ -40,8 +40,9 @@
selenium.click(LINK_CONFIGURE_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.type(INPUT_PAGENAME, "DashTestPage");
- selenium.click(SUBMIT_CREATEPAGE);
- selenium.waitForPageToLoad(PAGE_LOAD);
+
+ clickAndWait(SUBMIT_CREATEPAGE);
+
selenium.click(LINK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isElementPresent("link=DashTestPage"));
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 2008-10-21
15:22:11 UTC (rev 12116)
+++
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/IdentityAdminTestCase.java 2008-10-21
15:24:10 UTC (rev 12117)
@@ -331,7 +331,7 @@
//search for the real member of current role
selenium.type(INP_ROLE_SEARCH_USER, "newRoleMember");
selenium.click(SUB_ROLE_SEARCH_USER);
- selenium.waitForPageToLoad(PAGE_LOAD);
+ waitFor(10000);
r = findTableRow(TABLE_ROLEMEMBERS, "newRoleMember", 0);
Assert.assertTrue(r>0, "Assigned member not found in the role members
table.");
@@ -339,7 +339,7 @@
//search for the non-member user of current role
selenium.type(INP_ROLE_SEARCH_USER, "newRoleNonMember");
selenium.click(SUB_ROLE_SEARCH_USER);
- selenium.waitForPageToLoad(PAGE_LOAD);
+ waitFor(10000);
Assert.assertFalse(selenium.isElementPresent(TABLE_ROLEMEMBERS), "Not assigned
member found in the role members table.");
@@ -568,7 +568,7 @@
selenium.waitForPageToLoad(PAGE_LOAD);
Assert
- .assertTrue(selenium.isTextPresent("This username is already taken.
tempUser"),
+ .assertTrue(selenium.isTextPresent("This username is already taken."),
"No user was overwritten, current username wasn't already taken.");
}
Modified:
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java 2008-10-21
15:22:11 UTC (rev 12116)
+++
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java 2008-10-21
15:24:10 UTC (rev 12117)
@@ -6,6 +6,7 @@
import com.thoughtworks.selenium.DefaultSelenium;
import com.thoughtworks.selenium.Selenium;
+
/**
* @author <a href="mailto:vrockai@redhat.com">Viliam Rockai</a>
*/
@@ -18,8 +19,13 @@
public static final String INPUT_PASSWORD = "j_password";
public static final String INPUT_USERNAME = "j_username";
protected Selenium selenium;
- protected static final String PAGE_LOAD = "250000";
+ // Generic timeout in miliseconds
+ protected static final String PAGE_LOAD = "900000";
+
+ // Element timeout in seconds
+ protected static final int ELEM_TIMEOUT = 60;
+
@BeforeClass
public void setupChromeForLogin() throws Exception {
@@ -35,16 +41,17 @@
}
protected void clickIfVisible(String id) {
-
- if (selenium.isElementPresent(id)){
+
+ if (selenium.isElementPresent(id)) {
selenium.click(id);
+
selenium.waitForPageToLoad(PAGE_LOAD);
}
}
-
+
protected void clickIfVisible(String id, String awaited) {
-
- if (selenium.isElementPresent(id)){
+
+ if (selenium.isElementPresent(id)) {
selenium.click(id);
selenium.waitForPageToLoad(PAGE_LOAD);
}
@@ -63,59 +70,123 @@
return true;
}
}
-
+
return false;
}
protected int findTableRow(String tableLocation, String searchName, int searchCol) {
return Integer.valueOf(selenium.getEval("selenium.findTableRow(\"" +
tableLocation + "\",'" + searchName + "'," + searchCol +
")"));
}
-
- protected int countTableRows(String tableLocation){
+
+ protected int countTableRows(String tableLocation) {
return Integer.valueOf(selenium.getEval("selenium.countTableRows(\"" +
tableLocation + "\")"));
}
-
- protected void clickAndWait(String locator){
+
+ // TODO refactor
+ protected void safeSelect(String locator, String value) {
+ waitForElement(locator);
+
+ for (int second = 0;; second++) {
+ if (second >= ELEM_TIMEOUT) {
+ Assert.fail("Element " + locator + " not found.");
+ }
+ try {
+ String[] opts = selenium.getSelectOptions(locator);
+ boolean isAvailable = false;
+
+ for (String opt : opts) {
+ if (opt.equals(value)) {
+ isAvailable = true;
+ }
+ }
+
+ if (isAvailable)
+ break;
+ } catch (Exception e) {
+ }
+ waitFor(1000);
+ }
+
+ selenium.select(locator, "label=" + value);
+ }
+
+ protected void clickAndWait(String locator) {
+ waitForElement(locator);
selenium.click(locator);
selenium.waitForPageToLoad(PAGE_LOAD);
}
-
- protected void openAndWait(String locator){
+
+ protected void openAndWait(String locator) {
selenium.open(locator);
selenium.waitForPageToLoad(PAGE_LOAD);
}
-
+
protected void selectIfNotSelected(String selector, String label) {
+ waitForElement(selector);
if (!selenium.getSelectedLabel(selector).equals(label)) {
selenium.select(selector, "label=" + label);
selenium.waitForPageToLoad(PAGE_LOAD);
}
}
-
- protected boolean assertTextOrder(String text){
+
+ protected boolean assertTextOrder(String text) {
return Boolean.valueOf(selenium.getEval("selenium.assertTextOrder(\"" +
text + "\")"));
}
+ protected void waitFor(long time) {
+ try {
+ Thread.sleep(time);
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+ protected void waitForElement(String locator) {
+ for (int second = 0;; second++) {
+ if (second >= ELEM_TIMEOUT) {
+ Assert.fail("Element " + locator + " not found.");
+ }
+ try {
+ if (selenium.isElementPresent(locator))
+ break;
+ } catch (Exception e) {
+ }
+ waitFor(1000);
+ }
+ }
+
+ public void waitForText(String text) {
+ for (int second = 0;; second++) {
+ if (second >= ELEM_TIMEOUT) {
+ Assert.fail("Text '" + text + "' not found.");
+ }
+ try {
+ if (selenium.isTextPresent(text))
+ break;
+ } catch (Exception e) {
+ }
+ waitFor(1000);
+ }
+ }
+
protected void login(String username, String password) {
selenium.open(ADDR_PORTAL);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
selenium.click(LINK_LOGIN);
selenium.selectFrame(FRAME_LOGIN_CONTENT);
-
- try {
- Thread.sleep(2000);
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
+
+ waitForElement(INPUT_USERNAME);
+ waitForElement(INPUT_PASSWORD);
+ waitForElement(SUBMIT_LOGIN);
+
selenium.type(INPUT_USERNAME, username);
selenium.type(INPUT_PASSWORD, password);
Assert.assertTrue(selenium.isElementPresent(SUBMIT_LOGIN));
selenium.click(SUBMIT_LOGIN);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isTextPresent("Logged in as: "+username),
"Not logged in, login message missing.");
+ Assert.assertTrue(selenium.isTextPresent("Logged in as: " + username),
"Not logged in, login message missing.");
}
protected void logout() {
@@ -127,15 +198,15 @@
Assert.assertFalse(selenium.isTextPresent("Logged in as:"), "Not logged
in, login message missing.");
Assert.assertTrue(selenium.isElementPresent("Link=Login"), "Login link
not present.");
}
-
+
protected void logoutIfPossible() {
selenium.open(ADDR_PORTAL);
selenium.waitForPageToLoad(PAGE_LOAD);
- if (selenium.isElementPresent(LINK_LOGOUT)){
- selenium.click(LINK_LOGOUT);
- selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertFalse(selenium.isTextPresent("Logged in as:"), "Not logged
in, login message missing.");
- Assert.assertTrue(selenium.isElementPresent("Link=Login"), "Login link
not present.");
+ if (selenium.isElementPresent(LINK_LOGOUT)) {
+ selenium.click(LINK_LOGOUT);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertFalse(selenium.isTextPresent("Logged in as:"), "Not logged
in, login message missing.");
+ Assert.assertTrue(selenium.isElementPresent("Link=Login"), "Login link
not present.");
}
}
}
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 2008-10-21
15:22:11 UTC (rev 12116)
+++
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/WSRPTestCase.java 2008-10-21
15:24:10 UTC (rev 12117)
@@ -13,7 +13,7 @@
public class WSRPTestCase extends JBossPortalSeleniumTestCase {
private static final String SUBMIT_REFRESH_CANCEL =
"//input[contains(@id,'edit-cons-form:list-cons-link_1')]";
private static final String SUBMIT_PROD_SAVE =
"//input[contains(@id,'producer-form:save-producer')]";
- private static final String SUBMIT_CONSDEL_CONF =
"//input[contains(@id,'confirm-delete-form:destroy-linkv";
+ private static final String SUBMIT_CONSDEL_CONF =
"//input[contains(@id,':destroy-link')]";
private static final String SUBMIT_CONS_REGVAL =
"//input[contains(@id,'edit-cons-form:refresh-cons-link')]";
private static final String SUBMIT_REFRESHFINAL =
"//input[contains(@id,'edit-cons-form:refresh-cons-link')]";
@@ -44,7 +44,7 @@
- public static String WSRP_CONSUMER_TABLE =
"consumer-list-form:consumersList";
+ public static String WSRP_CONSUMER_TABLE =
"//table[contains(@id,':consumer-list-form:consumersList')]";
@BeforeMethod(groups = { "log" })
public void loginBeforeTest() {
@@ -208,8 +208,7 @@
selenium.captureScreenshot("delete");
Assert.assertTrue(selenium.isTextPresent("Delete 'BEAdel'
consumer?"));
- selenium.click(SUBMIT_CONSDEL_CONF);
- selenium.waitForPageToLoad(PAGE_LOAD);
+ clickAndWait(SUBMIT_CONSDEL_CONF);
Assert.assertFalse(selenium.isTextPresent("BEAdel"));
}
@@ -225,8 +224,8 @@
clickIfVisible(ID_LINK_PRODCONF);
- selenium.click(SUBMIT_ADDPROP_INIT);
- selenium.waitForPageToLoad(PAGE_LOAD);
+ clickAndWait(SUBMIT_ADDPROP_INIT);
+
selenium.type(INPUT_PROPNAME, "testProp");
selenium.type(INPUT_PROPLABEL, "testProp label");
selenium.type(INPUT_PROPHINT, "tetsPropHint");
@@ -274,12 +273,10 @@
Assert.assertTrue(r>0, "Created consumer not found in table");
// rename the consumer
- selenium.click(MessageFormat.format(LINK_T_CONS_CON,r-1));
- selenium.waitForPageToLoad(PAGE_LOAD);
+ clickAndWait(MessageFormat.format(LINK_T_CONS_CON,r-1));
- selenium.type("edit-cons-form:id", nameNew);
- selenium.click("edit-cons-form:refresh-cons-link");
- selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.type(INPUT_USERNAME, nameNew);
+ clickAndWait(SUBMIT_REFRESHSAVE);
clickIfVisible(ID_LINK_CONSCONF);
clickIfVisible(LINK_CONSUMER_HOME);
Modified:
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileTestCase.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileTestCase.java 2008-10-21
15:22:11 UTC (rev 12116)
+++
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileTestCase.java 2008-10-21
15:24:10 UTC (rev 12117)
@@ -14,7 +14,7 @@
public class CMSFileTestCase extends JBossPortalSeleniumTestCase {
private final String CMS_FILE_TABLE =
"//div[@id='center']/div/div/div[3]/table";
- public static final String CMS_FILE_PENDING_TABLE =
"//div[@id='center']/div/div/table[2]";
+ public static final String CMS_FILE_PENDING_TABLE =
"//div[@id='center']/div/div/table";
@BeforeMethod(groups = { "log" })
public void loginBeforeTest() {
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 2008-10-21
15:22:11 UTC (rev 12116)
+++
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/AdminPortalTestCase.java 2008-10-21
15:24:10 UTC (rev 12117)
@@ -14,38 +14,38 @@
@Test(groups = { "admin_portal" }, enabled = true, description = "Partal
administrating.")
public class AdminPortalTestCase extends JBossPortalSeleniumTestCase {
- private static final String SUBMIT_RENAME_PORTAL = "renameForm:rename";
- private static final String INPUT_RENAME_PORTAL = "renameForm:newName";
- private static final String SUBMIT_DELETE_PORTAL_CONF =
"delete-view:confirm-form:delete";
- private static final String INPUT_SUBMIT_PAGECREATE =
"create-page-form:create-page";
- private static final String INPUT_PAGENAME = "create-page-form:pageName";
- private static final String INPUT_PORTALNAME = "create-portal-form:name";
- private static final String INPUT_SUBMIT_CREATEPORTAL =
"create-portal-form:create-portal";
+ private static final String SUBMIT_RENAME_PORTAL =
"//input[contains(@id,'renameForm:rename')]";
+ private static final String INPUT_RENAME_PORTAL =
"//input[contains(@id,'renameForm:newName')]";
+ private static final String SUBMIT_DELETE_PORTAL_CONF =
"//input[contains(@id,'delete-view:confirm-form:delete')]";
+ private static final String INPUT_SUBMIT_PAGECREATE =
"//input[contains(@id,'create-page-form:create-page')]";
+ private static final String INPUT_PAGENAME =
"//input[contains(@id,'create-page-form:pageName')]";
+ private static final String INPUT_PORTALNAME =
"//input[contains(@id,'create-portal-form:name')]";
+ private static final String INPUT_SUBMIT_CREATEPORTAL =
"//input[contains(@id,'create-portal-form:create-portal')]";
private final String TAB_PORTALOBJ_ID = "//div[@id='current']/a";
private final String LINK_PORTALS_ID = "link=*Portal Objects*";
- private final String LINK_PORTAL_HOME = "obj-temp-form:object-link-0";
+ private final String LINK_PORTAL_HOME =
"//input[contains(@id,'obj-temp-form:object-link-0')]";
- private final String TABLE_PORTAL_ADMIN = "obj-nav-form:portal-datatable";
- private final String POR_TL_MAIN =
"obj-nav-form:portal-datatable:{0}:object-iid-link";
- private final String POR_TL_SECURITY =
"obj-nav-form:portal-datatable:{0}:security-link";
- private final String POR_TL_PROPERTIES =
"obj-nav-form:portal-datatable:{0}:prop-link";
- private final String POR_TL_THEME =
"obj-nav-form:portal-datatable:{0}:theme-link";
- private final String POR_TL_RENAME =
"obj-nav-form:portal-datatable:{0}:rename";
- private final String POR_TL_DELETE =
"obj-nav-form:portal-datatable:{0}:delete";
- private final String POR_TL_MAKEDEF =
"obj-nav-form:portal-datatable:{0}:default-link";
+ private final String TABLE_PORTAL_ADMIN =
"//table[contains(@id,'obj-nav-form:portal-datatable')]";
+ private final String POR_TL_MAIN =
"//a[contains(@id,''obj-nav-form:portal-datatable:{0}:object-iid-link'')]";
+ private final String POR_TL_SECURITY =
"//a[contains(@id,''obj-nav-form:portal-datatable:{0}:security-link'')]";
+ private final String POR_TL_PROPERTIES =
"//a[contains(@id,''obj-nav-form:portal-datatable:{0}:prop-link'')]";
+ private final String POR_TL_THEME =
"//a[contains(@id,''obj-nav-form:portal-datatable:{0}:theme-link'')]";
+ private final String POR_TL_RENAME =
"//a[contains(@id,''obj-nav-form:portal-datatable:{0}:rename'')]";
+ private final String POR_TL_DELETE =
"//a[contains(@id,''obj-nav-form:portal-datatable:{0}:delete'')]";
+ private final String POR_TL_MAKEDEF =
"//a[contains(@id,''obj-nav-form:portal-datatable:{0}:default-link'')]";
- private final String TABLE_PORTALPAGE_ADMIN = "obj-nav-form:pages-datatable";
- private final String PAG_TL_MAIN =
"obj-nav-form:pages-datatable:{0}:object-link";
- private final String PAG_TL_LAYOUT =
"obj-nav-form:pages-datatable:{0}:edit-page-layout";
- private final String PAG_TL_SECURITY =
"obj-nav-form:pages-datatable:{0}:security-link";
- private final String PAG_TL_PROPERTIES =
"obj-nav-form:pages-datatable:{0}:prop-link";
- private final String PAG_TL_THEME =
"obj-nav-form:pages-datatable:{0}:theme-link";
- private final String PAG_TL_RENAME =
"obj-nav-form:pages-datatable:{0}:rename-link_1";
- private final String PAG_TL_DISPLAY =
"obj-nav-form:pages-datatable:{0}:rename-display";
- private final String PAG_TL_DELETE =
"obj-nav-form:pages-datatable:{0}:delete-link";
- private final String PAG_TL_MAKEDEF =
"obj-nav-form:pages-datatable:{0}:default-link";
+ private final String TABLE_PORTALPAGE_ADMIN =
"//table[contains(@id,'obj-nav-form:pages-datatable')]";
+ private final String PAG_TL_MAIN =
"//a[contains(@id,''obj-nav-form:pages-datatable:{0}:object-link'')]";
+ private final String PAG_TL_LAYOUT =
"//a[contains(@id,''obj-nav-form:pages-datatable:{0}:edit-page-layout'')]";
+ private final String PAG_TL_SECURITY =
"//a[contains(@id,''obj-nav-form:pages-datatable:{0}:security-link'')]";
+ private final String PAG_TL_PROPERTIES =
"//a[contains(@id,''obj-nav-form:pages-datatable:{0}:prop-link'')]";
+ private final String PAG_TL_THEME =
"//a[contains(@id,''obj-nav-form:pages-datatable:{0}:theme-link'')]";
+ private final String PAG_TL_RENAME =
"//a[contains(@id,''obj-nav-form:pages-datatable:{0}:rename-link_1'')]";
+ private final String PAG_TL_DISPLAY =
"//a[contains(@id,''obj-nav-form:pages-datatable:{0}:rename-display'')]";
+ private final String PAG_TL_DELETE =
"//a[contains(@id,''obj-nav-form:pages-datatable:{0}:delete-link'')]";
+ private final String PAG_TL_MAKEDEF =
"//a[contains(@id,''obj-nav-form:pages-datatable:{0}:default-link'')]";
@BeforeMethod(groups = { "log" })
public void loginBeforeTest() {
Added:
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/DashboardsTestCase.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/DashboardsTestCase.java
(rev 0)
+++
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/DashboardsTestCase.java 2008-10-21
15:24:10 UTC (rev 12117)
@@ -0,0 +1,154 @@
+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;
+
+public class DashboardsTestCase extends JBossPortalSeleniumTestCase {
+
+ private static final String T_DH_SUB_UPDATE =
"//input[contains(@id,'common-edit-theme-form:_id125jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj')]";
+ private static final String T_DH_SEL_RENDERSET =
"//input[contains(@id,'common-edit-theme-form:renderSet')]";
+ private static final String T_DH_SEL_THEME =
"//input[contains(@id,'common-edit-theme-form:theme')]";
+ private static final String T_DH_SEL_LAYOUT =
"//input[contains(@id,'common-edit-theme-form:layout')]";
+ private static final String T_PA_SUB_UPDATE =
"//input[contains(@id,'common-edit-page-error-form:update_2')]";
+ private static final String T_PO_SUB_UPDATE =
"//input[contains(@id,'common-edit-portal-error-form:update_1')]";
+ private static final String T_PA_INP_PAGEADD =
"//input[contains(@id,'common-edit-page-error-form:page-res-select')]";
+ private static final String T_PO_INP_PAGEADD =
"//input[contains(@id,'common-edit-portal-error-form:portal-res-input')]";
+ private static final String T_PA_SEL_PNF =
"//input[contains(@id,'common-edit-page-error-form:page-not-found-select')]";
+ private static final String T_PA_SEL_INTERN =
"//input[contains(@id,'common-edit-page-error-form:page-internal-select')]";
+ private static final String T_PA_SEL_ERROR =
"//input[contains(@id,'common-edit-page-error-form:page-error-select')]";
+ private static final String T_PA_SEL_CONTROL =
"//input[contains(@id,'common-edit-page-error-form:page-control-select')]";
+ private static final String T_PA_SEL_ACCESS =
"//input[contains(@id,'common-edit-page-error-form:page-access-select')]";
+ private static final String T_PO_SEL_PNF =
"//input[contains(@id,'common-edit-portal-error-form:portal-not-found-select')]";
+ private static final String T_PO_SEL_UNAVAIL =
"//input[contains(@id,'common-edit-portal-error-form:portal-unavail-select')]";
+ private static final String T_PO_SEL_ACCESS =
"//input[contains(@id,'common-edit-portal-error-form:portal-access-select')]";
+ private static final String SUBMIT_UPDATE_VALUE =
"//input[contains(@id,'common-manage-prop-form:update')]";
+ private static final String TABLE_PROPS =
"//table[contains(@id,'common-manage-prop-form:prop-data-table')]";
+ private static final String T_PROPS_INPUT_VALUE =
"//a[contains(@id,'common-manage-prop-form:prop-data-table:{0}:prop-value-input')]";
+ private static final String T_PROPS_LINK_DEL =
"//a[contains(@id,'common-manage-prop-form:prop-data-table:{0}:delete')]";
+
+ private static final String TABLE_PA_ERR =
"//form[@id='common-edit-page-error-form']/table";
+ private static final String TABLE_PO_ERR =
"//form[@id='common-edit-portal-error-form']/table";
+ private static final String TABLE_DH_THM =
"//form[@id='common-edit-theme-form']/table";
+ private static final String INPUT_PROP_NAME =
"//input[contains(@id,'common-edit-prop-form:property')]";
+ private static final String SUBMIT_ADD_PROP =
"//input[contains(@id,'common-edit-prop-form:add-property')]";
+ private static final String LINK_ADMIN = "link=Admin";
+ private static final String LINK_TAB_DASH =
"//a[contains(@id,'admin-subtab-form:dashboard-link')]";
+
+ @BeforeMethod(groups = { "log" })
+ public void loginBeforeTest() {
+ login("admin", "admin");
+ goToDash();
+ }
+
+ @AfterMethod(groups = { "log" })
+ public void logoutAfterTest() {
+ logout();
+ }
+
+ @Test(enabled = true)
+ public void testPropAdd() {
+ final String propName = "SelenProp";
+
+ Assert.assertFalse(selenium.isTextPresent(propName));
+ selenium.type(INPUT_PROP_NAME, propName);
+ selenium.click(SUBMIT_ADD_PROP);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(selenium.isTextPresent(propName));
+ }
+
+ @Test(enabled = true)
+ public void testPropUpdate() {
+ final String propName = "SelenValueProp";
+ final String value = "updatedValue";
+ Assert.assertFalse(selenium.isTextPresent(value));
+ Assert.assertFalse(selenium.isTextPresent(propName));
+ selenium.type(INPUT_PROP_NAME, propName);
+ selenium.click(SUBMIT_ADD_PROP);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(selenium.isTextPresent(propName));
+
+ int r = findTableRow(TABLE_PROPS, propName, 1);
+
+ selenium.type(MessageFormat.format(T_PROPS_INPUT_VALUE, r-1),value);
+ selenium.click(SUBMIT_UPDATE_VALUE);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertEquals(selenium.getValue(MessageFormat.format(T_PROPS_INPUT_VALUE,
r-1)),value,"Updated value not found.");
+
+ }
+
+ @Test(enabled = true)
+ public void testPropDelete() {
+ final String propName = "SelenDeleteProp";
+
+ Assert.assertFalse(selenium.isTextPresent(propName));
+ selenium.type(INPUT_PROP_NAME, propName);
+ selenium.click(SUBMIT_ADD_PROP);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(selenium.isTextPresent(propName));
+
+ int r = findTableRow(TABLE_PROPS, propName, 0);
+
+ selenium.click(MessageFormat.format(T_PROPS_LINK_DEL, r-1));
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertFalse(selenium.isTextPresent(propName));
+
+ }
+
+ @Test(enabled = true)
+ public void testPortalError() {
+ selenium.select(T_PO_SEL_ACCESS, "label=Redirect to the specified
resource");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.select(T_PO_SEL_UNAVAIL, "label=Redirect to the specified
resource");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.select(T_PO_SEL_PNF, "label=Redirect to the specified resource");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.type(T_PO_INP_PAGEADD, "/WEB-INF/jsp/error/portalX.jsp");
+ selenium.click(T_PO_SUB_UPDATE);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ }
+
+ @Test(enabled = true)
+ public void testPageError() {
+ selenium.select(T_PA_SEL_ACCESS, "label=Display the default error message");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.select(T_PA_SEL_CONTROL, "label=Redirect to the specified
resource");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.select(T_PA_SEL_ERROR, "label=Remove the resource from page");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.select(T_PA_SEL_INTERN, "label=Display the default error message");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.select(T_PA_SEL_PNF, "label=Redirect to the specified resource");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.type(T_PA_INP_PAGEADD, "/WEB-INF/jsp/error/pageY.jsp");
+ selenium.click(T_PA_SUB_UPDATE);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ }
+
+ @Test(enabled = true)
+ public void testDashboardTheme() {
+
+ safeSelect(T_DH_SEL_LAYOUT, "1column");
+
+ safeSelect(T_DH_SEL_THEME, "nphalanx");
+
+ safeSelect(T_DH_SEL_RENDERSET, "default");
+
+
+ clickAndWait(T_DH_SUB_UPDATE);
+
+ }
+
+ private void goToDash() {
+ selenium.open("/portal/");
+ clickIfVisible(LINK_ADMIN);
+ clickIfVisible(LINK_ADMIN);
+ clickIfVisible(LINK_TAB_DASH);
+ }
+}
Added:
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PortletDefinitionsTestCase.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PortletDefinitionsTestCase.java
(rev 0)
+++
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PortletDefinitionsTestCase.java 2008-10-21
15:24:10 UTC (rev 12117)
@@ -0,0 +1,97 @@
+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;
+
+public class PortletDefinitionsTestCase extends JBossPortalSeleniumTestCase{
+
+ private static final String T_LINK_PREF = "def-list:portlet-pref-{0}";
+ private static final String SUBMIT_CREATE_INST =
"add_instance_form:_id19jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj";
+ private static final String INPUT_INSTANCE_NAME =
"add_instance_form:instanceId";
+ private static final String T_LINK_CREATE = "def-list:create-instance-{0}";
+ private static final String SUBMIT_PROVIDER_VIEW =
"definition-form:view-portlets";
+ private static final String SELECT_PROVIDER = "definition-form:menu";
+ private static final String TABLE_PORTLET =
"//form[@id='def-list']/table";
+ private static final String LINK_NAME_ADMIN_PORT =
"common-show-portlet-detail-form:field1:select";
+ private static final String LINK_ADMIN_PORT = "def-list:portlet-def-0";
+ private static final String LINK_ADMIN = "link=Admin";
+ private static final String LINK_TAB_PD =
"admin-subtab-form:portlet-def-link";
+ private static final String LINK_PD_MAIN = "man-form:def-link";
+
+
+ @BeforeMethod(groups = { "log" })
+ public void loginBeforeTest() {
+ login("admin", "admin");
+ goToPD();
+ }
+
+ @AfterMethod(groups = { "log" })
+ public void logoutAfterTest() {
+ logout();
+ }
+
+ @Test(enabled = true)
+ public void testShowInfo(){
+ selenium.click(LINK_ADMIN_PORT);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(selenium.isTextPresent("Portlet Instance Information"));
+ Assert.assertTrue(selenium.isElementPresent(LINK_NAME_ADMIN_PORT));
+ Assert.assertTrue(selenium.isTextPresent("Administration Portlet"));
+ Assert.assertTrue(selenium.isTextPresent("Management Portlet"));
+ Assert.assertTrue(selenium.isTextPresent("management,admin"));
+ Assert.assertTrue(selenium.isTextPresent("de it en"));
+ }
+
+ @Test(enabled = true)
+ public void testCreateInstance(){
+
+ int r = findTableRow(TABLE_PORTLET, "Administration Portlet", 0);
+
+ selenium.click(MessageFormat.format(T_LINK_CREATE,r-1));
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.type(INPUT_INSTANCE_NAME, "littleAdmin");
+ selenium.click(SUBMIT_CREATE_INST);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(selenium.isTextPresent("littleAdmin portlet details"));
+ Assert.assertTrue(selenium.isTextPresent("Portlet Instance Information"));
+ }
+
+ @Test(enabled = true)
+ public void testPreferences(){
+
+ int r = findTableRow(TABLE_PORTLET, "Current Users Portlet", 0);
+
+ selenium.click(MessageFormat.format(T_LINK_PREF,r-1));
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(selenium.isTextPresent("Current Users Portlet
preferences"));
+ Assert.assertTrue(selenium.isTextPresent("guestNumber"));
+ }
+
+ @Test(enabled = true)
+ public void testSwitchProvider(){
+ selenium.select(SELECT_PROVIDER, "label=self");
+ selenium.click(SUBMIT_PROVIDER_VIEW);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ int n = countTableRows(TABLE_PORTLET);
+ Assert.assertTrue(findTableRow(TABLE_PORTLET, "Administration Portlet",
0)<0);
+
+ selenium.select(SELECT_PROVIDER, "label=local");
+ selenium.click(SUBMIT_PROVIDER_VIEW);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ n = countTableRows(TABLE_PORTLET);
+ Assert.assertTrue(findTableRow(TABLE_PORTLET, "Administration Portlet",
0)>=0);
+ }
+
+ private void goToPD(){
+ selenium.open("/portal/");
+ clickIfVisible(LINK_ADMIN);
+ clickIfVisible(LINK_ADMIN);
+ clickIfVisible(LINK_TAB_PD);
+ clickIfVisible(LINK_PD_MAIN);
+ }
+}
Added:
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PortletInstancesTestCase.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PortletInstancesTestCase.java
(rev 0)
+++
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PortletInstancesTestCase.java 2008-10-21
15:24:10 UTC (rev 12117)
@@ -0,0 +1,231 @@
+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;
+
+public class PortletInstancesTestCase extends JBossPortalSeleniumTestCase {
+
+ private static final String SUBMIT_SECURITY_UPDATE =
"common-edit-security-form:update";
+ private static final String SUBMIT_SECURITY_CANCEL =
"common-edit-security-form:cancel";
+
+ private static final String LINK_PREF_WELCOMEPORT =
"instances-form:security-JSPPortletInstance";
+
+ private static final String TABLE_PREF_KEY =
"//form[@id='common-edit-pref-form']/table";
+
+ private static final String SUBMIT_PREF_DELETE =
"common-edit-exisiting-form:row_0";
+ private static final String LINK_PREF_GUESTNUM =
"common-edit-pref-form:pref-link-0";
+ private static final String INPUT_PREF_NEWVAL =
"common-append-form:new_value";
+ private static final String SUBMIT_PREF_UPDATE =
"common-append-form:append-button";
+ private static final String SUBMIT_PREF_SAVE =
"_id919jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:save";
+ private static final String INPUT_PREF_UPDATE =
"common-edit-exisiting-form:update";
+ private static final String INPUT_PREF_APPEND =
"common-edit-exisiting-form:pref-input-0";
+ private static final String SUBMIT_PREF_CANCEL =
"_id458jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:cancel";
+ private static final String LINK_CURUSER_PREFERENCES =
"instances-form:preference-CurrentUsersPortletInstance";
+ private static final String LINK_DEL_EXCEPTPORT =
"instances-form:delete-ExceptionPortletInstance";
+ private static final String SUBMIT_PI_DELETE_CONF =
"confirm-delete-form1:delete";
+ private static final String SUBMIT_PI_DELETE_CANC =
"confirm-delete-form1:cancel";
+ private static final String T_LINK_DELETENAME =
"displaynamecontainer:instance-display-form:locale-data-table:{0}:delete-link";
+ private static final String T_LINK_MODIFYNAME =
"displaynamecontainer:instance-display-form:locale-data-table:{0}:edit-link";
+ private static final String LINK_COUNTPORT =
"instances-form:CounterPortletInstance";
+ private static final String SUBMIT_MODIFY_NAME =
"displaynamecontainer:displayNameForm:addDisplay";
+ private static final String INPUT_NAME =
"displaynamecontainer:displayNameForm:newName";
+ private static final String SELECT_LANGUAGE =
"displaynamecontainer:displayNameForm:locales";
+ private static final String LINK_ADMIN = "link=Admin";
+ private static final String LINK_TAB_PI =
"admin-subtab-form:portlet-instance-link";
+ private static final String LINK_PI_MAIN = "instance-form1:instance-link";
+ private static final String TABLE_DISPNAMES =
"displaynamecontainer:instance-display-form:locale-data-table";
+
+ @BeforeMethod(groups = { "log" })
+ public void loginBeforeTest() {
+ login("admin", "admin");
+ goToPI();
+ }
+
+ @AfterMethod(groups = { "log" })
+ public void logoutAfterTest() {
+ logout();
+ }
+
+ @Test(enabled = true)
+ public void testAddName() {
+ clickAndWait(LINK_COUNTPORT);
+
+ safeSelect(SELECT_LANGUAGE, "Czech");
+ final String name = "Administracny";
+ selenium.type(INPUT_NAME, name);
+ clickAndWait(SUBMIT_MODIFY_NAME);
+ Assert.assertTrue(findTableRow(TABLE_DISPNAMES, name, 1) >= 0);
+ }
+
+ @Test(enabled = true)
+ public void testDeleteName() {
+ // adding the name
+ selenium.click(LINK_COUNTPORT);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.select(SELECT_LANGUAGE, "label=Japanese");
+ final String name = "Aduminu";
+ selenium.type(INPUT_NAME, name);
+ selenium.click(SUBMIT_MODIFY_NAME);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ // deleting name
+
+ int r = findTableRow(TABLE_DISPNAMES, name, 1);
+
+ selenium.click(MessageFormat.format(T_LINK_DELETENAME, r - 1));
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertFalse(findTableRow(TABLE_DISPNAMES, name, r) >= 0);
+ }
+
+ @Test(enabled = true)
+ public void testModifyName() {
+ // adding the name
+ selenium.click(LINK_COUNTPORT);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.select(SELECT_LANGUAGE, "label=Japanese");
+ final String name = "Adminisimo";
+ final String nameNew = "Adminiprisimo";
+
+ selenium.type(INPUT_NAME, name);
+ selenium.click(SUBMIT_MODIFY_NAME);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ // midifying name
+
+ int r = findTableRow(TABLE_DISPNAMES, name, 1);
+
+ selenium.click(MessageFormat.format(T_LINK_MODIFYNAME, r - 1));
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.type(INPUT_NAME, nameNew);
+ selenium.click(SUBMIT_MODIFY_NAME);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertTrue(findTableRow(TABLE_DISPNAMES, nameNew, 1) >= 0);
+ }
+
+ @Test(enabled = true)
+ public void testSecure() {
+ // "common-edit-security-form:cancel"
+ selenium.click(LINK_PREF_WELCOMEPORT);
+ selenium.waitForPageToLoad("30000");
+ selenium.click("//input[@name='common-edit-security-form:cars_2']");
+ selenium.click("//input[@name='common-edit-security-form:cars_1']");
+ selenium.click("//input[@name='common-edit-security-form:cars_0']");
+ selenium.click("//input[@name='common-edit-security-form:cars_0' and
@value='admin']");
+ selenium.click("//input[@name='common-edit-security-form:cars_1' and
@value='admin']");
+ selenium.click("//input[@name='common-edit-security-form:cars_2' and
@value='admin']");
+ selenium.click(SUBMIT_SECURITY_UPDATE);
+ selenium.waitForPageToLoad("30000");
+
+ selenium.open("/portal/auth/portal/default/");
+ selenium.waitForPageToLoad("30000");
+ Assert.assertTrue(selenium.isTextPresent("Greetings !"));
+
+ // then cancel
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad("30000");
+ selenium.click(LINK_PREF_WELCOMEPORT);
+ selenium.waitForPageToLoad("30000");
+ selenium.click("//input[@name='common-edit-security-form:cars_0']");
+ selenium.click("//input[@name='common-edit-security-form:cars_1' and
@value='admin']");
+ selenium.click("//input[@name='common-edit-security-form:cars_0' and
@value='admin']");
+ selenium.click("//input[@name='common-edit-security-form:cars_2' and
@value='admin']");
+ selenium.click("//input[@name='common-edit-security-form:cars_1']");
+ selenium.click(SUBMIT_SECURITY_CANCEL);
+ selenium.waitForPageToLoad("30000");
+ selenium.open("/portal/auth/portal/default/");
+ selenium.waitForPageToLoad("30000");
+ Assert.assertTrue(selenium.isTextPresent("Greetings !"));
+
+ // then really stop the greetings portlet
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad("30000");
+ selenium.click(LINK_PREF_WELCOMEPORT);
+ selenium.waitForPageToLoad("30000");
+ selenium.click("//input[@name='common-edit-security-form:cars_0']");
+ selenium.click("//input[@name='common-edit-security-form:cars_1' and
@value='admin']");
+ selenium.click("//input[@name='common-edit-security-form:cars_0' and
@value='admin']");
+ selenium.click("//input[@name='common-edit-security-form:cars_2' and
@value='admin']");
+ selenium.click("//input[@name='common-edit-security-form:cars_1']");
+ selenium.click(SUBMIT_SECURITY_UPDATE);
+ selenium.waitForPageToLoad("30000");
+
+ selenium.open("/portal/auth/portal/default/");
+ selenium.waitForPageToLoad("30000");
+ Assert.assertFalse(selenium.isTextPresent("Greetings !"));
+ }
+
+ @Test(enabled = true)
+ public void testDeleteInstance() {
+ // cancel first
+ Assert.assertTrue(selenium.isElementPresent(LINK_DEL_EXCEPTPORT), "Exception
portlet not found.");
+ selenium.click(LINK_DEL_EXCEPTPORT);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(selenium.isTextPresent("WARNING!"));
+ Assert.assertTrue(selenium.isTextPresent("Are you sure you want to delete this
portlet instance ?"));
+ selenium.click(SUBMIT_PI_DELETE_CANC);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ // delete
+ goToPI();
+ Assert.assertTrue(selenium.isElementPresent(LINK_DEL_EXCEPTPORT), "Exception
portlet not found.");
+ selenium.click(LINK_DEL_EXCEPTPORT);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(selenium.isTextPresent("WARNING!"));
+ Assert.assertTrue(selenium.isTextPresent("Are you sure you want to delete this
portlet instance ?"));
+ selenium.click(SUBMIT_PI_DELETE_CONF);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertFalse(selenium.isElementPresent(LINK_DEL_EXCEPTPORT), "Exception
portlet found after deletition.");
+ }
+
+ @Test(enabled = true)
+ public void testPreferences() {
+ int r;
+ selenium.click(LINK_CURUSER_PREFERENCES);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click(SUBMIT_PREF_CANCEL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click(LINK_CURUSER_PREFERENCES);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(findTableRow(TABLE_PREF_KEY, "guestNumber", 0) >= 0);
+ selenium.click(LINK_PREF_GUESTNUM);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ r = findTableRow(TABLE_PREF_KEY, "guestNumber", 0);
+ Assert.assertEquals(selenium.getText(TABLE_PREF_KEY + "/tbody/tr[" + r +
"]/td[4]"), "[true]");
+ selenium.type(INPUT_PREF_APPEND, "true1");
+ selenium.click(INPUT_PREF_UPDATE);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ r = findTableRow(TABLE_PREF_KEY, "guestNumber", 0);
+ Assert.assertEquals(selenium.getText(TABLE_PREF_KEY + "/tbody/tr[" + r +
"]/td[4]"), "[true1]");
+ selenium.click(SUBMIT_PREF_DELETE);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ r = findTableRow(TABLE_PREF_KEY, "guestNumber", 0);
+ Assert.assertEquals(selenium.getText(TABLE_PREF_KEY + "/tbody/tr[" + r +
"]/td[4]"), "[]");
+ selenium.type(INPUT_PREF_NEWVAL, "viliam");
+ selenium.click(SUBMIT_PREF_UPDATE);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ r = findTableRow(TABLE_PREF_KEY, "guestNumber", 0);
+ Assert.assertEquals(selenium.getText(TABLE_PREF_KEY + "/tbody/tr[" + r +
"]/td[4]"), "[viliam]");
+ selenium.click(SUBMIT_PREF_SAVE);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ }
+
+ private void goToPI() {
+ selenium.open(ADDR_PORTAL);
+ clickIfVisible(LINK_ADMIN);
+ clickIfVisible(LINK_ADMIN);
+ clickIfVisible(LINK_TAB_PI);
+ clickIfVisible(LINK_PI_MAIN);
+ }
+
+}
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/testng.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/testng.xml 2008-10-21 15:22:11 UTC
(rev 12116)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/testng.xml 2008-10-21 15:24:10 UTC
(rev 12117)
@@ -14,16 +14,7 @@
<classes>
<class
name="org.jboss.portal.test.selenium.IdentityAdminTestCase"></class></classes>
</test>
-
- <test name="org.jboss.portal.test.selenium.IdentityAdminTestCase -
SingleLogin"
- verbose="2" annotations="JDK">
- <groups>
- <run>
- <exclude name="log"></exclude></run></groups>
- <classes>
- <class
name="org.jboss.portal.test.selenium.IdentityAdminTestCase"></class></classes>
- </test>
-
+
<test name="org.jboss.portal.test.selenium.PortletUserCreationTestCase"
verbose="2" annotations="JDK">
<classes>