Author: vrockai
Date: 2009-06-01 06:32:11 -0400 (Mon, 01 Jun 2009)
New Revision: 13426
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/portal/EndtoEndPortalAdminTestCase.java
Log:
[selenium] - timeouts
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 2009-05-29
23:04:54 UTC (rev 13425)
+++
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java 2009-06-01
10:32:11 UTC (rev 13426)
@@ -55,7 +55,7 @@
* Generic timeout in miliseconds used in every selenium function
* waitForPageToLoad()}
*/
- public static String PAGE_LOAD = "180000";
+ public static String PAGE_LOAD = "240000";
/** Generic timeout in miliseconds used for AJAX timeouts } */
public static long AJAX_LOAD = 6000;
Modified:
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/EndtoEndPortalAdminTestCase.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/EndtoEndPortalAdminTestCase.java 2009-05-29
23:04:54 UTC (rev 13425)
+++
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/EndtoEndPortalAdminTestCase.java 2009-06-01
10:32:11 UTC (rev 13426)
@@ -295,7 +295,7 @@
}
- @Test(enabled = false, description = "Usecase for managing portals - error
handling.")
+ @Test(enabled = true, description = "Usecase for managing portals - error
handling.")
public void testPortalErrorHandlingUsecase() {
String LAB_RED = "Redirect to the specified resource";
@@ -318,9 +318,18 @@
selenium.waitForPageToLoad(PAGE_LOAD);
// assert RED handling
+ logout();
+ login("user","user");
+ openAndAssert("/portal/auth/portal/admin", "ACCESS_DENIED");
+ openAndAssert("/portal/auth/portal/admin", "View permission not granted
has denied access");
+ logout();
+ login("admin","admin");
+
openAndAssert("/portal/auth/portal/default/Test/Exception+test/ExceptionPortletWindow?op=error&action=1",
"ERROR");
openAndAssert("/portal/auth/portal/default/Test/Exception+test/ExceptionPortletWindow?op=error&action=1",
"Powered by JBoss Portal");
-
+ openAndAssert("/portal/portal/default/Test/Exception+test/ExceptionPortletWindow?op=ioexception&action=1",
"ERROR");
+ openAndAssert("/portal/portal/default/Test/Exception+test/ExceptionPortletWindow?op=ioexception&action=1",
"Cause: java.io.IOException");
+
// select ERR handling
goToProperties();
selectIfNotSelected(SEL_POL_PA, LAB_ERR);
@@ -333,7 +342,14 @@
selenium.waitForPageToLoad(PAGE_LOAD);
// assert ERR handling
+ logout();
+ login("user","user");
+ openAndAssert("http://localhost:8080/portal/auth/portal/admin", "HTTP
Status 403 - ");
+ logout();
+ login("admin","admin");
+
openAndAssert("/portal/auth/portal/default/Test/Exception+test/ExceptionPortletWindow?op=error&action=1",
"HTTP Status 500");
+ openAndAssert("/portal/portal/default/Test/Exception+test/ExceptionPortletWindow?op=ioexception&action=1",
"HTTP Status 500 -");
// ***
// *** Page level
@@ -351,8 +367,9 @@
selenium.waitForPageToLoad(PAGE_LOAD);
// assert RED handling
- openAndAssert("/portal/auth/portal/default/Test/Exception+test/ExceptionPortletWindow?op=error&action=1",
"ERROR");
- openAndAssert("/portal/auth/portal/default/Test/Exception+test/ExceptionPortletWindow?op=error&action=1",
"Powered by JBoss Portal");
+ openAndAssert("/portal/auth/portal/default/Test/Exception+test", "An
error occured");
+ openAndAssert("/portal/auth/portal/default/Test/Exception+test",
"NOT_FOUND ");
+ openAndAssert("/portal/auth/portal/default/Test/Exception+test", "Cause:
null");
// select ERR handling
goToProperties();
@@ -366,8 +383,7 @@
selenium.waitForPageToLoad(PAGE_LOAD);
// assert ERR handling
- openAndAssert("/portal/auth/portal/default/Test/Exception+test/ExceptionPortletWindow?op=error&action=1",
"ERROR");
- openAndAssert("/portal/auth/portal/default/Test/Exception+test/ExceptionPortletWindow?op=error&action=1",
"Powered by JBoss Portal");
+ openAndAssert("/portal/auth/portal/default/Test/Exception+test", "HTTP
Status 404");
// select REM handling
goToProperties();
@@ -381,14 +397,21 @@
selenium.waitForPageToLoad(PAGE_LOAD);
// assert REM handling
- openAndAssert("/portal/auth/portal/default/Test/Exception+test/ExceptionPortletWindow?op=error&action=1",
"ERROR");
- openAndAssert("/portal/auth/portal/default/Test/Exception+test/ExceptionPortletWindow?op=error&action=1",
"Powered by JBoss Portal");
+ openAndAssert("/portal/auth/portal/default/Test/Exception+test/ExceptionPortletWindow?op=error&action=1",
"ERROR",false);
+ openAndAssert("/portal/auth/portal/default/Test/Exception+test/ExceptionPortletWindow?op=error&action=1",
"Powered by JBoss Portal",false);
}
- private void openAndAssert(String add, String ass) {
+ private void openAndAssert(String add, String ass){
+ openAndAssert(add, ass, true);
+ }
+
+ private void openAndAssert(String add, String ass, boolean b) {
selenium.open(add);
selenium.waitForPageToLoad(PAGE_LOAD);
+ if (b)
Assert.assertTrue(selenium.isTextPresent(ass), "Text: {\"" + ass +
"\"} not found on the page");
+ else
+ Assert.assertFalse(selenium.isTextPresent(ass), "Text: {\"" + ass +
"\"} was found on the page");
}
private void goToProperties() {