JBoss Rich Faces SVN: r12350 - in trunk/test-applications/seleniumTest/richfaces/src: test/java/org/richfaces/testng and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: alevkovsky
Date: 2009-01-20 08:44:58 -0500 (Tue, 20 Jan 2009)
New Revision: 12350
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/toolBar/toolBarAutoTest.xhtml
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ToolBarTest.java
Log:
Tool bar selenium tests
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/toolBar/toolBarAutoTest.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/toolBar/toolBarAutoTest.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ToolBarTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ToolBarTest.java 2009-01-20 12:41:33 UTC (rev 12349)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ToolBarTest.java 2009-01-20 13:44:58 UTC (rev 12350)
@@ -20,18 +20,23 @@
*/
package org.richfaces.testng;
+import java.util.HashMap;
+import java.util.Map;
+
import org.ajax4jsf.template.Template;
+import org.richfaces.AutoTester;
import org.richfaces.SeleniumTestBase;
import org.testng.annotations.Test;
public class ToolBarTest extends SeleniumTestBase {
+
+ static final Map<String, String> TOOL_BAR_STYLES = new HashMap<String, String>();
+ static {
+ TOOL_BAR_STYLES.put("font-size", "16px");
+ }
private static final String TOOLBAR = "toolbar";
- private final static String RESULT_FAILED_TEXT = "No";
-
- private final static String RESULT_PASSED_TEXT = "Passed";
-
/* Tab panel group/item separator constants */
private final static String LINE_SEPARATOR = "line";
@@ -67,38 +72,33 @@
clickAjaxCommandAndWait(id + "gis_" + SQUARE_SEPARATOR);
clickAjaxCommandAndWait(id + "gis_" + NONE_SEPARATOR);
}
-
+
@Test
- public void testToolBarEvents(Template template) {
- renderPage(template);
+ public void testRendered(Template template){
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, null);
+
+ tester.testRendered();
+ }
+
+ @Test
+ public void testStylesAndClassesAndHtmlAttributes(Template template){
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, null);
+
+ tester.testStyleAndClasses(new String [] {"rich-toolbar", "styleClass"}, TOOL_BAR_STYLES);
+ tester.testHTMLEvents();
+ }
- writeStatus("Check component event triggering");
- String toolbar = getParentId() + TOOLBAR + "_click";
- testOnclickEvent(toolbar, toolbar + "_result", RESULT_FAILED_TEXT, RESULT_PASSED_TEXT);
-
- toolbar = getParentId() + TOOLBAR + "_dblclick";
- testOnDblclickEvent(toolbar, toolbar + "_result", RESULT_FAILED_TEXT, RESULT_PASSED_TEXT);
-
- toolbar = getParentId() + TOOLBAR + "_mousedown";
- testOnmousedownEvent(toolbar, toolbar + "_result", RESULT_FAILED_TEXT, RESULT_PASSED_TEXT);
-
- toolbar = getParentId() + TOOLBAR + "_mousemove";
- testOnmousemoveEvent(toolbar, toolbar + "_result", RESULT_FAILED_TEXT, RESULT_PASSED_TEXT);
-
- toolbar = getParentId() + TOOLBAR + "_mouseout";
- testOnmouseoutEvent(toolbar, toolbar + "_result", RESULT_FAILED_TEXT, RESULT_PASSED_TEXT);
-
- toolbar = getParentId() + TOOLBAR + "_mouseover";
- testOnmouseoverEvent(toolbar, toolbar + "_result", RESULT_FAILED_TEXT, RESULT_PASSED_TEXT);
-
- toolbar = getParentId() + TOOLBAR + "_mouseup";
- testOnmouseupEvent(toolbar, toolbar + "_result", RESULT_FAILED_TEXT, RESULT_PASSED_TEXT);
- }
-
@Override
public String getTestUrl() {
return "pages/toolBar/toolBarTest.xhtml";
}
+
+ @Override
+ public String getAutoTestUrl() {
+ return "pages/toolBar/toolBarAutoTest.xhtml";
+ }
}
16 years
JBoss Rich Faces SVN: r12349 - in trunk/test-applications/seleniumTest/richfaces/src: test/java/org/richfaces/testng and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2009-01-20 07:41:33 -0500 (Tue, 20 Jan 2009)
New Revision: 12349
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/tabPanel/tabPanelAutoTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/TabPanelTest.java
Log:
RF-5566
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/tabPanel/tabPanelAutoTest.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/TabPanelTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/TabPanelTest.java 2009-01-20 12:26:29 UTC (rev 12348)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/TabPanelTest.java 2009-01-20 12:41:33 UTC (rev 12349)
@@ -457,6 +457,14 @@
Assert.fail("Title attribute for tab was not output to client");
}
}
+
+ @Test
+ public void testRenderedAttribute(Template template) {
+ AutoTester autoTester = getAutoTester(this);
+ autoTester.renderPage(template, RESET_METHOD);
+
+ autoTester.testRendered();
+ }
private void testListener(String parentId) {
16 years
JBoss Rich Faces SVN: r12348 - in trunk/test-applications/seleniumTest/richfaces/src: test/java/org/richfaces/testng and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: alevkovsky
Date: 2009-01-20 07:26:29 -0500 (Tue, 20 Jan 2009)
New Revision: 12348
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/tabPanel/testTabServerModeWithExternalValidation.xhtml
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/TabPanelTest.java
Log:
Tab panel selenium tests
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/tabPanel/testTabServerModeWithExternalValidation.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/tabPanel/testTabServerModeWithExternalValidation.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/TabPanelTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/TabPanelTest.java 2009-01-20 12:25:30 UTC (rev 12347)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/TabPanelTest.java 2009-01-20 12:26:29 UTC (rev 12348)
@@ -58,6 +58,8 @@
private final static String IMMEDIATE_TAB_URL = "pages/tabPanel/immediateTabTest.xhtml";
private final static String SERVER_AWARE_MODE_URL = "pages/tabPanel/testTabServerMode.xhtml";
+
+ private final static String SERVER_AWARE_MODE_WITH_EXTERAL_VALIDATIO_URL = "pages/tabPanel/testTabServerModeWithExternalValidation.xhtml";
private static Map<String, String> params = new HashMap<String, String>();
@@ -278,6 +280,15 @@
}
@Test
+ public void testAjaxSingleTabWithEXternalValidationFailureAndProcess(Template template) {
+ renderPage(INIT_AJAX_SINGLE_TEST_URL, template, INIT_AJAX_SINGLE_TEST);
+
+
+ //FIXME https://jira.jboss.org/jira/browse/RF-5759
+ Assert.fail("https://jira.jboss.org/jira/browse/RF-5759");
+ }
+
+ @Test
public void testDisabledTabs(Template template) {
renderPage(DISABLED_TAB_URL, template, RESET_METHOD);
@@ -387,6 +398,32 @@
}
@Test
+ public void testServerAwareModeWithExternalValidation(Template template) {
+ renderPage(SERVER_AWARE_MODE_WITH_EXTERAL_VALIDATIO_URL, template, RESET_METHOD);
+
+ String parentId = getParentId() + FORM_ID;
+ String tab1 = parentId + "tab1";
+ String tab2 = parentId + "tab2";
+ String message = parentId + "message";
+ String input = parentId + "external_input";
+
+ AssertVisible(tab1, "TabPanel was not swtiched to the second tab");
+ assertMessageEquals(message, "", "Validation was processed for rendered tab");
+
+ clickCommandAndWait(tab2 + "_lbl");
+
+ assertMessageNotEquals(message, "", "Validation was not processed for rendered tab");
+ AssertVisible(tab1, "TabPanel was not swtiched to the second tab");
+
+ setValueById(input, "Some text");
+ clickCommandAndWait(tab2 + "_lbl");
+
+ assertMessageEquals(message, "", "Validation should be passed");
+ AssertVisible(tab2, "TabPanel was not swtiched to the second tab");
+
+ }
+
+ @Test
public void testStylesAndClassesStandardAttributes(Template template) {
AutoTester autoTester = getAutoTester(this);
autoTester.renderPage(template, RESET_METHOD);
16 years
JBoss Rich Faces SVN: r12347 - in trunk/sandbox/samples/colorPicker/src/main: webapp/pages and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: artdaw
Date: 2009-01-20 07:25:30 -0500 (Tue, 20 Jan 2009)
New Revision: 12347
Modified:
trunk/sandbox/samples/colorPicker/src/main/java/org/richfaces/sandbox/samples/Bean.java
trunk/sandbox/samples/colorPicker/src/main/webapp/pages/index.jsp
Log:
colorPicker: sample was fixed
Modified: trunk/sandbox/samples/colorPicker/src/main/java/org/richfaces/sandbox/samples/Bean.java
===================================================================
--- trunk/sandbox/samples/colorPicker/src/main/java/org/richfaces/sandbox/samples/Bean.java 2009-01-20 12:24:53 UTC (rev 12346)
+++ trunk/sandbox/samples/colorPicker/src/main/java/org/richfaces/sandbox/samples/Bean.java 2009-01-20 12:25:30 UTC (rev 12347)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.richfaces.sandbox.ui;
+package org.richfaces.sandbox.samples;
/**
* @author Gleb Galkin
*
@@ -28,7 +28,7 @@
public class Bean {
- private String color = null;
+ private String color = "#cccccc";
public Bean() {
Modified: trunk/sandbox/samples/colorPicker/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/sandbox/samples/colorPicker/src/main/webapp/pages/index.jsp 2009-01-20 12:24:53 UTC (rev 12346)
+++ trunk/sandbox/samples/colorPicker/src/main/webapp/pages/index.jsp 2009-01-20 12:25:30 UTC (rev 12347)
@@ -8,7 +8,7 @@
<body>
<f:view>
<h:form>
- <colorPicker:colorPicker value="#{bean.color}" flat="false" initColor="#cccccc" showEvent="onclick"/>
+ <colorPicker:colorPicker value="#{bean.color}" flat="true" showEvent="onclick" colorMode="rgb"/>
<h:commandButton value="Submit" />
</h:form>
</f:view>
16 years
JBoss Rich Faces SVN: r12346 - in trunk/sandbox/ui/colorPicker/src/main: resources/org/richfaces/ui/renderkit/html/css and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: artdaw
Date: 2009-01-20 07:24:53 -0500 (Tue, 20 Jan 2009)
New Revision: 12346
Modified:
trunk/sandbox/ui/colorPicker/src/main/config/component/colorPicker.xml
trunk/sandbox/ui/colorPicker/src/main/resources/org/richfaces/ui/renderkit/html/css/colorPicker.xcss
trunk/sandbox/ui/colorPicker/src/main/resources/org/richfaces/ui/renderkit/html/scripts/ui.colorpicker.js
trunk/sandbox/ui/colorPicker/src/main/templates/org/richfaces/ui/htmlColorPicker.jspx
Log:
colorPicker: JavaScript bugs were fixed. New attribute "colorMode" was added
Modified: trunk/sandbox/ui/colorPicker/src/main/config/component/colorPicker.xml
===================================================================
--- trunk/sandbox/ui/colorPicker/src/main/config/component/colorPicker.xml 2009-01-20 11:23:18 UTC (rev 12345)
+++ trunk/sandbox/ui/colorPicker/src/main/config/component/colorPicker.xml 2009-01-20 12:24:53 UTC (rev 12346)
@@ -22,15 +22,6 @@
</superclass>
</tag>
<property>
- <name>value</name>
- <classname>java.lang.Object</classname>
- <description>
- The value of the component
- </description>
- </property>
-
-
- <property>
<name>flat</name>
<classname>java.lang.Boolean</classname>
<description>
@@ -39,13 +30,12 @@
<defaultvalue>false</defaultvalue>
</property>
<property>
- <name>initColor</name>
+ <name>colorMode</name>
<classname>java.lang.String</classname>
<description>
- Defines initial color for the component.
- You can use hex, RGB or HSB values.
+ Defines a color mode for the component input. Possible values are hex, rgb.
</description>
- <defaultvalue><![CDATA["#ffffff"]]></defaultvalue>
+ <defaultvalue><![CDATA["hex"]]></defaultvalue>
</property>
<property>
<name>showEvent</name>
@@ -56,14 +46,11 @@
</description>
<defaultvalue><![CDATA["onclick"]]></defaultvalue>
</property>
-
-
-
<property>
<name>value</name>
- <classname>java.lang.Object</classname>
+ <classname>java.lang.String</classname>
<description>
- The value of the component
+ The value of the component. You can define value as hex, RGB or HSB.
</description>
</property>
&ui_component_attributes;
Modified: trunk/sandbox/ui/colorPicker/src/main/resources/org/richfaces/ui/renderkit/html/css/colorPicker.xcss
===================================================================
--- trunk/sandbox/ui/colorPicker/src/main/resources/org/richfaces/ui/renderkit/html/css/colorPicker.xcss 2009-01-20 11:23:18 UTC (rev 12345)
+++ trunk/sandbox/ui/colorPicker/src/main/resources/org/richfaces/ui/renderkit/html/css/colorPicker.xcss 2009-01-20 12:24:53 UTC (rev 12346)
@@ -13,8 +13,6 @@
position:absolute;
width:350px;
margin-top: 2px;
- !margin-top: -6px;
- !margin-left: -2px;
}
.rich-colorPicker-ext{
position: relative;
@@ -25,6 +23,9 @@
margin: 0px;
}
+.rich-colorPicker-rainbow div{
+ background: transparent no-repeat scroll left top;
+}
.rich-colorPicker-color {
background:#FF0000 none repeat scroll 0 0;
cursor:crosshair;
Modified: trunk/sandbox/ui/colorPicker/src/main/resources/org/richfaces/ui/renderkit/html/scripts/ui.colorpicker.js
===================================================================
--- trunk/sandbox/ui/colorPicker/src/main/resources/org/richfaces/ui/renderkit/html/scripts/ui.colorpicker.js 2009-01-20 11:23:18 UTC (rev 12345)
+++ trunk/sandbox/ui/colorPicker/src/main/resources/org/richfaces/ui/renderkit/html/scripts/ui.colorpicker.js 2009-01-20 12:24:53 UTC (rev 12346)
@@ -305,12 +305,12 @@
this._trigger("submit", e, { options: this.options, hex: '#'+this._HSBToHex(col), rgb: 'rgb('+RGBCol.r+', '+RGBCol.g+', '+RGBCol.b+')' });
// this._trigger("submit", e, { options: this.options, hsb: col, hex: this._HSBToHex(col), rgb: this._HSBToRGB(col) });
this.picker.hide();
- $(document).unbind('mousedown.colorPicker');
+ $(window).unbind('mousedown.colorPicker');
return false;
},
_clickCancel: function(e) {
this.picker.hide();
- $(document).unbind('mousedown.colorPicker');
+ $(window).unbind('mousedown.colorPicker');
return false;
},
_show: function(e) {
@@ -339,7 +339,7 @@
}
var self = this;
- $(document).bind('mousedown.colorPicker', function(e) { return self._hide.call(self, e); });
+ $(window).bind('mousedown.colorPicker', function(e) { return self._hide.call(self, e); });
return false;
},
Modified: trunk/sandbox/ui/colorPicker/src/main/templates/org/richfaces/ui/htmlColorPicker.jspx
===================================================================
--- trunk/sandbox/ui/colorPicker/src/main/templates/org/richfaces/ui/htmlColorPicker.jspx 2009-01-20 11:23:18 UTC (rev 12345)
+++ trunk/sandbox/ui/colorPicker/src/main/templates/org/richfaces/ui/htmlColorPicker.jspx 2009-01-20 12:24:53 UTC (rev 12346)
@@ -18,8 +18,8 @@
<c:object var="showEvent" type="java.lang.String" />
<c:object var="clientIdJquery" type="java.lang.String" />
+ <c:object var="colorMode" type="java.lang.String" />
-
<div style="display: none;" id="#{clientId}-colorPickerScript">
<script type="text/javascript">
$(document).ready(function(){
@@ -29,22 +29,37 @@
}
<jsp:scriptlet><![CDATA[
- Boolean flat = (Boolean) component.getAttributes().get("flat");
- String initColor = (String) component.getAttributes().get("initColor");
+ Boolean flat = (Boolean) component.getAttributes().get("flat");
+ colorMode = (String) component.getAttributes().get("colorMode");
showEvent = (String) component.getAttributes().get("showEvent");
if(showEvent.startsWith("on")){
showEvent = showEvent.substring(2);
}
clientIdJquery = convertToString(clientId);
- clientIdJquery = clientIdJquery.replace(":", "\\\\:");
- ]]></jsp:scriptlet>
+ clientIdJquery = clientIdJquery.replace(":", "\\\\:");
+
+ colorMode = colorMode.toLowerCase();
+ java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("\\s+");
+ colorMode = pattern.matcher(colorMode).replaceAll("");
+
+ ]]></jsp:scriptlet>
+
$('\##{clientIdJquery}colorPicker').colorPicker({
flat: #{component.attributes['flat']},
- color: '#{component.attributes['initColor']}',
- showEvent: '#{showEvent}',
+ color: "#{component.attributes['value']}",
+ showEvent: "#{showEvent}",
clientId: '\##{clientIdJquery}colorPicker',
- submit: function(e, ui) {
- $('\##{clientIdJquery}colorPicker input').val(ui.hex);
+ submit: function(e, ui) {
+ switch("#{colorMode}"){
+ case "hex":
+ $('\##{clientIdJquery}colorPicker input').val(ui.hex);
+ break;
+ case "rgb":
+ $('\##{clientIdJquery}colorPicker input').val(ui.rgb);
+ break;
+ default:
+ $('\##{clientIdJquery}colorPicker input').val(ui.hex);
+ }
}
});
});
16 years
JBoss Rich Faces SVN: r12345 - trunk/ui/dataTable/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: alevkovsky
Date: 2009-01-20 06:23:18 -0500 (Tue, 20 Jan 2009)
New Revision: 12345
Modified:
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
Log:
https://jira.jboss.org/jira/browse/RF-5770
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2009-01-20 11:10:31 UTC (rev 12344)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2009-01-20 11:23:18 UTC (rev 12345)
@@ -151,14 +151,7 @@
ResponseWriter writer = context.getResponseWriter();
UIComponent header = table.getHeader();
boolean columnFacetPresent = isColumnFacetPresent(table, "header");
- boolean isFilterByPresent = isHeaderFactoryColumnAttributePresent(table, "filterBy");
- boolean isSortingPresent = isHeaderFactoryColumnAttributePresent(table, "sortBy")
- || isHeaderFactoryColumnAttributePresent(table, "comparator");
-
- if (isFilterByPresent || isSortingPresent) {
- FormUtil.throwEnclFormReqExceptionIfNeed(context, table);
- }
-
+ boolean isFilterByPresent = isHeaderFactoryColumnAttributePresent(table, "filterBy");
Iterator<UIComponent> colums = table.columns();
@@ -693,6 +686,7 @@
writer.writeAttribute("id", clientId, null);
if (sortableColumn && col.isSelfSorted()) {
+ FormUtil.throwEnclFormReqExceptionIfNeed(context, column.getParent());
writer.writeAttribute(HTML.onclick_ATTRIBUTE, buildAjaxFunction(context, column, true)
.toString(), null);
writer.writeAttribute(HTML.style_ATTRIBUTE, "cursor: pointer;", null);
16 years
JBoss Rich Faces SVN: r12344 - in trunk/test-applications/seleniumTest/richfaces/src: main/webapp/pages/panelMenuItem and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: dsvyatobatsko
Date: 2009-01-20 06:10:31 -0500 (Tue, 20 Jan 2009)
New Revision: 12344
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/panelMenuItem/
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/panelMenuItem/panelMenuItemAutoTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/PanelMenuItemTest.java
Log:
https://jira.jboss.org/jira/browse/RF-5792
https://jira.jboss.org/jira/browse/RF-5799
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/panelMenuItem/panelMenuItemAutoTest.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/panelMenuItem/panelMenuItemAutoTest.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/PanelMenuItemTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/PanelMenuItemTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/PanelMenuItemTest.java 2009-01-20 11:10:31 UTC (rev 12344)
@@ -0,0 +1,51 @@
+package org.richfaces.testng;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.ajax4jsf.template.Template;
+import org.richfaces.AutoTester;
+import org.richfaces.SeleniumTestBase;
+import org.testng.annotations.Test;
+
+public class PanelMenuItemTest extends SeleniumTestBase {
+
+ private static Map<String, String> params = new HashMap<String, String>();
+
+ static {
+ params.put("parameter1", "value1");
+ params.put("parameter2", "value2");
+ params.put("parameter3", "value3");
+ }
+
+ @Test
+ public void testRenderedAttribute(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, null);
+ writeStatus("Test component with rendered = false is not present on the page");
+ tester.testRendered();
+ }
+
+ @Test
+ public void testNestedParams(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, null);
+ writeStatus("Test component encodes nested f:param tags and their values are present as request parameters");
+ tester.testRequestParameters(params);
+ }
+
+ @Override
+ public void sendAjax() {
+ clickAjaxCommandAndWait("icon" + getAutoTester(this).getClientId("") + "item");
+ }
+
+ @Override
+ public String getAutoTestUrl() {
+ return "pages/panelMenuItem/panelMenuItemAutoTest.xhtml";
+ }
+
+ @Override
+ public String getTestUrl() {
+ return null;
+ }
+}
Property changes on: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/PanelMenuItemTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
16 years
JBoss Rich Faces SVN: r12343 - in trunk/test-applications/seleniumTest/richfaces/src: main/webapp/pages/treeNodesAdaptor and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2009-01-19 14:00:16 -0500 (Mon, 19 Jan 2009)
New Revision: 12343
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/TreeNodesAdaptorTestBean.java
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/treeNodesAdaptor/treeNodesAdaptor.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/TreeNodesAdaptorTest.java
Log:
RF-5584
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/TreeNodesAdaptorTestBean.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/TreeNodesAdaptorTestBean.java 2009-01-19 18:59:33 UTC (rev 12342)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/TreeNodesAdaptorTestBean.java 2009-01-19 19:00:16 UTC (rev 12343)
@@ -49,6 +49,7 @@
private List<Node> nodes;
private String trace;
private Boolean ajaxSingle;
+ private Boolean includedNode;
public TreeNodesAdaptorTestBean() {
init();
@@ -69,6 +70,7 @@
}
trace = "";
ajaxSingle = false;
+ includedNode = true;
}
public void submit(ActionEvent event) {
@@ -98,4 +100,12 @@
public Boolean getAjaxSingle() {
return ajaxSingle;
}
+
+ public void setIncludedNode(Boolean includedNode) {
+ this.includedNode = includedNode;
+ }
+
+ public Boolean getIncludedNode() {
+ return includedNode;
+ }
}
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/treeNodesAdaptor/treeNodesAdaptor.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/treeNodesAdaptor/treeNodesAdaptor.xhtml 2009-01-19 18:59:33 UTC (rev 12342)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/treeNodesAdaptor/treeNodesAdaptor.xhtml 2009-01-19 19:00:16 UTC (rev 12343)
@@ -13,6 +13,10 @@
<h:selectBooleanCheckbox id="ajaxSingle" value="#{treeNodesAdaptor.ajaxSingle}">
<a4j:support event="onchange" reRender="tree"/>
</h:selectBooleanCheckbox>
+ <h:outputText value="includedNode" />
+ <h:selectBooleanCheckbox id="includedNode" value="#{treeNodesAdaptor.includedNode}">
+ <a4j:support event="onchange" reRender="tree"/>
+ </h:selectBooleanCheckbox>
</h:form>
<h:form id="mainForm">
<rich:tree id="tree">
@@ -23,7 +27,7 @@
<a4j:commandButton id="ajaxSubmit" value="ajaxSubmit" actionListener="#{treeNodesAdaptor.submit}"></a4j:commandButton>
<a4j:commandButton id="ajaxSingleSubmit" value="ajaxSingleSubmit" actionListener="#{treeNodesAdaptor.submit}" ajaxSingle="true"></a4j:commandButton>
</rich:treeNode>
- <rich:treeNodesAdaptor nodes="#{node.children}" var="child">
+ <rich:treeNodesAdaptor nodes="#{node.children}" var="child" includedNode="#{treeNodesAdaptor.includedNode}">
<rich:treeNode ajaxSingle="#{treeNodesAdaptor.ajaxSingle}">
<h:inputText value="#{child.id}"></h:inputText>
</rich:treeNode>
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/TreeNodesAdaptorTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/TreeNodesAdaptorTest.java 2009-01-19 18:59:33 UTC (rev 12342)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/TreeNodesAdaptorTest.java 2009-01-19 19:00:16 UTC (rev 12343)
@@ -36,6 +36,8 @@
private String ajaxSingle;
+ private String includedNode;
+
private String tree;
private String outputText;
@@ -56,6 +58,7 @@
}
String attrForm = getParentId() + "attrForm";
ajaxSingle = attrForm + ":ajaxSingle";
+ includedNode = attrForm + ":includedNode";
String mainForm = getParentId() + "mainForm";
tree = mainForm + ":tree";
outputText = getParentId() + "outputText";
@@ -86,7 +89,7 @@
private void checkModel(String nodesLocator, boolean ajaxSingle) {
String dataTableLocator = "xpath=id('"+ dataTable + "')/tbody/tr[";
for (int j = 1; j <= 3; j++) {
- if (ajaxSingle && j == 2) {
+ if (ajaxSingle && j != 2) {
Assert.assertFalse(selenium.getValue(nodesLocator + "/table[" + j + "]/tbody/tr/td[3]/input").equals(selenium.getText(dataTableLocator + j + "]")));
} else {
Assert.assertEquals(selenium.getValue(nodesLocator + "/table[" + j + "]/tbody/tr/td[3]/input"), selenium.getText(dataTableLocator + j + "]"));
@@ -114,7 +117,7 @@
for (int j = 1; j <= 3; j++) {
selenium.type(nodesLocator + "/table[" + j + "]/tbody/tr/td[3]/input", "xyz" + j);
}
- clickAjaxCommandAndWait(nodesLocator + "/table[1]/tbody/tr/td[1]/div/a");
+ clickAjaxCommandAndWait(nodesLocator + "/table[2]/tbody/tr/td[1]/div/a");
checkModel(nodesLocator, true);
String buttonLocator = titleLocator + "/td[3]/input[";
Assert.assertEquals(selenium.getText(outputText), "");
@@ -129,6 +132,20 @@
Assert.assertTrue(selenium.getText(outputText).endsWith("1::ajaxSingleSubmit"));
}
+ /**
+ * includedNode expression is handled properly
+ */
+ @Test
+ public void testIncludedNode(Template template) {
+ init(template);
+ String xpath = "id('"+ tree + "')/div";
+ clickAjaxCommandAndWait("xpath=" + xpath + "/table[2]/tbody/tr/td[1]/div/a");
+ String childrenXpath = "id('"+ tree + "')/div" + "/div[2]/table";
+ Assert.assertEquals(selenium.getXpathCount(childrenXpath), nodes.get(1).getChildren().size());
+ clickAjaxCommandAndWait(includedNode);
+ Assert.assertEquals(selenium.getXpathCount(childrenXpath), 0);
+ }
+
@Override
public String getTestUrl() {
return "pages/treeNodesAdaptor/treeNodesAdaptor.xhtml";
16 years
JBoss Rich Faces SVN: r12342 - in trunk/test-applications/seleniumTest/richfaces/src: test/java/org/richfaces and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: dsvyatobatsko
Date: 2009-01-19 13:59:33 -0500 (Mon, 19 Jan 2009)
New Revision: 12342
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/RichPanelTestBean.java
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/TogglePanelTest.java
Log:
TogglePanel test fixed and refactored
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/RichPanelTestBean.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/RichPanelTestBean.java 2009-01-19 18:21:17 UTC (rev 12341)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/RichPanelTestBean.java 2009-01-19 18:59:33 UTC (rev 12342)
@@ -24,11 +24,6 @@
import java.util.HashMap;
import java.util.Map;
-import javax.faces.application.FacesMessage;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.convert.Converter;
-import javax.faces.convert.ConverterException;
import javax.faces.event.ActionEvent;
public class RichPanelTestBean {
@@ -43,7 +38,7 @@
private String itemAction;
private boolean rendered;
-
+
private boolean immediate;
private String content;
@@ -51,7 +46,7 @@
private String switchType = "server";
private String selectedTab = "tab1";
-
+
private boolean disabled;
private Map<String, String> inputs = new HashMap<String, String>();
@@ -206,16 +201,16 @@
public void itemActionNone() {
setItemAction("NOT none");
}
-
+
public String initImmediateTest() {
- reset();
+ reset();
setImmediate(true);
return null;
}
-
+
public String initAjaxSingleTest() {
- reset();
- inputs = new HashMap<String, String>();
+ reset();
+ inputs = new HashMap<String, String>();
return null;
}
@@ -227,6 +222,16 @@
return null;
}
+ public String action1() {
+ this.value2 = 1;
+ return null;
+ }
+
+ public String action2() {
+ this.value2 = 2;
+ return null;
+ }
+
public void hide() {
rendered = false;
}
@@ -269,7 +274,7 @@
/**
* @param selectedTab
- * the selectedTab to set
+ * the selectedTab to set
*/
public void setSelectedTab(String selectedTab) {
this.selectedTab = selectedTab;
@@ -284,40 +289,40 @@
/**
* @param inputs
- * the inputs to set
+ * the inputs to set
*/
public void setInputs(Map<String, String> inputs) {
this.inputs = inputs;
}
- /**
- * @return the immediate
- */
- public boolean isImmediate() {
- return immediate;
- }
+ /**
+ * @return the immediate
+ */
+ public boolean isImmediate() {
+ return immediate;
+ }
- /**
- * @param immediate the immediate to set
- */
- public void setImmediate(boolean immediate) {
- this.immediate = immediate;
- }
+ /**
+ * @param immediate
+ * the immediate to set
+ */
+ public void setImmediate(boolean immediate) {
+ this.immediate = immediate;
+ }
- /**
- * @return the disabled
- */
- public boolean isDisabled() {
- return disabled;
- }
+ /**
+ * @return the disabled
+ */
+ public boolean isDisabled() {
+ return disabled;
+ }
- /**
- * @param disabled the disabled to set
- */
- public void setDisabled(boolean disabled) {
- this.disabled = disabled;
- }
-
+ /**
+ * @param disabled
+ * the disabled to set
+ */
+ public void setDisabled(boolean disabled) {
+ this.disabled = disabled;
+ }
-
}
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2009-01-19 18:21:17 UTC (rev 12341)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2009-01-19 18:59:33 UTC (rev 12342)
@@ -629,6 +629,17 @@
}
/**
+ * Asserts DOM node is present and visible
+ *
+ * @param id -
+ * DOM element id
+ */
+ public void AssertPresentAndVisible(String id, String message) {
+ AssertPresent(id, message);
+ AssertVisible(id, message);
+ }
+
+ /**
* Asserts DOM node is not present
*
* @param id -
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/TogglePanelTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/TogglePanelTest.java 2009-01-19 18:21:17 UTC (rev 12341)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/TogglePanelTest.java 2009-01-19 18:59:33 UTC (rev 12342)
@@ -22,17 +22,17 @@
import org.ajax4jsf.template.Template;
import org.richfaces.SeleniumTestBase;
-import org.testng.Assert;
import org.testng.annotations.Test;
-import com.thoughtworks.selenium.SeleniumException;
-
public class TogglePanelTest extends SeleniumTestBase {
+ private static final String RESET_METHOD = "#{panelBean.cleanValues}";
+
@Test
public void testTogglePanelComponentAjaxMode(Template template) {
- renderPage(template);
+ renderPage(template, RESET_METHOD);
+ //FIXME: https://jira.jboss.org/jira/browse/RF-5828
String parentId = getParentId() + "_form:";
String inputId = parentId + "_value";
@@ -45,51 +45,34 @@
String oneFacet = parentId + "ajax_state_one";
String twoFacet = parentId + "ajax_state_two";
- reset();
-
+ writeStatus("Check ajax mode");
writeStatus("Click on ajax controlNext");
clickAjaxCommandAndWait(controlNext);
- // pause(6000, "panel_ajax");
AssertValueEquals(inputId, "ajax_next");
AssertTextEquals(outputId, "1");
- Assert.assertTrue(isVisibleById(twoFacet));
- try {
- getTextById(oneFacet);
- Assert.fail("Both of 'one' and 'two' states were rendered for ajax toggle panel.");
- } catch (SeleniumException se) {
+ AssertPresentAndVisible(twoFacet, "State 'one' has to give place to state 'two'");
+ AssertNotPresent(oneFacet, "Both of 'one' and 'two' states were rendered for ajax toggle panel.");
- }
-
writeStatus("Click on ajax controlOne");
- clickById(controlOne);
- waitForAjaxCompletion(5000);
+ clickAjaxCommandAndWait(controlOne);
AssertValueEquals(inputId, "ajax_one");
AssertTextEquals(outputId, "2");
- Assert.assertTrue(isVisibleById(oneFacet));
- try {
- getTextById(twoFacet);
- Assert.fail("Both of 'one' and 'two' states were rendered for ajax toggle panel.");
- } catch (SeleniumException se) {
+ AssertPresentAndVisible(oneFacet, "State 'two' has to give place to state 'one'");
+ AssertNotPresent(twoFacet, "Both of 'one' and 'two' states were rendered for ajax toggle panel.");
- }
-
writeStatus("Click on ajax controlTwo");
- clickById(controlTwo);
- waitForAjaxCompletion(5000);
+ clickAjaxCommandAndWait(controlTwo);
AssertValueEquals(inputId, "ajax_two");
AssertTextEquals(outputId, "1");
- Assert.assertTrue(isVisibleById(twoFacet));
- try {
- getTextById(oneFacet);
- Assert.fail("Both of 'one' and 'two' states were rendered for ajax toggle panel.");
- } catch (SeleniumException se) {
- }
+ AssertPresentAndVisible(twoFacet, "State 'one' has to give place to state 'two'");
+ AssertNotPresent(oneFacet, "Both of 'one' and 'two' states were rendered for ajax toggle panel.");
}
@Test
public void testTogglePanelComponentServerMode(Template template) {
- renderPage(template);
+ renderPage(template, RESET_METHOD);
+ //FIXME: https://jira.jboss.org/jira/browse/RF-5828
String parentId = getParentId() + "_form:";
String inputId = parentId + "_value";
@@ -98,80 +81,64 @@
String controlNext = parentId + "server_next";
String controlOne = parentId + "server_one";
String controlTwo = parentId + "server_two";
+
String oneFacet = parentId + "server_state_one";
String twoFacet = parentId + "server_state_two";
- reset();
-
+ writeStatus("Check server mode");
writeStatus("Click on controlNext");
clickCommandAndWait(controlNext);
AssertValueEquals(inputId, "server_next");
AssertTextEquals(outputId, "1");
- Assert.assertTrue(isVisibleById(twoFacet));
- try {
- getTextById(oneFacet);
- Assert.fail("Both of 'one' and 'two' states were rendered for server toggle panel.");
- } catch (SeleniumException se) {
+ AssertPresentAndVisible(twoFacet, "State 'one' has to give place to state 'two'");
+ AssertNotPresent(oneFacet, "Both of 'one' and 'two' states were rendered for server toggle panel.");
- }
-
writeStatus("Click on server controlOne");
clickCommandAndWait(controlOne);
AssertValueEquals(inputId, "server_one");
AssertTextEquals(outputId, "2");
- Assert.assertTrue(isVisibleById(oneFacet));
- try {
- getTextById(twoFacet);
- Assert.fail("Both of 'one' and 'two' states were rendered for server toggle panel.");
- } catch (SeleniumException se) {
+ AssertPresentAndVisible(oneFacet, "State 'two' has to give place to state 'one'");
+ AssertNotPresent(twoFacet, "Both of 'one' and 'two' states were rendered for server toggle panel.");
- }
-
writeStatus("Click on server controlTwo");
clickCommandAndWait(controlTwo);
AssertValueEquals(inputId, "server_two");
AssertTextEquals(outputId, "3");
- Assert.assertTrue(isVisibleById(twoFacet));
- try {
- getTextById(oneFacet);
- Assert.fail("Both of 'one' and 'two' states were rendered for server toggle panel.");
- } catch (SeleniumException se) {
- }
+ AssertPresentAndVisible(twoFacet, "State 'one' has to give place to state 'two'");
+ AssertNotPresent(oneFacet, "Both of 'one' and 'two' states were rendered for server toggle panel.");
}
@Test
public void testTogglePanelComponentClientMode(Template template) {
- renderPage(template);
+ renderPage(template, RESET_METHOD);
String parentId = getParentId() + "_form:";
String controlNext = parentId + "client_next";
String controlOne = parentId + "client_one";
String controlTwo = parentId + "client_two";
+
String oneFacet = parentId + "client_state_one";
String twoFacet = parentId + "client_state_two";
+ writeStatus("Check client mode");
writeStatus("Click on client controlNext");
clickById(controlNext);
- Assert.assertTrue(isVisibleById(twoFacet));
- Assert.assertFalse(isVisibleById(oneFacet));
+ AssertVisible(twoFacet, "State 'one' has to give place to state 'two'");
+ AssertNotVisible(oneFacet, "Both of 'one' and 'two' states were rendered for client toggle panel.");
writeStatus("Click on client controlOne");
clickById(controlOne);
- Assert.assertTrue(isVisibleById(oneFacet));
- Assert.assertFalse(isVisibleById(twoFacet));
+ AssertVisible(oneFacet, "State 'two' has to give place to state 'one'");
+ AssertNotVisible(twoFacet, "Both of 'one' and 'two' states were rendered for client toggle panel.");
writeStatus("Click on client controlTwo");
clickById(controlTwo);
- Assert.assertTrue(isVisibleById(twoFacet));
- Assert.assertFalse(isVisibleById(oneFacet));
+ AssertVisible(twoFacet, "State 'one' has to give place to state 'two'");
+ AssertNotVisible(oneFacet, "Both of 'one' and 'two' states were rendered for client toggle panel.");
}
- private void reset() {
- writeStatus("Clean bean values");
- clickAjaxCommandAndWait(getParentId() + "_form:clean");
- }
-
+ @Override
public String getTestUrl() {
return "pages/togglePanel/togglePanelTest.xhtml";
}
16 years