Author: vrockai
Date: 2009-01-13 08:57:31 -0500 (Tue, 13 Jan 2009)
New Revision: 12486
Modified:
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSSecureTestCase.java
Log:
cms security tweak
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 2009-01-13
13:31:02 UTC (rev 12485)
+++
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSSecureTestCase.java 2009-01-13
13:57:31 UTC (rev 12486)
@@ -165,8 +165,10 @@
login("admin", "admin");
Assert.assertFalse(selenium.isTextPresent("Access to this resource is 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");
+ // 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(LNK_ADMIN);
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -193,7 +195,7 @@
}
- @Test(enabled = true, dependsOnMethods={"testSetRoleReadPer2"}, description =
"Set admin/secRole read permissions, login as user w secRole.")
+ @Test(enabled = true, dependsOnMethods = { "testSetRoleReadPer2" },
description = "Set admin/secRole read permissions, login as user w secRole.")
public void testSetRoleReadPer1() {
login("admin", "admin");
@@ -290,7 +292,7 @@
logout();
}
- @Test(enabled = true, dependsOnMethods={"testSetRoleReadPer1"},description =
"Subpage permission test")
+ @Test(enabled = true, dependsOnMethods = { "testSetRoleReadPer1" },
description = "Subpage permission test")
public void testSubpageSecurity() {
selenium.open("/portal/portal/default");
@@ -339,11 +341,12 @@
Assert.assertTrue(selenium.isTextPresent(roleDisplay), "Role display name: "
+ roleDisplay + " not found on the page.");
final String CHECK_ROLE = MessageFormat.format(IdentityAdminTestCase.ID_CHECK_ROLE,
role);
- selenium.click(CHECK_ROLE);
+ if (!selenium.isChecked(CHECK_ROLE)) {
+ selenium.click(CHECK_ROLE);
- selenium.click(IdentityAdminTestCase.ID_SUBMIT_ASSIGN_ROLE);
- selenium.waitForPageToLoad(PAGE_LOAD);
-
+ selenium.click(IdentityAdminTestCase.ID_SUBMIT_ASSIGN_ROLE);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ }
searchUser(user, email);
selenium.click(butUsrRol_id(user));
@@ -362,10 +365,12 @@
// check the tempRole check box
final String CHECK_ROLE = MessageFormat.format(IdentityAdminTestCase.ID_CHECK_ROLE,
role);
- selenium.click(CHECK_ROLE);
+ if (selenium.isChecked(CHECK_ROLE)) {
+ selenium.click(CHECK_ROLE);
- selenium.click(IdentityAdminTestCase.ID_SUBMIT_ASSIGN_ROLE);
- selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click(IdentityAdminTestCase.ID_SUBMIT_ASSIGN_ROLE);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ }
searchUser(user, email);
selenium.click(butUsrRol_id(user));