[richfaces-svn-commits] JBoss Rich Faces SVN: r15877 - in branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test: java/org/jboss/richfaces/integrationTest/tooltip and 2 other directories.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Fri Nov 13 08:54:53 EST 2009


Author: ppitonak at redhat.com
Date: 2009-11-13 08:54:53 -0500 (Fri, 13 Nov 2009)
New Revision: 15877

Modified:
   branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/style/StyleTestCase.java
   branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/tooltip/TooltipDataTableTestCase.java
   branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/tooltip/TooltipTestCase.java
   branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/style/locators.properties
   branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/tooltip/locators.properties
   branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/tooltip/messages.properties
Log:
* XPath locators replaced by jQuery locators

Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/style/StyleTestCase.java
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/style/StyleTestCase.java	2009-11-13 13:21:50 UTC (rev 15876)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/style/StyleTestCase.java	2009-11-13 13:54:53 UTC (rev 15877)
@@ -67,7 +67,6 @@
 
 			selenium.click(locLink);
 			selenium.waitForPageToLoad(Long.toString(Wait.DEFAULT_TIMEOUT));
-
 			scrollIntoView(LOC_FIELDSET_HEADER, true);
 
 			assertEquals(msgColor, getStyle(LOC_PANEL, "background-color"), format(

Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/tooltip/TooltipDataTableTestCase.java
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/tooltip/TooltipDataTableTestCase.java	2009-11-13 13:21:50 UTC (rev 15876)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/tooltip/TooltipDataTableTestCase.java	2009-11-13 13:54:53 UTC (rev 15877)
@@ -36,21 +36,21 @@
 
 	private final String LOC_FIELDSET_HEADER_2 = getLoc("FIELDSET_HEADER_2");
 	private final String LOC_TD_PREFORMATTED = getLoc("TD_PREFORMATTED");
-	private final String LOC_DIV_TOOLTIP_ITEM_PREFORMATTED = getLoc("DIV_TOOLTIP_ITEM_PREFORMATTED");
-	private final String LOC_OUTPUT_TOOLTIP_MAKE = format(LOC_DIV_TOOLTIP_ITEM_PREFORMATTED, Column.MAKE);
-	private final String LOC_OUTPUT_TOOLTIP_MODEL = format(LOC_DIV_TOOLTIP_ITEM_PREFORMATTED, Column.MODEL);
-	private final String LOC_OUTPUT_TOOLTIP_YEAR = format(LOC_DIV_TOOLTIP_ITEM_PREFORMATTED, Column.YEAR);
-	private final String LOC_TD_MAKE_RELATIVE_TO_LABEL = getLoc("TD_MAKE_RELATIVE_TO_LABEL");
+	private final String LOC_OUTPUT_TOOLTIP_MAKE = getLoc("OUTPUT_TOOLTIP_MAKE");
+    private final String LOC_OUTPUT_TOOLTIP_MODEL = getLoc("OUTPUT_TOOLTIP_MODEL");
+    private final String LOC_OUTPUT_TOOLTIP_YEAR = getLoc("OUTPUT_TOOLTIP_YEAR");
+	
+    private final String LOC_TD_MAKE_RELATIVE_TO_LABEL = getLoc("TD_MAKE_RELATIVE_TO_LABEL");
 	private final String LOC_TD_MAKE_RELATIVE_TO_ACTIVE_TOOLTIP_AREA = getLoc("TD_MAKE_RELATIVE_TO_ACTIVE_TOOLTIP_AREA");
 
 	private final String MSG_EVENT_COORDS_FOR_TABLE = getMsg("EVENT_COORDS_FOR_TABLE");
 
 	@Test
 	public void testIterateThroughTable() {
-		int rows = selenium.getXpathCount(format(LOC_TD_PREFORMATTED, 0, Column.MAKE)).intValue();
+		int rows = getJQueryCount(format(LOC_TD_PREFORMATTED, 0, Column.MAKE));
 
 		for (int row = 1; row <= rows; row++) {
-			final String locCellMake = format(LOC_TD_PREFORMATTED, row, Column.MAKE);
+		    final String locCellMake = format(LOC_TD_PREFORMATTED, row, Column.MAKE);
 			final String locCellModel = format(LOC_TD_PREFORMATTED, row, Column.MODEL);
 			final String locCellYear = format(LOC_TD_PREFORMATTED, row, Column.YEAR);
 			final String locActiveTooltipArea = format(LOC_TD_MAKE_RELATIVE_TO_ACTIVE_TOOLTIP_AREA, locCellMake);

Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/tooltip/TooltipTestCase.java
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/tooltip/TooltipTestCase.java	2009-11-13 13:21:50 UTC (rev 15876)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/tooltip/TooltipTestCase.java	2009-11-13 13:54:53 UTC (rev 15877)
@@ -137,9 +137,8 @@
 			assertFalse(selenium.isTextPresent(MSG_OUTPUT_TOOLTIP_3_4_TEXT));
 
 			selenium.clickAt(LOC_PANEL_SAMPLE_4, MSG_EVENT_COORDS_AT_PANEL);
-
 			tooltipsRequested = waitForTooltipChanges(tooltipsRequested, i == 0);
-
+			
 			selenium.mouseOut(LOC_PANEL_SAMPLE_4);
 			waitForTextDisappears(MSG_OUTPUT_TOOLTIP_3_4_TEXT);
 		}
@@ -166,16 +165,17 @@
 
 	private Retrieve<Integer> retrieveRequestedTooltips = new Retrieve<Integer>() {
 		public Integer retrieve() {
-			String text = Wait.interval(20).timeout(2000).waitForChangeAndReturn(null, new Retrieve<String>() {
+			String text = Wait.interval(10).timeout(2000).waitForChangeAndReturn(null, new Retrieve<String>() {
 				public String retrieve() {
-					return getTextOrNull(LOC_SPAN_TOOLTIPS_REQUESTED);
+				    String retrieved = getTextOrNull(LOC_SPAN_TOOLTIPS_REQUESTED);
+					return retrieved;
 				}
 			});
 			Matcher matcher = MSG_REGEXP_TOOLTIPS_REQUESTED.matcher(text);
 			if (!matcher.matches()) {
 				fail();
 			}
-			return Integer.valueOf(matcher.group(1));
+			return Integer.valueOf(text);
 		}
 	};
 

Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/style/locators.properties
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/style/locators.properties	2009-11-13 13:21:50 UTC (rev 15876)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/style/locators.properties	2009-11-13 13:54:53 UTC (rev 15877)
@@ -1,5 +1,5 @@
-FIELDSET_HEADER=//legend[text()\='Style demo']
-LINK_DEEP_MARINE=//a[text()\='DeepMarine']
-LINK_BLUE_SKY=//a[text()\='BlueSky']
-LINK_JAPAN_CHERRY=//a[text()\='JapanCherry']
-PANEL=//table[@class\='rsPanel']
\ No newline at end of file
+FIELDSET_HEADER=jquery=fieldset:eq(1)
+LINK_DEEP_MARINE=jquery=a:textEquals(DeepMarine)
+LINK_BLUE_SKY=jquery=a:textEquals(BlueSky)
+LINK_JAPAN_CHERRY=jquery=a:textEquals(JapanCherry)
+PANEL=jquery=table.rsPanel
\ No newline at end of file

Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/tooltip/locators.properties
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/tooltip/locators.properties	2009-11-13 13:21:50 UTC (rev 15876)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/tooltip/locators.properties	2009-11-13 13:54:53 UTC (rev 15877)
@@ -1,11 +1,14 @@
-FIELDSET_HEADER_1=//legend[text()\='ToolTip example']
-PANEL_SAMPLE_1=//div[contains(@id,'sample1')]
-PANEL_SAMPLE_2=//div[contains(@id,'sample2')]
-PANEL_SAMPLE_3=//div[contains(@id,'sample3')]
-PANEL_SAMPLE_4=//div[contains(@id,'sample4')]
-SPAN_TOOLTIPS_REQUESTED=//*[contains(@style,'display\: block')]//*[contains(text(),'tooltips requested\:')]/../..
-FIELDSET_HEADER_2=//*[normalize-space(@class)\='rich-table']
-TD_PREFORMATTED=//*[contains(@class,'rich-table')]//*[contains(@class,'rich-table-row')]{0,choice,0\#|1\#[{0}]}//*[contains(@class,'rich-table-cell')][{1,choice,0\#2|1\#3|2\#4}]
-DIV_TOOLTIP_ITEM_PREFORMATTED=//*[contains(@class,'rich-tool-tip') and contains(@style,'display\: block')]//*[text()\='Vehicle details\:']/../../../*/*/*[text()\='{0,choice,0\#make|1\#model|2\#year}\:']/following-sibling\:\:*[1]
-TD_MAKE_RELATIVE_TO_ACTIVE_TOOLTIP_AREA={0}/*
-TD_MAKE_RELATIVE_TO_LABEL={0}/*/*[contains(@id,'\:make')]
+FIELDSET_HEADER_1=jquery=legend:textEquals(ToolTip example)
+PANEL_SAMPLE_1=jquery=div#sample1_body
+PANEL_SAMPLE_2=jquery=div#sample2_body
+PANEL_SAMPLE_3=jquery=div[id$=sample3_body]
+PANEL_SAMPLE_4=jquery=div[id$=sample4_body]
+SPAN_TOOLTIPS_REQUESTED=jquery=div[style*=block] span[class*=tooltipData]
+
+FIELDSET_HEADER_2=jquery=table.rich-table
+TD_PREFORMATTED=jquery=tr.rich-table-row{0,choice,0\#|1\#:nth-child({0})} > td:nth-child({1,choice,0\#2|1\#3|2\#4})
+OUTPUT_TOOLTIP_MAKE=jquery=div[class*=rich-tool-tip][style*=block] tbody span[class*=tooltipData]:eq(0) 
+OUTPUT_TOOLTIP_MODEL=jquery=div[class*=rich-tool-tip][style*=block] tbody span[class*=tooltipData]:eq(1)
+OUTPUT_TOOLTIP_YEAR=jquery=div[class*=rich-tool-tip][style*=block] tbody span[class*=tooltipData]:eq(2)
+TD_MAKE_RELATIVE_TO_ACTIVE_TOOLTIP_AREA={0} div
+TD_MAKE_RELATIVE_TO_LABEL={0} > div > span

Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/tooltip/messages.properties
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/tooltip/messages.properties	2009-11-13 13:21:50 UTC (rev 15876)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/tooltip/messages.properties	2009-11-13 13:54:53 UTC (rev 15877)
@@ -3,5 +3,5 @@
 OUTPUT_TOOLTIP_2=This tool-tip content also pre-rendered to the page.
 OUTPUT_TOOLTIP_3_4_WAITING=Wait...
 OUTPUT_TOOLTIP_3_4_TEXT=This tool-tip content was rendered on server
-REGEXP_TOOLTIPS_REQUESTED=.*\\s(\\d+)$
+REGEXP_TOOLTIPS_REQUESTED=\\d+
 EVENT_COORDS_FOR_TABLE=2,2



More information about the richfaces-svn-commits mailing list