Author: vrockai
Date: 2008-10-31 08:05:41 -0400 (Fri, 31 Oct 2008)
New Revision: 12220
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/testng.xml
Log:
file text case fix
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-10-31
01:31:01 UTC (rev 12219)
+++
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSSecureTestCase.java 2008-10-31
12:05:41 UTC (rev 12220)
@@ -16,8 +16,8 @@
@Test(groups = { "cms_secure" }, enabled = true, description = "Setting
permissions on the default portlet.")
public class CMSSecureTestCase extends JBossPortalSeleniumTestCase {
- private static final String LNK_EXPLORE = "link=Explore";
- private static final String LNK_SUPPORT_HTML = "link=support.html";
+ private static final String LNK_EXPLORE =
"//area[(a)href='/portal/content/default/epp.html']";
+ private static final String LNK_SUPPORT_HTML =
"//area[(a)href='/portal/content/default/project.html']";
private static final String LNK_MEMBERS = "link=Members";
private static final String SUB_SECURITY_SET =
"//input[contains(@name,'submit')]";
private static final String SEL_SECUREUSERS_MANAGE =
"//select[contains(@name,'secureusers:manage')]";
@@ -98,8 +98,9 @@
public void testSetAdminReadPer() {
login("admin", "admin");
- 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");
+ 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(LNK_ADMIN);
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -121,23 +122,24 @@
logout();
- Assert.assertTrue(selenium.isTextPresent("Access Denied"),"Secured
resource is visible.#1");
+ Assert.assertTrue(selenium.isTextPresent("Access Denied"), "Secured
resource is visible.#1");
login("user", "user");
- Assert.assertTrue(selenium.isTextPresent("Access Denied"),"Secured
resource is visible.#2");
+ Assert.assertTrue(selenium.isTextPresent("Access Denied"), "Secured
resource is visible.#2");
logout();
}
@Test(enabled = true, description = "Set user read permissions, login as
user.")
public void testSetUserReadPer() {
-
+
// cancelling at first stage
-
+
login("admin", "admin");
- 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");
+ 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(LNK_ADMIN);
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -155,13 +157,14 @@
selenium.waitForPageToLoad(PAGE_LOAD);
logout();
-
+
// really setting the permissions
-
+
login("admin", "admin");
- 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");
+ 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(LNK_ADMIN);
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -180,10 +183,10 @@
logout();
- Assert.assertTrue(selenium.isTextPresent("Access Denied"),"Secured
resource is visible.#1");
+ Assert.assertTrue(selenium.isTextPresent("Access Denied"), "Secured
resource is visible.#1");
login("user", "user");
- Assert.assertFalse(selenium.isTextPresent("Access Denied"),"Secured
resource is visible.#2");
+ Assert.assertFalse(selenium.isTextPresent("Access Denied"), "Secured
resource is visible.#2");
logout();
}
@@ -194,8 +197,9 @@
assignRole("user", "user(a)portal.com", "secRole",
"secRoleDisp");
- 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");
+ 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(LNK_ADMIN);
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -214,15 +218,15 @@
logout();
- Assert.assertTrue(selenium.isTextPresent("Access Denied"),"Secured
resource is visible after logout.");
+ Assert.assertTrue(selenium.isTextPresent("Access Denied"), "Secured
resource is visible after logout.");
login("user", "user");
- Assert.assertFalse(selenium.isTextPresent("Access Denied"),"Non secured
resource is not visible for the \"user\".");
+ Assert.assertFalse(selenium.isTextPresent("Access Denied"), "Non secured
resource is not visible for the \"user\".");
logout();
}
- @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");
@@ -249,7 +253,7 @@
logout();
Assert.assertTrue(selenium.isTextPresent("Access Denied"));
-
+
login("user", "user");
Assert.assertTrue(selenium.isTextPresent("Access Denied"));
@@ -289,12 +293,10 @@
selenium.open("/portal/portal/default");
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!"));
+ Assert.assertTrue(selenium.isElementPresent("//img[@alt='JBoss Portal 2.7: Go
Faster!']"));
selenium.click(LNK_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!"));
+ Assert.assertFalse(selenium.isElementPresent("//img[@alt='JBoss Portal 2.7: Go
Faster!']"));
login("admin", "admin");
selenium.click(LNK_ADMIN);
@@ -317,18 +319,16 @@
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!"));
+ Assert.assertTrue(selenium.isElementPresent("//img[@alt='JBoss Portal 2.7: Go
Faster!']"));
selenium.open("/portal/portal/default");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_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!"));
+ Assert.assertTrue(selenium.isElementPresent("//img[@alt='JBoss Portal 2.7: Go
Faster!']"));
}
- //TODO these functions should be used from indetity admin
+ // TODO these functions should be used from indetity admin
void assignRole(String user, String email, String role, String roleDisplay) {
searchUser(user, email);
@@ -336,10 +336,9 @@
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent(roleDisplay), "Role display name: "
+ roleDisplay + " not found on the page.");
- final String ID_CHECK_ROLE = "//input[@name='assign-roles-form:roles' and
@value='" + role + "']";
+ final String CHECK_ROLE = MessageFormat.format(IdentityAdminTestCase.ID_CHECK_ROLE,
role);
+ selenium.click(CHECK_ROLE);
- selenium.click(ID_CHECK_ROLE);
-
selenium.click(IdentityAdminTestCase.ID_SUBMIT_ASSIGN_ROLE);
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -347,7 +346,7 @@
selenium.click(butUsrRol_id(user));
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isChecked(ID_CHECK_ROLE), "The role wasn't
correctly assigned.");
+ Assert.assertTrue(selenium.isChecked(CHECK_ROLE), "The role wasn't correctly
assigned.");
}
@@ -360,8 +359,8 @@
Assert.assertTrue(selenium.isTextPresent(roleDisplay), "Role display name: "
+ roleDisplay + " not found on the page.");
// check the tempRole check box
- final String ID_CHECK_ROLE = "//input[@name='assign-roles-form:roles' and
@value='" + role + "']";
- selenium.click(ID_CHECK_ROLE);
+ final String CHECK_ROLE = MessageFormat.format(IdentityAdminTestCase.ID_CHECK_ROLE,
role);
+ selenium.click(CHECK_ROLE);
selenium.click(IdentityAdminTestCase.ID_SUBMIT_ASSIGN_ROLE);
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -370,28 +369,36 @@
selenium.click(butUsrRol_id(user));
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertFalse(selenium.isChecked(ID_CHECK_ROLE), "Unassigned role is assigned
(checked).");
+ Assert.assertFalse(selenium.isChecked(CHECK_ROLE), "Unassigned role is assigned
(checked).");
}
void searchUser(String username, String email) {
selenium.open("/portal/");
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click(LNK_ADMIN);
+ selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click(LNK_MEMBERS);
+ selenium.click("link=Members");
selenium.waitForPageToLoad(PAGE_LOAD);
clickIfVisible(IdentityAdminTestCase.ID_LINK_USERTAB);
clickIfVisible(IdentityAdminTestCase.ID_LINK_USERMAIN);
+ clickIfVisible(IdentityAdminTestCase.LINK_USERMANG_MAIN);
selenium.click(IdentityAdminTestCase.LINK_SEARCH_USER);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.type(IdentityAdminTestCase.ID_INPUT_SEARCH_USER, username);
selenium.click(IdentityAdminTestCase.ID_SUBMIT_SEARCH_USER);
- selenium.waitForPageToLoad(PAGE_LOAD);
+ // selenium.waitForPageToLoad(PAGE_LOAD);
+ try {
+ Thread.sleep(5000);
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
Assert.assertTrue(selenium.isTextPresent(username), "Username was not
found.");
Assert.assertTrue(selenium.isTextPresent(email), "User email adress was not
found.");
}
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-31 01:31:01 UTC
(rev 12219)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/testng.xml 2008-10-31 12:05:41 UTC
(rev 12220)
@@ -36,7 +36,7 @@
<test name="org.jboss.portal.test.selenium.cms.CMSFileTestCase"
verbose="2" annotations="JDK">
<classes>
- <class
name="org.jboss.portal.test.selenium.cms.CMSFileWorkflowTestCase"></class></classes>
+ <class
name="org.jboss.portal.test.selenium.cms.CMSFileTestCase"></class></classes>
</test>
<test name="org.jboss.portal.test.selenium.cms.CMSSecureTestCase"