[portal-commits] JBoss Portal SVN: r12919 - branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal.

portal-commits at lists.jboss.org portal-commits at lists.jboss.org
Mon Mar 2 07:35:15 EST 2009


Author: vrockai
Date: 2009-03-02 07:35:15 -0500 (Mon, 02 Mar 2009)
New Revision: 12919

Modified:
   branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PageCoordinationTestCase.java
Log:
[JBPORTAL-2316] - added asserts

Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PageCoordinationTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PageCoordinationTestCase.java	2009-03-02 12:34:26 UTC (rev 12918)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PageCoordinationTestCase.java	2009-03-02 12:35:15 UTC (rev 12919)
@@ -103,7 +103,27 @@
 	public void logoutAfterTest() {
 	}
 	
+	
 	@Test(enabled = true)
+	public void testDefaultPageCoordination(){
+		openAndWait("/portal/auth/portal/default/Coordination+Samples");
+		Assert.assertTrue(selenium.isTextPresent("Weather for (my_zipcode):null"));
+		Assert.assertTrue(selenium.isTextPresent("Map for (your_zipcode):null"));
+		
+		openAndWait("/portal/auth/portal/default/Coordination+Samples?zipcode=10101");
+		Assert.assertTrue(selenium.isTextPresent("Weather for (my_zipcode):null"));
+		Assert.assertTrue(selenium.isTextPresent("Map for (your_zipcode):10101"));
+		
+		openAndWait("/portal/auth/portal/default/Coordination+Samples?zip=10102");
+		Assert.assertTrue(selenium.isTextPresent("Weather for (my_zipcode):10102"));
+		Assert.assertTrue(selenium.isTextPresent("Map for (your_zipcode):10102"));
+		
+		openAndWait("/portal/auth/portal/default/Coordination+Samples?zipcode=10103");
+		Assert.assertTrue(selenium.isTextPresent("Weather for (my_zipcode):10102"));
+		Assert.assertTrue(selenium.isTextPresent("Map for (your_zipcode):10103"));
+	}
+	
+	@Test(enabled = true)
 	public void testPageCoordination(){
 		String portalName = "default";
 		String pageName = "Coordination Samples";
@@ -136,6 +156,10 @@
 		selenium.click(SUB_CREATE_ALIAS);
 		selenium.waitForPageToLoad(PAGE_LOAD);
 		
+		openAndWait("/portal/auth/portal/default/Coordination+Samples?aliasBindTest=222333");
+		Assert.assertTrue(selenium.isTextPresent("Weather for (my_zipcode):null"));
+		Assert.assertTrue(selenium.isTextPresent("Map for (your_zipcode):222333"));
+		
 	}
 	
 	@Test(enabled = true)
@@ -157,7 +181,7 @@
 		r = findTableRow(TABLE_PORTALPAGE_ADMIN, pageName, 0) - 1;
 
 		clickAndWait(MessageFormat.format(PAG_TL_COORDINATION, r));
-		
+		// selenium.setSpeed("5000");
 		// create delete alias
 		selenium.addSelection(LIS_RENDER_PAR, "label={urn:jboss:portal:samples:coor}zipcode");
 		selenium.waitForPageToLoad(PAGE_LOAD);
@@ -167,19 +191,27 @@
 		selenium.waitForPageToLoad(PAGE_LOAD);
 				
 		// delete alias
-		r = findTableRow(TBL_ALIASES, "aliasBindDelete", 0) ;
+		r = findTableRow(TBL_ALIASES, "aliasBindDelete", 0);
 		
 		selenium.click(MessageFormat.format(LNK_T_ALIAS_DELETE,r));
 		selenium.waitForPageToLoad(PAGE_LOAD);
 		selenium.click(SUB_ALIAS_DEL_CANCEL);
 		selenium.waitForPageToLoad(PAGE_LOAD);
 		
-		r = findTableRow(TBL_ALIASES, "aliasBindDelete", 0) ;
+		r = findTableRow(TBL_ALIASES, "aliasBindDelete", 0);
 		
 		selenium.click(MessageFormat.format(LNK_T_ALIAS_DELETE,r));
 		selenium.waitForPageToLoad(PAGE_LOAD);
 		selenium.click(SUB_ALIAS_DEL_SUBMIT);
 		selenium.waitForPageToLoad(PAGE_LOAD);
+		
+		openAndWait("/portal/auth/portal/default/Coordination+Samples?zip=222333");
+		Assert.assertTrue(selenium.isTextPresent("Weather for (my_zipcode):222333"));
+		Assert.assertTrue(selenium.isTextPresent("Map for (your_zipcode):222333"));
+		
+		openAndWait("/portal/auth/portal/default/Coordination+Samples?aliasBindDelete=222334");
+		Assert.assertTrue(selenium.isTextPresent("Weather for (my_zipcode):222333"));
+		Assert.assertTrue(selenium.isTextPresent("Map for (your_zipcode):222333"));
 	}
 	
 	@Test(enabled = true)
@@ -211,7 +243,7 @@
 		selenium.waitForPageToLoad(PAGE_LOAD);
 		
 		// rename alias
-		r = findTableRow(TBL_ALIASES, "aliasBingRename", 0) ;
+		r = findTableRow(TBL_ALIASES, "aliasBingRename", 0);
 		
 		selenium.click(MessageFormat.format(LNK_T_ALIAS_RENAME,r));
 
@@ -219,13 +251,21 @@
 		selenium.click(SUB_ALIAS_REN_CANCEL);
 		selenium.waitForPageToLoad(PAGE_LOAD);
 		
-		r = findTableRow(TBL_ALIASES, "aliasBingRename", 0) ;
+		r = findTableRow(TBL_ALIASES, "aliasBingRename", 0);
 		
 		selenium.click(MessageFormat.format(LNK_T_ALIAS_RENAME,r));
 		selenium.waitForPageToLoad(PAGE_LOAD);
 		selenium.type(INP_ALIAS_REN, "aliasBindWasRenamed");
 		selenium.click(SUB_ALIAS_RENAME_SUBMIT);
 		selenium.waitForPageToLoad(PAGE_LOAD);
+		
+		openAndWait("/portal/auth/portal/default/Coordination+Samples?zip=222333");
+		Assert.assertTrue(selenium.isTextPresent("Weather for (my_zipcode):222333"));
+		Assert.assertTrue(selenium.isTextPresent("Map for (your_zipcode):222333"));
+		
+		openAndWait("/portal/auth/portal/default/Coordination+Samples?aliasBindWasRenamed=222334");
+		Assert.assertTrue(selenium.isTextPresent("Weather for (my_zipcode):222334"));
+		Assert.assertTrue(selenium.isTextPresent("Map for (your_zipcode):222333"));
 	}
 	
 	@Test(enabled = true)
@@ -251,6 +291,26 @@
 		// parameter binding
 		selenium.click(CHK_PARAM_BIND);
 		selenium.waitForPageToLoad(PAGE_LOAD);
+		
+		logout();
+		login("admin","admin");
+		
+		openAndWait("/portal");
+		clickAndWait("link=Admin");
+
+		clickIfVisible(TAB_PORTALOBJ_ID);
+		clickIfVisible(LINK_PORTALS_ID);
+		clickIfVisible(LINK_PORTAL_HOME);
+		Assert.assertTrue(selenium.isTextPresent("Create a portal named:"));
+		r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
+
+		clickAndWait(MessageFormat.format(POR_TL_MAIN, r));
+
+		r = findTableRow(TABLE_PORTALPAGE_ADMIN, pageName, 0) - 1;
+
+		clickAndWait(MessageFormat.format(PAG_TL_COORDINATION, r));
+		
+		Assert.assertTrue(selenium.isChecked(CHK_PARAM_BIND));
 	}
 
 	@Test(enabled = true)
@@ -276,5 +336,25 @@
 		// explicit wiring
 		selenium.click(CHK_EXPL_WIR);
 		selenium.waitForPageToLoad(PAGE_LOAD);
+		
+		logout();
+		login("admin","admin");
+		
+		openAndWait("/portal");
+		clickAndWait("link=Admin");
+
+		clickIfVisible(TAB_PORTALOBJ_ID);
+		clickIfVisible(LINK_PORTALS_ID);
+		clickIfVisible(LINK_PORTAL_HOME);
+		Assert.assertTrue(selenium.isTextPresent("Create a portal named:"));
+		r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
+
+		clickAndWait(MessageFormat.format(POR_TL_MAIN, r));
+
+		r = findTableRow(TABLE_PORTALPAGE_ADMIN, pageName, 0) - 1;
+
+		clickAndWait(MessageFormat.format(PAG_TL_COORDINATION, r));
+		
+		Assert.assertTrue(selenium.isChecked(CHK_EXPL_WIR));
 	}
 }




More information about the portal-commits mailing list