[portal-commits] JBoss Portal SVN: r13068 - in branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium: portal and 1 other directory.
portal-commits at lists.jboss.org
portal-commits at lists.jboss.org
Mon Mar 23 12:25:43 EDT 2009
Author: vrockai
Date: 2009-03-23 12:25:42 -0400 (Mon, 23 Mar 2009)
New Revision: 13068
Modified:
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/CoordinationSamplesTestCase.java
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/JBossSeleniumTestListener.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/PageCoordinationTestCase.java
Log:
debug flag
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/CoordinationSamplesTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/CoordinationSamplesTestCase.java 2009-03-23 14:13:15 UTC (rev 13067)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/CoordinationSamplesTestCase.java 2009-03-23 16:25:42 UTC (rev 13068)
@@ -85,6 +85,24 @@
public void logoutAfterTest() {
}
+
+ @Test(enabled = true)
+ public void defaultCoordinationTest() {
+ selenium.open("/portal/portal/default/Coordination+Samples");
+ selenium.click("link=Coordination Samples");
+ selenium.waitForPageToLoad("30000");
+ selenium.open("http://localhost:8080/portal/portal/default/Coordination+Samples?zip=78759");
+ selenium.waitForPageToLoad("30000");
+ Assert.assertTrue(selenium.isTextPresent("Weather for (my_zipcode):78759"));
+ Assert.assertTrue(selenium.isTextPresent("Map for (your_zipcode):78759"));
+
+ selenium.type("name", "xyz");
+ selenium.type("value", "123");
+ selenium.click("//input[@value='Update']");
+ selenium.waitForPageToLoad("30000");
+
+ Assert.assertTrue(selenium.getLocation().endsWith("/portal/portal/default/Coordination+Samples?xyz=123"));
+ }
@Test(enabled = true)
public void eventsExplicitTest() {
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-03-23 14:13:15 UTC (rev 13067)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java 2009-03-23 16:25:42 UTC (rev 13068)
@@ -17,6 +17,7 @@
public class JBossPortalSeleniumTestCase {
private String casePfx = "portal.";
+ private String debugDir = "debug";
static {
try {
@@ -259,4 +260,15 @@
Assert.assertTrue(selenium.isElementPresent("Link=Login"), "Login link not present.");
}
}
+
+ protected void debugPrint(String debugText){
+ if (JBossSeleniumTestListener.debug)
+ System.out.println("[Selenium debug] : " + debugText);
+ }
+
+ protected void debugScreenshot(String filename){
+ if (JBossSeleniumTestListener.debug)
+ selenium.captureScreenshot(debugDir+"/"+filename);
+ }
+
}
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossSeleniumTestListener.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossSeleniumTestListener.java 2009-03-23 14:13:15 UTC (rev 13067)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossSeleniumTestListener.java 2009-03-23 16:25:42 UTC (rev 13068)
@@ -17,6 +17,7 @@
protected static int count;
protected static boolean screenshot = false;
protected static boolean htmlSource = false;
+ protected static boolean debug = false;
protected static String outputDir = "";
static {
@@ -30,6 +31,11 @@
htmlSource = true;
}
+ String sd = System.getProperty("html-src");
+ if ("true".equals(sd)) {
+ debug = true;
+ }
+
String so = System.getProperty("output-dir");
if (so != null) {
outputDir = so;
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-03-23 14:13:15 UTC (rev 13067)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/locator.properties 2009-03-23 16:25:42 UTC (rev 13068)
@@ -414,6 +414,7 @@
portal.e2e.por.tl.main=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:object-iid-link'')]
portal.e2e.por.tl.security=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:security-link'')]
portal.e2e.por.tl.properties=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:prop-link'')]
+
portal.e2e.por.tl.theme=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:theme-link'')]
portal.e2e.por.tl.rename=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:rename'')]
portal.e2e.por.tl.delete=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:delete'')]
@@ -428,6 +429,7 @@
portal.e2e.pag.tl.display=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:rename-display'')]
portal.e2e.pag.tl.delete=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:delete-link'')]
portal.e2e.pag.tl.makedef=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:default-link'')]
+portal.e2e.pag.tl.coord=//a[contains(@id,''pages-datatable:{0}:edit-coord'')]
portal.e2e.div.por.cont=content-container
# PortalSamplesTestCase
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-23 14:13:15 UTC (rev 13067)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PageCoordinationTestCase.java 2009-03-23 16:25:42 UTC (rev 13068)
@@ -113,56 +113,57 @@
clickAndWait("link=Admin");
selenium.captureScreenshot(++count + ".jpg");
clickIfVisible(TAB_PORTALOBJ_ID);
- selenium.captureScreenshot(++count + ".jpg");
+ debugScreenshot(++count + ".jpg");
clickIfVisible(LINK_PORTALS_ID);
- selenium.captureScreenshot(++count + ".jpg");
+ debugScreenshot(++count + ".jpg");
clickIfVisible(LINK_PORTAL_HOME);
- selenium.captureScreenshot(++count + ".jpg");
+ debugScreenshot(++count + ".jpg");
Assert.assertTrue(selenium.isTextPresent("Create a portal named:"));
int r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
clickAndWait(MessageFormat.format(POR_TL_MAIN, r));
- selenium.captureScreenshot(++count + ".jpg");
+ debugScreenshot(++count + ".jpg");
r = findTableRow(TABLE_PORTALPAGE_ADMIN, pageName, 0) - 1;
clickAndWait(MessageFormat.format(PAG_TL_COORDINATION, r));
- selenium.captureScreenshot(++count + ".jpg");
- // selenium.setSpeed("5000");
+ debugScreenshot(++count + ".jpg");
+
// create delete alias
selenium.addSelection(LIS_RENDER_PAR, "label={urn:jboss:portal:samples:coor}zipcode");
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.captureScreenshot(++count + ".jpg");
+ debugScreenshot(++count + ".jpg");
selenium.type(INP_ALIAS_NAME, "aliasBindDelete");
selenium.click(SUB_CREATE_ALIAS);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.captureScreenshot(++count + ".jpg");
+ debugScreenshot(++count + ".jpg");
+
// delete alias
r = findTableRow(TBL_ALIASES, "aliasBindDelete", 0);
selenium.click(MessageFormat.format(LNK_T_ALIAS_DELETE,r));
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.captureScreenshot(++count + ".jpg");
+ debugScreenshot(++count + ".jpg");
selenium.click(SUB_ALIAS_DEL_CANCEL);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.captureScreenshot(++count + ".jpg");
+ debugScreenshot(++count + ".jpg");
r = findTableRow(TBL_ALIASES, "aliasBindDelete", 0);
selenium.click(MessageFormat.format(LNK_T_ALIAS_DELETE,r));
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.captureScreenshot(++count + ".jpg");
+ debugScreenshot(++count + ".jpg");
selenium.click(SUB_ALIAS_DEL_SUBMIT);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.captureScreenshot(++count + ".jpg");
+ debugScreenshot(++count + ".jpg");
openAndWait("/portal/auth/portal/default/Coordination+Samples?zip=222333");
- selenium.captureScreenshot(++count + ".jpg");
+ debugScreenshot(++count + ".jpg");
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");
- selenium.captureScreenshot(++count + ".jpg");
+ debugScreenshot(++count + ".jpg");
Assert.assertTrue(selenium.isTextPresent("Weather for (my_zipcode):null"));
Assert.assertTrue(selenium.isTextPresent("Map for (your_zipcode):null"));
}
@@ -237,7 +238,6 @@
clickIfVisible(LINK_PORTALS_ID);
clickIfVisible(LINK_PORTAL_HOME);
- Assert.assertTrue(selenium.isTextPresent("Create a portal named:"));
int r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
clickAndWait(MessageFormat.format(POR_TL_MAIN, r));
More information about the portal-commits
mailing list