[portal-commits] JBoss Portal SVN: r11981 - in branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium: cms and 1 other directories.

portal-commits at lists.jboss.org portal-commits at lists.jboss.org
Thu Sep 25 09:05:42 EDT 2008


Author: vrockai
Date: 2008-09-25 09:05:42 -0400 (Thu, 25 Sep 2008)
New Revision: 11981

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/JBossPortalSeleniumTestCase.java
   branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/UserInterceptorPortletTestCase.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/CMSSecureTestCase.java
   branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/AdminPortalTestCase.java
Log:
update from 2.6

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-09-25 12:57:45 UTC (rev 11980)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardTestCase.java	2008-09-25 13:05:42 UTC (rev 11981)
@@ -6,10 +6,14 @@
 import org.testng.Assert;
 
 import com.sun.java_cup.internal.internal_error;
-
+/**
+ * @author <a href="mailto:vrockai at redhat.com">Viliam Rockai</a>
+ */
 @Test(groups = { "cms_dashboard" }, enabled = true, description = "Dashboard issues test case.")
 public class DashboardTestCase extends JBossPortalSeleniumTestCase {
 
+	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 =	"dashboard-form:pageName";
 	private static final String SUBMIT_CREATEPAGE = "dashboard-form:save-button";
@@ -20,7 +24,6 @@
 
 	@BeforeMethod(groups = { "log" })
 	public void loginBeforeTest() {
-		//selenium.setSpeed("3000");
 		login("admin", "admin");
 	}
 
@@ -31,14 +34,14 @@
 
 	@Test(enabled = true)
 	public void testCreatePage() {
-		selenium.click("link=Dashboard");
+		selenium.click(LINK_DASHBOARD);
 		selenium.waitForPageToLoad(PAGE_LOAD);
-		selenium.click("link=Configure dashboard");
+		selenium.click(LINK_CONFIGURE_DASHBOARD);
 		selenium.waitForPageToLoad(PAGE_LOAD);
 		selenium.type(INPUT_PAGENAME, "DashTestPage");
 		selenium.click(SUBMIT_CREATEPAGE);
 		selenium.waitForPageToLoad(PAGE_LOAD);
-		selenium.click("link=Dashboard");
+		selenium.click(LINK_DASHBOARD);
 		selenium.waitForPageToLoad(PAGE_LOAD);
 		Assert.assertTrue(selenium.isElementPresent("link=DashTestPage"));
 		selenium.click("link=DashTestPage");
@@ -48,24 +51,19 @@
 
 	@Test(enabled = true, dependsOnMethods = { "testCreatePage" })
 	public void testUpdateTheme() {
-		selenium.click("link=Dashboard");
+		selenium.click(LINK_DASHBOARD);
 		selenium.waitForPageToLoad(PAGE_LOAD);
-		selenium.click("link=Configure dashboard");
+		selenium.click(LINK_CONFIGURE_DASHBOARD);
 		selenium.waitForPageToLoad(PAGE_LOAD);
 		
-		
-		 System.out.println(selenium.getSelectedLabel(SELECT_PAGE));
-		if (!selenium.getSelectedLabel(SELECT_PAGE).equals("DashTestPage"))
-		selenium.select(SELECT_PAGE, "label=DashTestPage");
-		
-		//selenium.waitForPageToLoad(PAGE_LOAD);
+		selectIfNotSelected("DashTestPage");
 
 		selenium.select(SELECT_THEME, "label=renaissance");
 		selenium.click(SUBMIT_THEMESEL);
 		selenium.waitForPageToLoad(PAGE_LOAD);
-		selenium.click("link=Dashboard");
+		selenium.click(LINK_DASHBOARD);
 		selenium.waitForPageToLoad(PAGE_LOAD);
-		selenium.click("link=Configure dashboard");
+		selenium.click(LINK_CONFIGURE_DASHBOARD);
 		selenium.waitForPageToLoad(PAGE_LOAD);
 
 		if (!selenium.getSelectedLabel(SELECT_PAGE).equals("DashTestPage")) {
@@ -73,30 +71,31 @@
 			selenium.waitForPageToLoad(PAGE_LOAD);
 		}
 
-		//System.out.println(selenium.isElementPresent("_id15jbpnsabcsnpbj:themeSelector"));
-		//System.out.println(selenium.getSelectedLabel("_id15jbpnsabcsnpbj:themeSelector"));
 
-		Assert.assertEquals("renaissance", selenium.getSelectedLabel(SELECT_THEME));
+		Assert.assertEquals(selenium.getSelectedLabel(SELECT_THEME), "renaissance","Previously selected theme other then expected.");
 	}
 
+	private void selectIfNotSelected(String label) {
+		if (!selenium.getSelectedLabel(SELECT_PAGE).equals(label))
+		selenium.select(SELECT_PAGE, "label="+label);
+		selenium.waitForPageToLoad(PAGE_LOAD);
+	}
+
 	@Test(enabled = true, dependsOnMethods = { "testCreatePage" })
 	public void testUpdateLayout() {
-		selenium.click("link=Dashboard");
+		selenium.click(LINK_DASHBOARD);
 		selenium.waitForPageToLoad(PAGE_LOAD);
-		selenium.click("link=Configure dashboard");
+		selenium.click(LINK_CONFIGURE_DASHBOARD);
 		selenium.waitForPageToLoad(PAGE_LOAD);
-		if (!selenium.getSelectedLabel(SELECT_PAGE).equals("DashTestPage"))
-		selenium.select(SELECT_PAGE, "label=DashTestPage");
-		//selenium.waitForPageToLoad(PAGE_LOAD);
+		selectIfNotSelected("DashTestPage");
+		Assert.assertEquals(selenium.getSelectedLabel(SELECT_LAYOUT),"default","Default layout is not called \"default\".");
 
-		Assert.assertEquals("default", selenium.getSelectedLabel(SELECT_LAYOUT));
-
 		selenium.select(SELECT_LAYOUT, "label=generic");
 		selenium.click(SUBMIT_LAYOUTSEL);
 		selenium.waitForPageToLoad(PAGE_LOAD);
-		selenium.click("link=Dashboard");
+		selenium.click(LINK_DASHBOARD);
 		selenium.waitForPageToLoad(PAGE_LOAD);
-		selenium.click("link=Configure dashboard");
+		selenium.click(LINK_CONFIGURE_DASHBOARD);
 		selenium.waitForPageToLoad(PAGE_LOAD);
 
 		if (!selenium.getSelectedLabel(SELECT_PAGE).equals("DashTestPage")) {
@@ -104,24 +103,22 @@
 			selenium.waitForPageToLoad(PAGE_LOAD);
 		}
 
-		Assert.assertEquals("generic", selenium.getSelectedLabel(SELECT_LAYOUT));
+		Assert.assertEquals(selenium.getSelectedLabel(SELECT_LAYOUT),"generic","Previously selected layout other then expected.");
 	}
 
 	@Test(enabled = true, dependsOnMethods = { "testCreatePage" })
 	public void testAddPortlet() {
 
-		selenium.click("link=Dashboard");
+		selenium.click(LINK_DASHBOARD);
 		selenium.waitForPageToLoad(PAGE_LOAD);
-		selenium.click("link=Configure dashboard");
+		selenium.click(LINK_CONFIGURE_DASHBOARD);
 		selenium.waitForPageToLoad(PAGE_LOAD);
-		if (!selenium.getSelectedLabel(SELECT_PAGE).equals("DashTestPage"))
-			selenium.select(SELECT_PAGE, "label=DashTestPage");
-		//selenium.waitForPageToLoad(PAGE_LOAD);
+		selectIfNotSelected("DashTestPage");
 		selenium.click("link=Who's online portlet");
 		selenium.waitForPageToLoad(PAGE_LOAD);
 		selenium.click("layoutForm:a_center");
 		selenium.waitForPageToLoad(PAGE_LOAD);
-		selenium.click("link=Dashboard");
+		selenium.click(LINK_DASHBOARD);
 		selenium.waitForPageToLoad(PAGE_LOAD);
 		selenium.click("link=DashTestPage");
 		selenium.waitForPageToLoad(PAGE_LOAD);
@@ -130,30 +127,25 @@
 		Assert.assertTrue(selenium.isTextPresent("[admin]"));
 	}
 
-	@Test(enabled = true, dependsOnMethods = { "testCreatePage" })
+	@Test(enabled = false, dependsOnMethods = { "testCreatePage" })
 	public void testAddGooglePortlet() {
-		selenium.click("link=Dashboard");
+		selenium.click(LINK_DASHBOARD);
 		selenium.waitForPageToLoad(PAGE_LOAD);
-		selenium.click("link=Configure dashboard");
+		selenium.click(LINK_CONFIGURE_DASHBOARD);
 		selenium.waitForPageToLoad(PAGE_LOAD);
-		if (!selenium.getSelectedLabel(SELECT_PAGE).equals("DashTestPage"))
-		selenium.select(SELECT_PAGE, "label=DashTestPage");
-		//selenium.waitForPageToLoad(PAGE_LOAD);
+		selectIfNotSelected("DashTestPage");
 		selenium.select("abc:instanceId", "label=widget/google");
 		selenium.waitForPageToLoad(PAGE_LOAD);
 		selenium.click("link=Hindu God of the Week");
 		selenium.waitForPageToLoad(PAGE_LOAD);
 		selenium.click("layoutForm:a_center");
 		selenium.waitForPageToLoad(PAGE_LOAD);
-		selenium.click("link=Dashboard");
+		selenium.click(LINK_DASHBOARD);
 		selenium.waitForPageToLoad(PAGE_LOAD);
-		//selenium.setSpeed("10000");
 		selenium.click("link=DashTestPage");
 		selenium.waitForPageToLoad(PAGE_LOAD);
 		
 		Assert.assertTrue(selenium.isTextPresent("Hindu God of the Week"));
-		//Assert.assertTrue(selenium.isTextPresent("powered by Google"));
-		//selenium.setSpeed("0");
 	}
 
 	@Test(enabled = false, dependsOnMethods = { "testCreatePage" })

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-09-25 12:57:45 UTC (rev 11980)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java	2008-09-25 13:05:42 UTC (rev 11981)
@@ -6,10 +6,19 @@
 
 import com.thoughtworks.selenium.DefaultSelenium;
 import com.thoughtworks.selenium.Selenium;
-
+/**
+ * @author <a href="mailto:vrockai at redhat.com">Viliam Rockai</a>
+ */
 public class JBossPortalSeleniumTestCase {
+	private static final String LINK_LOGOUT = "link=Logout";
+	private static final String SUBMIT_LOGIN = "login";
+	private static final String ADDR_PORTAL = "/portal/";
+	private static final String FRAME_LOGIN_CONTENT = "login-content";
+	private static final String LINK_LOGIN = "link=Login";
+	private static final String INPUT_PASSWORD = "j_password";
+	private static final String INPUT_USERNAME = "j_username";
 	protected Selenium selenium;
-	protected static final String PAGE_LOAD = "50000";
+	protected static final String PAGE_LOAD = "250000";
 
 	@BeforeClass
 	public void setupChromeForLogin() throws Exception {
@@ -41,7 +50,6 @@
 			}
 		}
 		for (String link : selenium.getAllFields()) {
-			//System.out.println(link);
 			if (link.equals(id)) {
 				return true;
 			}
@@ -60,24 +68,32 @@
 
 	protected void login(String username, String password) {
 		selenium.setTimeout("0");
-		selenium.open("/portal/");
+		selenium.open(ADDR_PORTAL);
 		selenium.waitForPageToLoad(PAGE_LOAD);
-
-		selenium.click("link=Login");
-		selenium.selectFrame("login-content");
-		selenium.type("j_username", username);
-		selenium.type("j_password", password);
-		Assert.assertTrue(selenium.isElementPresent("login"));
-		selenium.click("login");
+		
+		selenium.click(LINK_LOGIN);
+		selenium.selectFrame(FRAME_LOGIN_CONTENT);
+		
+		try {
+			Thread.sleep(2000);
+		} catch (InterruptedException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		
+		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.");
 	}
 
 	protected void logout() {
-		selenium.open("/portal/");
+		selenium.open(ADDR_PORTAL);
 		selenium.waitForPageToLoad(PAGE_LOAD);
-		Assert.assertTrue(selenium.isElementPresent("link=Logout"));
-		selenium.click("link=Logout");
+		Assert.assertTrue(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/UserInterceptorPortletTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/UserInterceptorPortletTestCase.java	2008-09-25 12:57:45 UTC (rev 11980)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/UserInterceptorPortletTestCase.java	2008-09-25 13:05:42 UTC (rev 11981)
@@ -10,7 +10,9 @@
 import org.testng.annotations.Test;
 
 import com.sun.org.apache.xerces.internal.impl.dtd.models.DFAContentModel;
-
+/**
+ * @author <a href="mailto:vrockai at redhat.com">Viliam Rockai</a>
+ */
 @Test(groups = { "cms_user_interceptor" }, enabled = true, description = "Checking the log of logging of users.")
 public class UserInterceptorPortletTestCase extends JBossPortalSeleniumTestCase {
 

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-09-25 12:57:45 UTC (rev 11980)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/WSRPTestCase.java	2008-09-25 13:05:42 UTC (rev 11981)
@@ -8,7 +8,9 @@
 import org.testng.Assert;
 
 import com.sun.java_cup.internal.internal_error;
-
+/**
+ * @author <a href="mailto:vrockai at redhat.com">Viliam Rockai</a>
+ */
 @Test(groups = { "cms_wsrp" }, enabled = true, description = "WSRP test case.")
 public class WSRPTestCase extends JBossPortalSeleniumTestCase {
 
@@ -34,9 +36,9 @@
 	private static final String INPUT_CACHEEXP = "edit-cons-form:cache";
 	private static final String SUBMIT_ADDPROP_INIT = "producer-form:add-reg-prop";
 	private static final String SUBMIT_ADDPROP = "producer-form:add-reg-prop";
-	private static final String INPUT_PROPHINT = "producer-form:reg-properties:0:_id33jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj";
-	private static final String INPUT_PROPLABEL = "producer-form:reg-properties:0:_id30jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj";
-	private static final String INPUT_PROPNAME = "producer-form:reg-properties:0:_id24jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj";
+	private static final String INPUT_PROPHINT = "producer-form:reg-properties:0:hint";
+	private static final String INPUT_PROPLABEL = "producer-form:reg-properties:0:label";
+	private static final String INPUT_PROPNAME = "producer-form:reg-properties:0:name";
 	private static final String SUBMIT_CREATECONS = "createConsumer:createConsumerButton";
 	private static final String INPUT_CREATECONS = "createConsumer:consumerName";
 	private static final String ID_LINK_PRODCONF = "cons-temp-form:producer-link";

Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSSecureTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSSecureTestCase.java	2008-09-25 12:57:45 UTC (rev 11980)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSSecureTestCase.java	2008-09-25 13:05:42 UTC (rev 11981)
@@ -4,7 +4,6 @@
 
 import org.jboss.portal.test.selenium.IdentityAdminTestCase;
 import org.jboss.portal.test.selenium.JBossPortalSeleniumTestCase;
-import org.jboss.portal.test.selenium.portal.AdminPortalTestCase;
 import org.testng.Assert;
 import org.testng.annotations.AfterMethod;
 import org.testng.annotations.BeforeClass;
@@ -17,6 +16,21 @@
 @Test(groups = { "cms_secure" }, enabled = true, description = "Setting permissions on the default portlet.")
 public class CMSSecureTestCase extends JBossPortalSeleniumTestCase {
 
+	private static final String LINK_EXPLORE = "link=Explore";
+	private static final String LINK_SUPPORT_HTML = "link=support.html";
+	private static final String LINK_MEMBERS = "link=Members";
+	private static final String SUBMIT_SECURITY_SET = "submit";
+	private static final String SELECT_SECUREUSERS_MANAGE = "secureusers:manage";
+	private static final String SELECT_SECUREROLES_MANAGE = "secureroles:manage";
+	private static final String SELECT_SECUREUSERS_WRITE = "secureusers:write";
+	private static final String SELECT_SECUREROLES_WRITE = "secureroles:write";
+	private static final String SELECT_SECUREUSERS_READ = "secureusers:read";
+	private static final String SELECT_SECUREROLES_READ = "secureroles:read";
+	private static final String LINK_INDEX_HTML = "link=index.html";
+	private static final String LINK_DEFAULT = "link=default";
+	private static final String LINK_CMS = "link=CMS";
+	private static final String LINK_ADMIN = "link=Admin";
+	private static final String LINK_LOGOUT = "link=Logout";
 	private static final String SELECT_CMS_ACTION = "//div[@id='center']/div/div/div[1]/div/select";
 
 	@AfterMethod(groups = { "log" })
@@ -24,34 +38,33 @@
 
 		selenium.open("/portal/");
 		selenium.waitForPageToLoad(PAGE_LOAD);
-		if (selenium.isElementPresent("link=Logout")) {
-			selenium.click("link=Logout");
+		if (selenium.isElementPresent(LINK_LOGOUT)) {
+			selenium.click(LINK_LOGOUT);
 			selenium.waitForPageToLoad(PAGE_LOAD);
 		}
 
 		resetSecurity();
 	}
 
-	// @AfterMethod()
 	private void resetSecurity() {
 		login("admin", "admin");
-		selenium.click("link=Admin");
+		selenium.click(LINK_ADMIN);
 		selenium.waitForPageToLoad(PAGE_LOAD);
-		selenium.click("link=CMS");
+		selenium.click(LINK_CMS);
 		selenium.waitForPageToLoad(PAGE_LOAD);
-		selenium.click("link=default");
+		selenium.click(LINK_DEFAULT);
 		selenium.waitForPageToLoad(PAGE_LOAD);
-		selenium.click("link=index.html");
+		selenium.click(LINK_INDEX_HTML);
 		selenium.waitForPageToLoad(PAGE_LOAD);
 		selenium.select(SELECT_CMS_ACTION, "label=Secure");
 		selenium.waitForPageToLoad(PAGE_LOAD);
-		selenium.select("secureroles:read", "label=Anonymous");
-		selenium.select("secureusers:read", "label=admin");
-		selenium.select("secureroles:write", "label=Administrators");
-		selenium.select("secureusers:write", "label=admin");
-		selenium.select("secureroles:manage", "label=Administrators");
-		selenium.select("secureusers:manage", "label=admin");
-		selenium.click("submit");
+		selenium.select(SELECT_SECUREROLES_READ, "label=Anonymous");
+		selenium.select(SELECT_SECUREUSERS_READ, "label=admin");
+		selenium.select(SELECT_SECUREROLES_WRITE, "label=Administrators");
+		selenium.select(SELECT_SECUREUSERS_WRITE, "label=admin");
+		selenium.select(SELECT_SECUREROLES_MANAGE, "label=Administrators");
+		selenium.select(SELECT_SECUREUSERS_MANAGE, "label=admin");
+		selenium.click(SUBMIT_SECURITY_SET);
 		selenium.waitForPageToLoad(PAGE_LOAD);
 		logout();
 	}
@@ -63,9 +76,9 @@
 
 		login("admin", "admin");
 
-		selenium.click("link=Admin");
+		selenium.click(LINK_ADMIN);
 		selenium.waitForPageToLoad(PAGE_LOAD);
-		selenium.click("link=Members");
+		selenium.click(LINK_MEMBERS);
 		selenium.waitForPageToLoad(PAGE_LOAD);
 
 		clickIfVisible(IdentityAdminTestCase.ID_LINK_ROLETAB);
@@ -85,77 +98,67 @@
 	public void testSetAdminReadPer() {
 		login("admin", "admin");
 
-		Assert.assertFalse(selenium.isTextPresent("Access Denied"));
-		Assert.assertFalse(selenium.isTextPresent("You are not allowed to access the following resource - /default/index.html"));
+		Assert.assertFalse(selenium.isTextPresent("Access Denied"),"Non secured resource is not visible.#1");
+		Assert.assertFalse(selenium.isTextPresent("You are not allowed to access the following resource - /default/index.html"),"Non secured resource is not visible.#2");
 
-		selenium.click("link=Admin");
+		selenium.click(LINK_ADMIN);
 		selenium.waitForPageToLoad(PAGE_LOAD);
-		selenium.click("link=CMS");
+		selenium.click(LINK_CMS);
 		selenium.waitForPageToLoad(PAGE_LOAD);
-		selenium.click("link=default");
+		selenium.click(LINK_DEFAULT);
 		selenium.waitForPageToLoad(PAGE_LOAD);
-		selenium.click("link=index.html");
+		selenium.click(LINK_INDEX_HTML);
 		selenium.waitForPageToLoad(PAGE_LOAD);
 
 		selenium.select(SELECT_CMS_ACTION, "label=Secure");
 		selenium.waitForPageToLoad(PAGE_LOAD);
 
-		selenium.select("secureroles:read", "label=Administrators");
-		selenium.select("secureusers:read", "label=admin");
+		selenium.select(SELECT_SECUREROLES_READ, "label=Administrators");
+		selenium.select(SELECT_SECUREUSERS_READ, "label=admin");
 
-		selenium.click("submit");
+		selenium.click(SUBMIT_SECURITY_SET);
 		selenium.waitForPageToLoad(PAGE_LOAD);
 
 		logout();
 
-		Assert.assertTrue(selenium.isTextPresent("Access Denied"));
-		//Assert.assertTrue(selenium.isTextPresent("You are not allowed to access the following resource - /default/index.html"));
-
+		Assert.assertTrue(selenium.isTextPresent("Access Denied"),"Secured resource is visible.#1");
 		login("user", "user");
 
-		Assert.assertTrue(selenium.isTextPresent("Access Denied"));
-		//Assert.assertTrue(selenium.isTextPresent("You are not allowed to access the following resource - /default/index.html"));
-
+		Assert.assertTrue(selenium.isTextPresent("Access Denied"),"Secured resource is visible.#2");
 		logout();
 
-		resetSecurity();
 	}
 
 	@Test(enabled = true, description = "Set user read permissions, login as user.")
 	public void testSetUserReadPer() {
 		login("admin", "admin");
 
-		Assert.assertFalse(selenium.isTextPresent("Access Denied"));
-		Assert.assertFalse(selenium.isTextPresent("You are not allowed to access the following resource - /default/index.html"));
+		Assert.assertFalse(selenium.isTextPresent("Access Denied"),"Non secured resource is not visible.#1");
+		Assert.assertFalse(selenium.isTextPresent("You are not allowed to access the following resource - /default/index.html"),"Non secured resource is not visible.#2");
 
-		selenium.click("link=Admin");
+		selenium.click(LINK_ADMIN);
 		selenium.waitForPageToLoad(PAGE_LOAD);
-		selenium.click("link=CMS");
+		selenium.click(LINK_CMS);
 		selenium.waitForPageToLoad(PAGE_LOAD);
-		selenium.click("link=default");
+		selenium.click(LINK_DEFAULT);
 		selenium.waitForPageToLoad(PAGE_LOAD);
-		selenium.click("link=index.html");
+		selenium.click(LINK_INDEX_HTML);
 		selenium.waitForPageToLoad(PAGE_LOAD);
 		selenium.select(SELECT_CMS_ACTION, "label=Secure");
 		selenium.waitForPageToLoad(PAGE_LOAD);
-		selenium.select("secureroles:read", "label=Administrators");
-		selenium.select("secureusers:read", "label=user");
-		selenium.click("submit");
+		selenium.select(SELECT_SECUREROLES_READ, "label=Administrators");
+		selenium.select(SELECT_SECUREUSERS_READ, "label=user");
+		selenium.click(SUBMIT_SECURITY_SET);
 		selenium.waitForPageToLoad(PAGE_LOAD);
 
 		logout();
 
-		Assert.assertTrue(selenium.isTextPresent("Access Denied"));
-		//Assert.assertTrue(selenium.isTextPresent("You are not allowed to access the following resource - /default/index.html"));
-
+		Assert.assertTrue(selenium.isTextPresent("Access Denied"),"Secured resource is visible.#1");
 		login("user", "user");
 
-		Assert.assertFalse(selenium.isTextPresent("Access Denied"));
-		//Assert.assertFalse(selenium.isTextPresent("You are not allowed to access the following resource - /default/index.html"));
-
+		Assert.assertFalse(selenium.isTextPresent("Access Denied"),"Secured resource is visible.#2");
 		logout();
 
-		resetSecurity();
 	}
 
 	@Test(enabled = true, description = "Set admin/secRole read permissions, login as user w secRole.")
@@ -164,40 +167,35 @@
 
 		assignRole("user", "user at portal.com", "secRole", "secRoleDisp");
 
-		Assert.assertFalse(selenium.isTextPresent("Access Denied"));
-		Assert.assertFalse(selenium.isTextPresent("You are not allowed to access the following resource - /default/index.html"));
+		Assert.assertFalse(selenium.isTextPresent("Access Denied"),"Non secured resource is not visible.#1");
+		Assert.assertFalse(selenium.isTextPresent("You are not allowed to access the following resource - /default/index.html"),"Non secured resource is not visible.#2");
 
-		selenium.click("link=Admin");
+		selenium.click(LINK_ADMIN);
 		selenium.waitForPageToLoad(PAGE_LOAD);
-		selenium.click("link=CMS");
+		selenium.click(LINK_CMS);
 		selenium.waitForPageToLoad(PAGE_LOAD);
-		selenium.click("link=default");
+		selenium.click(LINK_DEFAULT);
 		selenium.waitForPageToLoad(PAGE_LOAD);
-		selenium.click("link=index.html");
+		selenium.click(LINK_INDEX_HTML);
 		selenium.waitForPageToLoad(PAGE_LOAD);
 		selenium.select(SELECT_CMS_ACTION, "label=Secure");
 		selenium.waitForPageToLoad(PAGE_LOAD);
-		selenium.select("secureroles:read", "label=secRoleDisp");
-		selenium.select("secureusers:read", "label=admin");
-		selenium.click("submit");
+		selenium.select(SELECT_SECUREROLES_READ, "label=secRoleDisp");
+		selenium.select(SELECT_SECUREUSERS_READ, "label=admin");
+		selenium.click(SUBMIT_SECURITY_SET);
 		selenium.waitForPageToLoad(PAGE_LOAD);
 
 		logout();
 
-		Assert.assertTrue(selenium.isTextPresent("Access Denied"));
-		//Assert.assertTrue(selenium.isTextPresent("You are not allowed to access the following resource - /default/index.html"));
-
+		Assert.assertTrue(selenium.isTextPresent("Access Denied"),"Secured resource is visible after logout.");
 		login("user", "user");
 
-		Assert.assertFalse(selenium.isTextPresent("Access Denied"));
-		//Assert.assertFalse(selenium.isTextPresent("You are not allowed to access the following resource - /default/index.html"));
-
+		Assert.assertFalse(selenium.isTextPresent("Access Denied"),"Non secured resource is not visible for the \"user\".");
 		logout();
 
-		resetSecurity();
 	}
 
-	@Test(enabled = true, description = "Set admin/secRole read permissions, login as user w/o secRole.")
+	@Test(enabled = true,description = "Set admin/secRole read permissions, login as user w/o secRole.")
 	public void testSetRoleReadPer2() {
 		login("admin", "admin");
 
@@ -206,34 +204,30 @@
 		Assert.assertFalse(selenium.isTextPresent("Access Denied"));
 		Assert.assertFalse(selenium.isTextPresent("You are not allowed to access the following resource - /default/index.html"));
 
-		selenium.click("link=Admin");
+		selenium.click(LINK_ADMIN);
 		selenium.waitForPageToLoad(PAGE_LOAD);
-		selenium.click("link=CMS");
+		selenium.click(LINK_CMS);
 		selenium.waitForPageToLoad(PAGE_LOAD);
-		selenium.click("link=default");
+		selenium.click(LINK_DEFAULT);
 		selenium.waitForPageToLoad(PAGE_LOAD);
-		selenium.click("link=index.html");
+		selenium.click(LINK_INDEX_HTML);
 		selenium.waitForPageToLoad(PAGE_LOAD);
 		selenium.select(SELECT_CMS_ACTION, "label=Secure");
 		selenium.waitForPageToLoad(PAGE_LOAD);
-		selenium.select("secureroles:read", "label=secRoleDisp");
-		selenium.select("secureusers:read", "label=admin");
-		selenium.click("submit");
+		selenium.select(SELECT_SECUREROLES_READ, "label=secRoleDisp");
+		selenium.select(SELECT_SECUREUSERS_READ, "label=admin");
+		selenium.click(SUBMIT_SECURITY_SET);
 		selenium.waitForPageToLoad(PAGE_LOAD);
 
 		logout();
 
 		Assert.assertTrue(selenium.isTextPresent("Access Denied"));
-		//Assert.assertTrue(selenium.isTextPresent("You are not allowed to access the following resource - /default/index.html"));
-
+		
 		login("user", "user");
 
 		Assert.assertTrue(selenium.isTextPresent("Access Denied"));
-		//Assert.assertTrue(selenium.isTextPresent("You are not allowed to access the following resource - /default/index.html"));
-
 		logout();
 
-		resetSecurity();
 	}
 
 	@Test(enabled = false, description = "Recursive permission test")
@@ -245,23 +239,22 @@
 		Assert.assertFalse(selenium.isTextPresent("Access Denied"));
 		Assert.assertFalse(selenium.isTextPresent("You are not allowed to access the following resource - /default/index.html"));
 
-		selenium.click("link=Admin");
+		selenium.click(LINK_ADMIN);
 		selenium.waitForPageToLoad(PAGE_LOAD);
-		selenium.click("link=CMS");
+		selenium.click(LINK_CMS);
 		selenium.waitForPageToLoad(PAGE_LOAD);
-		selenium.click("link=default");
+		selenium.click(LINK_DEFAULT);
 		selenium.waitForPageToLoad(PAGE_LOAD);
-		selenium.click("link=index.html");
+		selenium.click(LINK_INDEX_HTML);
 		selenium.waitForPageToLoad(PAGE_LOAD);
 		selenium.select(SELECT_CMS_ACTION, "label=Secure");
 		selenium.waitForPageToLoad(PAGE_LOAD);
-		selenium.select("secureroles:read", "label=secRoleDisp");
-		selenium.select("secureusers:read", "label=admin");
-		selenium.click("submit");
+		selenium.select(SELECT_SECUREROLES_READ, "label=secRoleDisp");
+		selenium.select(SELECT_SECUREUSERS_READ, "label=admin");
+		selenium.click(SUBMIT_SECURITY_SET);
 		selenium.waitForPageToLoad(PAGE_LOAD);
 
 		logout();
-		resetSecurity();
 	}
 
 	@Test(enabled = true, description = "Subpage permission test")
@@ -271,43 +264,44 @@
 		selenium.waitForPageToLoad(PAGE_LOAD);
 		Assert.assertTrue(selenium
 				.isTextPresent("Thank you for downloading and deploying JBoss Portal. We hope your enjoy working with it as much as we enjoy developing it!"));
-		selenium.click("link=Explore");
+		selenium.click(LINK_EXPLORE);
 		selenium.waitForPageToLoad(PAGE_LOAD);
 		Assert.assertFalse(selenium
 				.isTextPresent("Thank you for downloading and deploying JBoss Portal. We hope your enjoy working with it as much as we enjoy developing it!"));
 
 		login("admin", "admin");
-		selenium.click("link=Admin");
+		selenium.click(LINK_ADMIN);
 		selenium.waitForPageToLoad(PAGE_LOAD);
-		selenium.click("link=CMS");
+		selenium.click(LINK_CMS);
 		selenium.waitForPageToLoad(PAGE_LOAD);
-		selenium.click("link=default");
+		selenium.click(LINK_DEFAULT);
 		selenium.waitForPageToLoad(PAGE_LOAD);
-		selenium.click("link=support.html");
+		selenium.click(LINK_SUPPORT_HTML);
 		selenium.waitForPageToLoad(PAGE_LOAD);
 		selenium.select(SELECT_CMS_ACTION, "label=Secure");
 		selenium.waitForPageToLoad(PAGE_LOAD);
-		selenium.select("secureroles:read", "label=Administrators");
-		selenium.select("secureusers:read", "label=admin");
-		selenium.select("secureroles:write", "label=Administrators");
-		selenium.select("secureusers:write", "label=admin");
-		selenium.select("secureroles:manage", "label=Administrators");
-		selenium.select("secureusers:manage", "label=admin");
-		selenium.click("submit");
+		selenium.select(SELECT_SECUREROLES_READ, "label=Administrators");
+		selenium.select(SELECT_SECUREUSERS_READ, "label=admin");
+		selenium.select(SELECT_SECUREROLES_WRITE, "label=Administrators");
+		selenium.select(SELECT_SECUREUSERS_WRITE, "label=admin");
+		selenium.select(SELECT_SECUREROLES_MANAGE, "label=Administrators");
+		selenium.select(SELECT_SECUREUSERS_MANAGE, "label=admin");
+		selenium.click(SUBMIT_SECURITY_SET);
 		selenium.waitForPageToLoad(PAGE_LOAD);
 
 		logout();
 		Assert.assertTrue(selenium
 				.isTextPresent("Thank you for downloading and deploying JBoss Portal. We hope your enjoy working with it as much as we enjoy developing it!"));
 		selenium.open("/portal/portal/default");
-		selenium.click("link=Explore");
 		selenium.waitForPageToLoad(PAGE_LOAD);
+		selenium.click(LINK_EXPLORE);
+		selenium.waitForPageToLoad(PAGE_LOAD);
 		Assert.assertTrue(selenium
 				.isTextPresent("Thank you for downloading and deploying JBoss Portal. We hope your enjoy working with it as much as we enjoy developing it!"));
 
-		resetSecurity();
 	}
 
+	//TODO these functions should be used from indetity admin
 	void assignRole(String user, String email, String role, String roleDisplay) {
 
 		searchUser(user, email);
@@ -356,9 +350,9 @@
 	void searchUser(String username, String email) {
 		selenium.open("/portal/");
 		selenium.waitForPageToLoad(PAGE_LOAD);
-		selenium.click("link=Admin");
+		selenium.click(LINK_ADMIN);
 		selenium.waitForPageToLoad(PAGE_LOAD);
-		selenium.click("link=Members");
+		selenium.click(LINK_MEMBERS);
 		selenium.waitForPageToLoad(PAGE_LOAD);
 
 		clickIfVisible(IdentityAdminTestCase.ID_LINK_USERTAB);

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-09-25 12:57:45 UTC (rev 11980)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/AdminPortalTestCase.java	2008-09-25 13:05:42 UTC (rev 11981)
@@ -8,40 +8,44 @@
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
+/**
+ * @author <a href="mailto:vrockai at redhat.com">Viliam Rockai</a>
+ */
 @Test(groups = { "admin_portal" }, enabled = true, description = "Partal administrating.")
 public class AdminPortalTestCase extends JBossPortalSeleniumTestCase {
 
-	private static final String INPUT_SUBMIT_PAGECREATE = "_id65jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:_id67jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj";
-	private static final String INPUT_PAGENAME = "_id65jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:pageName";
-	private static final String INPUT_PORTALNAME = "_id33jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:name";
-	private static final String INPUT_SUBMIT_CREATEPORTAL = "_id33jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:_id35jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj";
+	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 = "_id29jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj: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 final String TAB_PORTALOBJ_ID = "//div[@id='current']/a";
-	// private final String LINK_PORTALS_ID =
-	// "_id12jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:_id15jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj"
-	// ;
+
 	private final String LINK_PORTALS_ID = "link=*Portal Objects*";
-	private final String LINK_PORTAL_HOME = "_id12jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:_id15jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj";
+	private final String LINK_PORTAL_HOME = "_id8jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:_id11jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj";
 
-	private final String TABLE_PORTAL_ADMIN = "//form[@id='_id39jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj']/table";
-	private final String POR_TL_MAIN = "_id39jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:_id40jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:{0}:_id43jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj";
-	private final String POR_TL_SECURITY = "_id39jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:_id40jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:{0}:_id48jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj";
-	private final String POR_TL_PROPERTIES = "_id39jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:_id40jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:{0}:_id52jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj";
-	private final String POR_TL_THEME = "_id39jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:_id40jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:{0}:_id56jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj";
-	private final String POR_TL_RENAME = "_id39jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:_id40jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:{0}:_id61jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj";
-	private final String POR_TL_DELETE = "_id39jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:_id40jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:{0}:_id66jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj";
-	private final String POR_TL_MAKEDEF = "_id39jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:_id40jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:{0}:_id71jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj";
+	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_PORTALPAGE_ADMIN = "//form[@id='_id71jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj']/table";
-	private final String PAG_TL_MAIN = "_id71jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:_id72jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:{0}:_id75jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj";
-	private final String PAG_TL_LAYOUT = "_id71jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:_id72jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:{0}:_id80jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj";
-	private final String PAG_TL_SECURITY = "_id71jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:_id72jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:{0}:_id84jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj";
-	private final String PAG_TL_PROPERTIES = "_id71jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:_id72jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:{0}:_id88jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj";
-	private final String PAG_TL_THEME = "_id71jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:_id72jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:{0}:_id92jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj";
-	private final String PAG_TL_RENAME = "_id71jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:_id72jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:{0}:_id96jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj";
-	private final String PAG_TL_DISPLAY = "_id71jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:_id72jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:{0}:_id100jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj";
-	private final String PAG_TL_DELETE = "_id71jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:_id72jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:{0}:_id105jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj";
-	private final String PAG_TL_MAKEDEF = "_id71jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:_id72jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:{0}:_id110jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj";
+	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";
 
 	@BeforeMethod(groups = { "log" })
 	public void loginBeforeTest() {
@@ -95,8 +99,8 @@
 		selenium.click(MessageFormat.format(POR_TL_RENAME, r));
 		selenium.waitForPageToLoad(PAGE_LOAD);
 
-		selenium.type("renameForm:newName", "AestPortal");
-		selenium.click("renameForm:_id34jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj");
+		selenium.type(INPUT_RENAME_PORTAL, "AestPortal");
+		selenium.click(SUBMIT_RENAME_PORTAL);
 		selenium.waitForPageToLoad(PAGE_LOAD);
 
 		Assert.assertFalse(selenium.isTextPresent("TestPortal"));
@@ -124,8 +128,7 @@
 		Assert.assertTrue(selenium.isTextPresent("WARNING! You are about to delete the TestDelete portal from the context!"));
 		Assert.assertTrue(selenium.isTextPresent("Delete portal"));
 		Assert.assertTrue(selenium.isTextPresent("Are you sure you want to delete this portal?"));
-		selenium
-				.click("_id33jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:_id40jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:_id41jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj");
+		selenium.click(SUBMIT_DELETE_PORTAL_CONF);
 		selenium.waitForPageToLoad(PAGE_LOAD);
 		Assert.assertTrue(selenium.isTextPresent("TestDelete has successfully been destroyed"));
 
@@ -147,8 +150,6 @@
 		final String portalName = "TestAddPortal";
 		final String portalPage = "tPage";
 
-		// selenium.setSpeed("5000");
-
 		selenium.type(INPUT_PORTALNAME, portalName);
 		selenium.click(INPUT_SUBMIT_CREATEPORTAL);
 		selenium.waitForPageToLoad(PAGE_LOAD);
@@ -157,8 +158,8 @@
 
 		selenium.click(MessageFormat.format(POR_TL_MAIN, r));
 		selenium.waitForPageToLoad(PAGE_LOAD);
-
-		Assert.assertFalse(selenium.isTextPresent(portalPage),"Portal page already present");
+		
+		Assert.assertFalse(selenium.isTextPresent(portalPage), "Portal page already present");
 		Assert.assertTrue(selenium.isTextPresent("Create a page named:"));
 
 		selenium.type(INPUT_PAGENAME, portalPage);
@@ -254,6 +255,7 @@
 
 	private void createPage(String portalName, String pageName) {
 		selenium.open("/portal/");
+		selenium.waitForPageToLoad(PAGE_LOAD);
 		selenium.click("link=Admin");
 		selenium.waitForPageToLoad(PAGE_LOAD);
 




More information about the portal-commits mailing list