Author: vrockai
Date: 2009-04-20 10:01:17 -0400 (Mon, 20 Apr 2009)
New Revision: 13231
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/cms/CMSSecureTestCase.java
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/locator.properties
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/EndtoEndPortalAdminTestCase.java
Log:
[selenium] - fixing failing tests
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 2009-04-20
07:05:37 UTC (rev 13230)
+++
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardTestCase.java 2009-04-20
14:01:17 UTC (rev 13231)
@@ -14,7 +14,7 @@
@Test(groups = { "cms_dashboard" }, enabled = true, description =
"Dashboard issues test case.")
public class DashboardTestCase extends JBossPortalSeleniumTestCase {
- private static final String MSG_POWER = "Powered by JBoss Enterprise Portal
Platform";
+ private static final String MSG_POWER = "Powered by JBoss";
/** prefix for locator properties = dash. */
public String casePfx = "dash.";
@@ -74,7 +74,7 @@
selenium.click(LNK_DASHBOARD);
selenium.setSpeed("5000");
// selenium.waitForPageToLoad(PAGE_LOAD);
- wait(5000);
+ waitFor(AJAX_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -105,7 +105,7 @@
// firstly create page
selenium.click(LNK_DASHBOARD);
- wait(5000);
+ waitFor(AJAX_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -149,7 +149,7 @@
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
// selenium.waitForPageToLoad(PAGE_LOAD);
- wait(5000);
+ waitFor(AJAX_LOAD);
selectIfNotSelected(SEL_PAGE, "DashTestPage");
@@ -183,7 +183,7 @@
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
// selenium.waitForPageToLoad(PAGE_LOAD);
- wait(5000);
+ waitFor(AJAX_LOAD);
selenium.windowMaximize();
selectIfNotSelected(SEL_PAGE, "DashTestPage");
@@ -217,7 +217,7 @@
selenium.click(LNK_CONFIGURE_DASHBOARD);
// selenium.waitForPageToLoad(PAGE_LOAD);
- wait(5000);
+ waitFor(AJAX_LOAD);
selectIfNotSelected(SEL_PAGE, "DashTestPage");
selenium.click(LINK_PORTL2);
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -255,7 +255,7 @@
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
// selenium.waitForPageToLoad(PAGE_LOAD);
- wait(5000);
+ waitFor(AJAX_LOAD);
selenium.type(INP_PAGENAME, pageName);
selenium.click(SUB_CREATEPAGE);
@@ -302,7 +302,7 @@
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
// selenium.waitForPageToLoad(PAGE_LOAD);
- wait(5000);
+ waitFor(AJAX_LOAD);
selectIfNotSelected(SEL_PAGE, pageName);
selenium.addSelection(SEL_CENTER_REGION, OPT_PORTL1);
@@ -331,7 +331,7 @@
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
// selenium.waitForPageToLoad(PAGE_LOAD);
- wait(5000);
+ waitFor(AJAX_LOAD);
selectIfNotSelected(SEL_PAGE, "DashTestPage");
@@ -361,7 +361,7 @@
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
// selenium.waitForPageToLoad(PAGE_LOAD);
- wait(5000);
+ waitFor(AJAX_LOAD);
selectIfNotSelected(SEL_PAGE, "DashTestPage");
selenium.select(SEL_CONTENT_TYPE, "label=widget/google");
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -406,7 +406,7 @@
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
// selenium.waitForPageToLoad(PAGE_LOAD);
- wait(5000);
+ waitFor(AJAX_LOAD);
selenium.type(INP_PAGENAME, pageName);
selenium.click(SUB_CREATEPAGE);
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -455,7 +455,7 @@
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
// selenium.waitForPageToLoad(PAGE_LOAD);
- wait(5000);
+ waitFor(AJAX_LOAD);
selectIfNotSelected(SEL_PAGE, pageName);
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-04-20
07:05:37 UTC (rev 13230)
+++
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSSecureTestCase.java 2009-04-20
14:01:17 UTC (rev 13231)
@@ -18,6 +18,11 @@
//TODO tests testing write and manage security are missing
@Test(groups = { "cms_secure" }, enabled = true, description = "Setting
permissions on the default portlet.")
public class CMSSecureTestCase extends JBossPortalSeleniumTestCase {
+ /**
+ *
+ */
+ private static final String MSG_ACCESS_DENIED = "You are not allowed to access the
resource";
+
private final String casePfx = "cms.sec.";
private final String LNK_EXPLORE = getProp(casePfx + "lnk.explore",
"//area[(a)href='/portal/content/default/epp.html']");
@@ -129,7 +134,7 @@
public void testSetAdminReadPer() {
login("admin", "admin");
- Assert.assertFalse(selenium.isTextPresent("Access to this resource is
denied"), "Non secured resource is not visible.#1");
+ Assert.assertFalse(selenium.isTextPresent(MSG_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");
@@ -153,14 +158,14 @@
logout();
- Assert.assertTrue(selenium.isTextPresent("Access to this resource is
denied"), "Secured resource is visible.#1");
+ Assert.assertTrue(selenium.isTextPresent(MSG_ACCESS_DENIED), "Secured resource is
visible.#1");
login("user", "user");
- Assert.assertTrue(selenium.isTextPresent("Access to this resource is
denied"), "Secured resource is visible.#2");
+ Assert.assertTrue(selenium.isTextPresent(MSG_ACCESS_DENIED), "Secured resource is
visible.#2");
logout();
login("admin", "admin");
- Assert.assertFalse(selenium.isTextPresent("Access to this resource is
denied"), "Secured resource is visible.#2");
+ Assert.assertFalse(selenium.isTextPresent(MSG_ACCESS_DENIED), "Secured resource is
visible.#2");
}
/**
@@ -178,7 +183,7 @@
login("admin", "admin");
- Assert.assertFalse(selenium.isTextPresent("Access to this resource is
denied"), "Non secured resource is not visible.#1");
+ Assert.assertFalse(selenium.isTextPresent(MSG_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");
@@ -222,10 +227,10 @@
logout();
- Assert.assertTrue(selenium.isTextPresent("Access to this resource is denied
"), "Secured resource is visible.#1");
+ Assert.assertTrue(selenium.isTextPresent(MSG_ACCESS_DENIED), "Secured resource is
visible.#1");
login("user", "user");
- Assert.assertFalse(selenium.isTextPresent("Access to this resource is denied
"), "Secured resource is visible.#2");
+ Assert.assertFalse(selenium.isTextPresent(MSG_ACCESS_DENIED), "Secured resource is
visible.#2");
logout();
}
@@ -243,7 +248,7 @@
assignRole("user", "user(a)portal.com", "secRole",
"secRoleDisp");
- Assert.assertFalse(selenium.isTextPresent("Access to this resource is
denied"), "Non secured resource is not visible.#1");
+ Assert.assertFalse(selenium.isTextPresent(MSG_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");
@@ -264,10 +269,10 @@
logout();
- Assert.assertTrue(selenium.isTextPresent("Access to this resource is
denied"), "Secured resource is visible after logout.");
+ Assert.assertTrue(selenium.isTextPresent(MSG_ACCESS_DENIED), "Secured resource is
visible after logout.");
login("user", "user");
- Assert.assertFalse(selenium.isTextPresent("Access to this resource is
denied"), "Non secured resource is not visible for the
\"user\".");
+ Assert.assertFalse(selenium.isTextPresent(MSG_ACCESS_DENIED), "Non secured
resource is not visible for the \"user\".");
logout();
}
@@ -284,7 +289,7 @@
deassignRole("user", "user(a)portal.com", "secRole",
"secRoleDisp");
- Assert.assertFalse(selenium.isTextPresent("Access to this resource is
denied"));
+ Assert.assertFalse(selenium.isTextPresent(MSG_ACCESS_DENIED));
Assert.assertFalse(selenium.isTextPresent("You are not allowed to access the
following resource - /default/index.html"));
selenium.click(LNK_ADMIN);
@@ -304,11 +309,11 @@
logout();
- Assert.assertTrue(selenium.isTextPresent("Access to this resource is
denied"));
+ Assert.assertTrue(selenium.isTextPresent(MSG_ACCESS_DENIED));
login("user", "user");
- Assert.assertTrue(selenium.isTextPresent("Access to this resource is
denied"));
+ Assert.assertTrue(selenium.isTextPresent(MSG_ACCESS_DENIED));
logout();
}
Modified:
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/locator.properties
===================================================================
---
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/locator.properties 2009-04-20
07:05:37 UTC (rev 13230)
+++
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/locator.properties 2009-04-20
14:01:17 UTC (rev 13231)
@@ -433,6 +433,11 @@
portal.e2e.pag.tl.coord=//a[contains(@id,''pages-datatable:{0}:edit-coord'')]
portal.e2e.div.por.cont=content-container
+portal.e2e.inp.goo.search=query-input
+portal.e2e.sub.goo.search=submit-button
+portal.e2e.inp.net.search=//div[@id='bilto']/div/div[3]/form/input[1]
+portal.e2e.sub.net.search=//div[@id='bilto']/div/div[3]/form/input[2]
+
# PortalSamplesTestCase
samples.ses.lnk.invalidate=link=invalidate
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-04-20
07:05:37 UTC (rev 13230)
+++
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/EndtoEndPortalAdminTestCase.java 2009-04-20
14:01:17 UTC (rev 13231)
@@ -57,8 +57,8 @@
private final String DIV_PORT_CONTENT = getProp(casePfx + "div.por.cont",
"conrrerertent-container");
private final String INP_GOO_SEARCH = getProp(casePfx + "inp.goo.search",
"//div[contains(@id,'directory_search_div')]/form/input[@name='query']");
private final String SUB_GOO_SEARCH = getProp(casePfx + "sup.goo.search",
"//div[contains(@id,'directory_search_div')]/form/input[@type='submit']");
- private final String INP_NET_SEARCH = getProp(casePfx + "inp.goo.search",
"//div[contains(@id,'directory_search_div')]/form/input[@name='query']");
- private final String SUB_NET_SEARCH = getProp(casePfx + "sub.goo.search",
"//div[contains(@id,'directory_search_div')]/form/input[@type='submit']");
+ private final String INP_NET_SEARCH = getProp(casePfx + "inp.net.search",
"//div[contains(@id,'directory_search_div')]/form/input[@name='query']");
+ private final String SUB_NET_SEARCH = getProp(casePfx + "sub.net.search",
"//div[contains(@id,'directory_search_div')]/form/input[@type='submit']");
@BeforeMethod(groups = { "log" })
protected void loginBeforeTest() {