[portal-commits] JBoss Portal SVN: r13087 - branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium.

portal-commits at lists.jboss.org portal-commits at lists.jboss.org
Thu Mar 26 09:58:58 EDT 2009


Author: vrockai
Date: 2009-03-26 09:58:58 -0400 (Thu, 26 Mar 2009)
New Revision: 13087

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/JBossPortalSeleniumTestCase.java
   branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/locator.properties
Log:
selenium - testbugportlet locator fix

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-03-26 10:16:32 UTC (rev 13086)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardTestCase.java	2009-03-26 13:58:58 UTC (rev 13087)
@@ -11,8 +11,10 @@
 @Test(groups = { "cms_dashboard" }, enabled = true, description = "Dashboard issues test case.")
 public class DashboardTestCase extends JBossPortalSeleniumTestCase {
 
+
 	public String casePfx = "dash.";
 
+	private final String LNK_POR_WEA_EDIT = getProp(casePfx + "lnk.por.wea.edit", "//body/div[2]/div/div/div[2]/div/div/div/div/div/div/table/tbody/tr/td[2]/div/div/div[2]/span/a");
 	private final String SUB_LAYOUT_UPDATE = getProp(casePfx + "sub.layout.update", "//input[contains(@name,'dashboardLayoutForm:j_id12')]");
 	private final String SUB_PAGE_RENAME = getProp(casePfx + "sub.page.rename", "//form[contains(@id,'renameForm')]/input[@type='submit']");
 	private final String INP_PAGE_RENAME = getProp(casePfx + "inp.page.rename", "//input[contains(@id,'renameForm:newName')]");
@@ -356,7 +358,7 @@
 		Assert.assertTrue(selenium.isTextPresent("Miami, FL, US"));
 
 		// change the properties
-		selenium.click("//div[@id='dashboard:YWRtaW4=.cGFnZTE=.V2VhdGhlclBvcnRsZXRXaW5kb3c=']/div/table/tbody/tr[1]/td[2]/div/div/div[2]/span[1]/a");
+		selenium.click(LNK_POR_WEA_EDIT);
 		selenium.waitForPageToLoad(PAGE_LOAD);
 		selenium.type("newzip", "41001");
 		selenium.click("submit");

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-26 10:16:32 UTC (rev 13086)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java	2009-03-26 13:58:58 UTC (rev 13087)
@@ -17,7 +17,7 @@
 public class JBossPortalSeleniumTestCase {
 
 	private String casePfx = "portal.";
-	private String debugDir = "debug"; 
+	private String debugDir = "debug";
 
 	static {
 		try {
@@ -26,7 +26,7 @@
 			// TODO: handle exception
 		}
 	}
-	
+
 	public final String LINK_LOGOUT = getProp(casePfx + "link.logout", "link=Logout");
 	public final String SUBMIT_LOGIN = getProp(casePfx + "submit.login", "login");
 	public final String ADDR_PORTAL = getProp(casePfx + "addr.portal", "/portal/");
@@ -42,16 +42,15 @@
 	protected static final String PAGE_LOAD = "2400000";
 	protected static final long AJAX_LOAD = 3000;
 
-	//protected static final String PAGE_LOAD = "60000";
-	//protected static final long AJAX_LOAD = 2000;
+	// protected static final String PAGE_LOAD = "60000";
+	// protected static final long AJAX_LOAD = 2000;
 
-	
 	// Element timeout in seconds
 	protected static final int ELEM_TIMEOUT = 220;
 
 	@BeforeClass
 	public void setupChromeForLogin() throws Exception {
-	
+
 		String browser = System.getProperty("browser");
 
 		selenium = new DefaultSelenium("127.0.0.1", 44444, browser, "http://localhost:8080/portal/");
@@ -72,28 +71,28 @@
 		InputStream is = cl.getResourceAsStream("org/jboss/portal/test/selenium/locator.properties");
 		Properties props = new Properties();
 		props.load(is);
-		if (props == null){
+		if (props == null) {
 			is = JBossPortalSeleniumTestCase.class.getResourceAsStream("org/jboss/portal/test/selenium/locator.properties");
 			props.load(is);
 		}
-		if (props == null){
-	//		System.out.println("still null");
+		if (props == null) {
+			// System.out.println("still null");
 		}
-		
+
 		return props;
 	}
 
 	protected String getProp(String prop, String subst) {
-		
+
 		if (subst == null || "".equals(subst)) {
 			subst = "Locator not set";
 		}
 
 		if (props == null) {
-	//		System.out.println("props null");
+			// System.out.println("props null");
 			return subst;
 		} else {
-//			System.out.println("! props null");
+			// System.out.println("! props null");
 			return props.getProperty(prop) != null ? props.getProperty(prop) : subst;
 		}
 	}
@@ -260,15 +259,15 @@
 			Assert.assertTrue(selenium.isElementPresent("Link=Login"), "Login link not present.");
 		}
 	}
-	
-	protected void debugPrint(String debugText){
+
+	protected void debugPrint(String debugText) {
 		if (JBossSeleniumTestListener.debug)
 			System.out.println("[Selenium debug] : " + debugText);
 	}
-	
-	protected void debugScreenshot(String filename){
+
+	protected void debugScreenshot(String filename) {
 		if (JBossSeleniumTestListener.debug)
-			selenium.captureScreenshot(debugDir+"/"+filename);
+			selenium.captureScreenshot(debugDir + "/" + filename);
 	}
-	
+
 }

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-26 10:16:32 UTC (rev 13086)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/locator.properties	2009-03-26 13:58:58 UTC (rev 13087)
@@ -100,6 +100,7 @@
 dash.sel.layout=//select[contains(@id,'dashboardLayoutForm:layoutSelector')]
 dash.sel.theme=//select[contains(@id,'dashboardThemeForm:themeSelector')]
 dash.sub.themesel=//form[contains(@id,'dashboardThemeForm')]/input[@type='submit']
+dash.lnk.por.wea.edit=//body/div[2]/div/div/div[2]/div/div/div/div/div/div/table/tbody/tr/td[2]/div/div/div[2]/span/a
 
 # PortletUserCreationTestCase
 




More information about the portal-commits mailing list