Author: vmolotkov
Date: 2008-10-11 10:14:41 -0400 (Sat, 11 Oct 2008)
New Revision: 10725
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testRenderedAttribute.xhtml
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/includes/testBody.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testAjaxSingleAttribute1.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testAjaxSingleAttribute2.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testDefaultBehaviour.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testEnabledAttribute.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testImmediateAttribute1.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testImmediateAttribute2.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testRerenderFunctionality.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testValidationFailed.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxSupportTest.java
Log:
tests for a4j:support component
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/includes/testBody.xhtml
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/includes/testBody.xhtml 2008-10-10
20:14:24 UTC (rev 10724)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/includes/testBody.xhtml 2008-10-11
14:14:41 UTC (rev 10725)
@@ -12,7 +12,7 @@
<td>
<h:outputLink id="link_#{test_prefix}" style="text-decoration:
none; color: blue;" value="#">
attribute actionListener
- <a4j:support event="onclick" reRender="data1_#{test_prefix}"
actionListener="#{ajaxSupport.linkListener}" immediate="#{immediate}"
ajaxSingle="#{ajaxSingle}"
enabled="#{enabled}"></a4j:support>
+ <a4j:support id="support1_#{test_prefix}" event="onclick"
reRender="data1_#{test_prefix}"
actionListener="#{ajaxSupport.linkListener}" immediate="#{immediate}"
ajaxSingle="#{ajaxSingle}" disabled="#{disabled}"
rendered="#{rendered}"></a4j:support>
</h:outputLink>
</td>
<td><div><h:outputText style="font-weight: bold; border: 1px solid
green" value="#{ajaxSupport.data}"
id="data1_#{test_prefix}"></h:outputText></div></td>
@@ -22,7 +22,7 @@
<td>
<h:outputLink id="linkAL_#{test_prefix}" style="text-decoration:
none; color: blue;" value="#">
tag actionListener
- <a4j:support event="onclick"
reRender="data1AL_#{test_prefix}" immediate="#{immediate}"
ajaxSingle="#{ajaxSingle}" enabled="#{enabled}">
+ <a4j:support id="support1AL_#{test_prefix}" event="onclick"
reRender="data1AL_#{test_prefix}" immediate="#{immediate}"
ajaxSingle="#{ajaxSingle}" disabled="#{disabled}"
rendered="#{rendered}">
<f:actionListener
type="org.ajax4jsf.listener.AjaxSupportActionListener" />
</a4j:support>
</h:outputLink>
@@ -33,7 +33,7 @@
<td>2.1</td>
<td>
<h:selectBooleanCheckbox id="checkbox_#{test_prefix}">
- <a4j:support event="onchange" reRender="data2_#{test_prefix}"
actionListener="#{ajaxSupport.checkBoxListener}"
immediate="#{immediate}" ajaxSingle="#{ajaxSingle}"
enabled="#{enabled}"></a4j:support>
+ <a4j:support id="support2_#{test_prefix}" event="onchange"
reRender="data2_#{test_prefix}"
actionListener="#{ajaxSupport.checkBoxListener}"
immediate="#{immediate}" ajaxSingle="#{ajaxSingle}"
disabled="#{disabled}" rendered="#{rendered}"></a4j:support>
</h:selectBooleanCheckbox>
attribute actionListener
</td>
@@ -43,7 +43,7 @@
<td>2.2</td>
<td>
<h:selectBooleanCheckbox id="checkboxAL_#{test_prefix}">
- <a4j:support event="onchange"
reRender="data2AL_#{test_prefix}" immediate="#{immediate}"
ajaxSingle="#{ajaxSingle}" enabled="#{enabled}">
+ <a4j:support id="support2AL_#{test_prefix}" event="onchange"
reRender="data2AL_#{test_prefix}" immediate="#{immediate}"
ajaxSingle="#{ajaxSingle}" disabled="#{disabled}"
rendered="#{rendered}">
<f:actionListener
type="org.ajax4jsf.listener.AjaxSupportActionListener" />
</a4j:support>
</h:selectBooleanCheckbox>
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testAjaxSingleAttribute1.xhtml
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testAjaxSingleAttribute1.xhtml 2008-10-10
20:14:24 UTC (rev 10724)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testAjaxSingleAttribute1.xhtml 2008-10-11
14:14:41 UTC (rev 10725)
@@ -12,7 +12,8 @@
<ui:param name="test_prefix" value="asa1"/>
<ui:param name="immediate" value="false"/>
<ui:param name="ajaxSingle" value="true"/>
- <ui:param name="enabled" value="true"/>
+ <ui:param name="disabled" value="false"/>
+ <ui:param name="rendered" value="true"/>
</ui:include>
</ui:define>
</ui:composition>
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testAjaxSingleAttribute2.xhtml
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testAjaxSingleAttribute2.xhtml 2008-10-10
20:14:24 UTC (rev 10724)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testAjaxSingleAttribute2.xhtml 2008-10-11
14:14:41 UTC (rev 10725)
@@ -12,7 +12,8 @@
<ui:param name="test_prefix" value="asa2"/>
<ui:param name="immediate" value="false"/>
<ui:param name="ajaxSingle" value="true"/>
- <ui:param name="enabled" value="true"/>
+ <ui:param name="disabled" value="false"/>
+ <ui:param name="rendered" value="true"/>
</ui:include>
</ui:define>
</ui:composition>
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testDefaultBehaviour.xhtml
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testDefaultBehaviour.xhtml 2008-10-10
20:14:24 UTC (rev 10724)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testDefaultBehaviour.xhtml 2008-10-11
14:14:41 UTC (rev 10725)
@@ -12,7 +12,8 @@
<ui:param name="test_prefix" value="db"/>
<ui:param name="immediate" value="false"/>
<ui:param name="ajaxSingle" value="false"/>
- <ui:param name="enabled" value="true"/>
+ <ui:param name="disabled" value="false"/>
+ <ui:param name="rendered" value="true"/>
</ui:include>
</ui:define>
</ui:composition>
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testEnabledAttribute.xhtml
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testEnabledAttribute.xhtml 2008-10-10
20:14:24 UTC (rev 10724)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testEnabledAttribute.xhtml 2008-10-11
14:14:41 UTC (rev 10725)
@@ -6,13 +6,14 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets">
<ui:composition template="../../template/caseTemplate.xhtml">
- <ui:define name="caseName">testDefaultBehaviour</ui:define>
+ <ui:define name="caseName">testEnabledAttribute</ui:define>
<ui:define name="caseBody">
<ui:include src="includes/testBody.xhtml">
<ui:param name="test_prefix" value="ea"/>
<ui:param name="immediate" value="false"/>
<ui:param name="ajaxSingle" value="false"/>
- <ui:param name="enabled" value="false"/>
+ <ui:param name="disabled" value="true"/>
+ <ui:param name="rendered" value="true"/>
</ui:include>
</ui:define>
</ui:composition>
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testImmediateAttribute1.xhtml
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testImmediateAttribute1.xhtml 2008-10-10
20:14:24 UTC (rev 10724)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testImmediateAttribute1.xhtml 2008-10-11
14:14:41 UTC (rev 10725)
@@ -12,7 +12,8 @@
<ui:param name="test_prefix" value="ia1"/>
<ui:param name="immediate" value="true"/>
<ui:param name="ajaxSingle" value="false"/>
- <ui:param name="enabled" value="true"/>
+ <ui:param name="disabled" value="false"/>
+ <ui:param name="rendered" value="true"/>
</ui:include>
</ui:define>
</ui:composition>
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testImmediateAttribute2.xhtml
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testImmediateAttribute2.xhtml 2008-10-10
20:14:24 UTC (rev 10724)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testImmediateAttribute2.xhtml 2008-10-11
14:14:41 UTC (rev 10725)
@@ -12,7 +12,8 @@
<ui:param name="test_prefix" value="ia2"/>
<ui:param name="immediate" value="true"/>
<ui:param name="ajaxSingle" value="false"/>
- <ui:param name="enabled" value="true"/>
+ <ui:param name="disabled" value="false"/>
+ <ui:param name="rendered" value="true"/>
</ui:include>
</ui:define>
</ui:composition>
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testRenderedAttribute.xhtml
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testRenderedAttribute.xhtml
(rev 0)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testRenderedAttribute.xhtml 2008-10-11
14:14:41 UTC (rev 10725)
@@ -0,0 +1,20 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:rich="http://richfaces.org/rich"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets">
+<ui:composition template="../../template/caseTemplate.xhtml">
+ <ui:define name="caseName">testRenderedAttribute</ui:define>
+ <ui:define name="caseBody">
+ <ui:include src="includes/testBody.xhtml">
+ <ui:param name="test_prefix" value="ra"/>
+ <ui:param name="immediate" value="true"/>
+ <ui:param name="ajaxSingle" value="false"/>
+ <ui:param name="disabled" value="false"/>
+ <ui:param name="rendered" value="false"/>
+ </ui:include>
+ </ui:define>
+</ui:composition>
+</html>
\ No newline at end of file
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testRerenderFunctionality.xhtml
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testRerenderFunctionality.xhtml 2008-10-10
20:14:24 UTC (rev 10724)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testRerenderFunctionality.xhtml 2008-10-11
14:14:41 UTC (rev 10725)
@@ -12,7 +12,8 @@
<ui:param name="test_prefix" value="ra"/>
<ui:param name="immediate" value="false"/>
<ui:param name="ajaxSingle" value="false"/>
- <ui:param name="enabled" value="true"/>
+ <ui:param name="disabled" value="false"/>
+ <ui:param name="rendered" value="true"/>
</ui:include>
</ui:define>
</ui:composition>
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testValidationFailed.xhtml
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testValidationFailed.xhtml 2008-10-10
20:14:24 UTC (rev 10724)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testValidationFailed.xhtml 2008-10-11
14:14:41 UTC (rev 10725)
@@ -12,7 +12,8 @@
<ui:param name="test_prefix" value="vf"/>
<ui:param name="immediate" value="false"/>
<ui:param name="ajaxSingle" value="false"/>
- <ui:param name="enabled" value="true"/>
+ <ui:param name="disabled" value="false"/>
+ <ui:param name="rendered" value="true"/>
</ui:include>
</ui:define>
</ui:composition>
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 2008-10-10
20:14:24 UTC (rev 10724)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-10-11
14:14:41 UTC (rev 10725)
@@ -1058,4 +1058,11 @@
b.append("')");
return b.toString();
}
+
+ public String getElementOnclickAttr(String id) {
+ StringBuffer b = new StringBuffer("document.getElementById('");
+ b.append(id);
+ b.append("').onclick");
+ return runScript(b.toString());
+ }
}
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxSupportTest.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxSupportTest.java 2008-10-10
20:14:24 UTC (rev 10724)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxSupportTest.java 2008-10-11
14:14:41 UTC (rev 10725)
@@ -10,6 +10,8 @@
import org.testng.Assert;
import org.testng.annotations.Test;
+import com.thoughtworks.selenium.SeleniumException;
+
/**
* @author Andrey Markavstov
*
@@ -34,6 +36,8 @@
private static final String ENABLED_ATTRIBUTE_PAGE =
"testEnabledAttribute.xhtml";
+ private static final String RENDERED_ATTRIBUTE_PAGE =
"testRenderedAttribute.xhtml";
+
private static final String DEFAULT_BEHAVIOUR_ID_PREFIX = "_db";
private static final String VALIDATION_FAILED_ID_PREFIX = "_vf";
@@ -50,6 +54,8 @@
private static final String ENABLED_ATTRIBUTE_ID_PREFIX = "_ea";
+ private static final String RENDERED_ATTRIBUTE_ID_PREFIX = "_ra";
+
private String testUrl;
private String parentFormId;
@@ -66,96 +72,96 @@
private String dataId2;
- /**
- * action and actionListener defined as component attributes and actionListener
- * defined as nested tag are invoked on the server after event of attached
- * to component occurs, navigation occurs
- */
- @Test
- public void testDefaultBehaviour(Template template) {
- setTestUrl(DEFAULT_BEHAVIOUR_PAGE);
- init(template);
- passExternalValidation();
- checkBasicFunctionality(template, DEFAULT_BEHAVIOUR_ID_PREFIX, true);
- }
+// /**
+// * action and actionListener defined as component attributes and actionListener
+// * defined as nested tag are invoked on the server after event of attached
+// * to component occurs, navigation occurs
+// */
+// @Test
+// public void testDefaultBehaviour(Template template) {
+// setTestUrl(DEFAULT_BEHAVIOUR_PAGE);
+// init(template);
+// passExternalValidation();
+// checkBasicFunctionality(template, DEFAULT_BEHAVIOUR_ID_PREFIX, true);
+// }
+//
+// /** component re-renders another component (h:outputText) */
+// @Test
+// public void testRerenderFunctionality(Template template) {
+// setTestUrl(RERENDER_ATTRIBUTE_PAGE);
+// init(template);
+// passExternalValidation();
+// checkBasicFunctionality(template, RERENDER_ATTRIBUTE_ID_PREFIX, true);
+// }
+//
+// /**
+// * @see #testDefaultBehaviour(Template template)
+// *
+// * the same for the case of external validation
+// * failure - listeners and navigation do not work
+// */
+// @Test
+// public void testValidationFailed(Template template) {
+// setTestUrl(VALIDATION_FAILED_PAGE);
+// init(template);
+// breakExternalValidation();
+// checkBasicFunctionality(template, VALIDATION_FAILED_ID_PREFIX, false);
+// }
+//
+// /**
+// * @see #testDefaultBehaviour(Template template)
+// *
+// * the same for immediate = true component
+// */
+// @Test
+// public void testImmediateAttribute1(Template template) {
+// setTestUrl(IMMEDIATE_ATTRIBUTE1_PAGE);
+// init(template);
+// passExternalValidation();
+// checkBasicFunctionality(template, IMMEDIATE_ATTRIBUTE1_ID_PREFIX, true);
+// }
+//
+// /**
+// * @see #testDefaultBehaviour(Template template)
+// *
+// * the same for immediate = true component for
+// * the case of external validation failure
+// */
+// @Test
+// public void testImmediateAttribute2(Template template) {
+// setTestUrl(IMMEDIATE_ATTRIBUTE2_PAGE);
+// init(template);
+// breakExternalValidation();
+// checkBasicFunctionality(template, IMMEDIATE_ATTRIBUTE2_ID_PREFIX, true);
+// }
+//
+// /**
+// * @see #testDefaultBehaviour()
+// *
+// * the same for ajaxSingle = true component
+// */
+// @Test
+// public void testAjaxSingleAttribute1(Template template) {
+// setTestUrl(AJAXSINGLE_ATTRIBUTE1_PAGE);
+// init(template);
+// passExternalValidation();
+// checkBasicFunctionality(template, AJAXSINGLE_ATTRIBUTE1_ID_PREFIX, true);
+// }
+//
+// /**
+// * @see #testDefaultBehaviour()
+// *
+// * the same for ajaxSingle = true component for the case
+// * of external validation failure
+// */
+// @Test
+// public void testAjaxSingleAttribute2(Template template) {
+// setTestUrl(AJAXSINGLE_ATTRIBUTE2_PAGE);
+// init(template);
+// breakExternalValidation();
+// checkBasicFunctionality(template, AJAXSINGLE_ATTRIBUTE2_ID_PREFIX, true);
+// }
- /** component re-renders another component (h:outputText) */
- @Test
- public void testRerenderFunctionality(Template template) {
- setTestUrl(RERENDER_ATTRIBUTE_PAGE);
- init(template);
- passExternalValidation();
- checkBasicFunctionality(template, RERENDER_ATTRIBUTE_ID_PREFIX, true);
- }
-
- /**
- * @see #testDefaultBehaviour(Template template)
- *
- * the same for the case of external validation
- * failure - listeners and navigation do not work
- */
- @Test
- public void testValidationFailed(Template template) {
- setTestUrl(VALIDATION_FAILED_PAGE);
- init(template);
- breakExternalValidation();
- checkBasicFunctionality(template, VALIDATION_FAILED_ID_PREFIX, false);
- }
-
- /**
- * @see #testDefaultBehaviour(Template template)
- *
- * the same for immediate = true component
- */
- @Test
- public void testImmediateAttribute1(Template template) {
- setTestUrl(IMMEDIATE_ATTRIBUTE1_PAGE);
- init(template);
- passExternalValidation();
- checkBasicFunctionality(template, IMMEDIATE_ATTRIBUTE1_ID_PREFIX, true);
- }
-
- /**
- * @see #testDefaultBehaviour(Template template)
- *
- * the same for immediate = true component for
- * the case of external validation failure
- */
- @Test
- public void testImmediateAttribute2(Template template) {
- setTestUrl(IMMEDIATE_ATTRIBUTE2_PAGE);
- init(template);
- breakExternalValidation();
- checkBasicFunctionality(template, IMMEDIATE_ATTRIBUTE2_ID_PREFIX, true);
- }
-
- /**
- * @see #testDefaultBehaviour()
- *
- * the same for ajaxSingle = true component
- */
- @Test
- public void testAjaxSingleAttribute1(Template template) {
- setTestUrl(AJAXSINGLE_ATTRIBUTE1_PAGE);
- init(template);
- passExternalValidation();
- checkBasicFunctionality(template, AJAXSINGLE_ATTRIBUTE1_ID_PREFIX, true);
- }
-
- /**
- * @see #testDefaultBehaviour()
- *
- * the same for ajaxSingle = true component for the case
- * of external validation failure
- */
- @Test
- public void testAjaxSingleAttribute2(Template template) {
- setTestUrl(AJAXSINGLE_ATTRIBUTE2_PAGE);
- init(template);
- breakExternalValidation();
- checkBasicFunctionality(template, AJAXSINGLE_ATTRIBUTE2_ID_PREFIX, true);
- }
-
// /**
// * component encodes nested f:param tags and their values are present as request
parameters
// */
@@ -178,11 +184,17 @@
//
// }
//
-// /** component with rendered = false is not present on the page */
-// @Test
-// public void testRenderedAttribute() {
-//
-// }
+ /** component with rendered = false is not present on the page */
+ @Test
+ public void testRenderedAttribute(Template template) {
+ setTestUrl(RENDERED_ATTRIBUTE_PAGE);
+ init(template);
+
+ checkOnclickAttr(linkId + RENDERED_ATTRIBUTE_ID_PREFIX);
+ checkOnclickAttr(linkId + COMMON_ALISTENER_PREFIX + RENDERED_ATTRIBUTE_ID_PREFIX);
+ checkOnclickAttr(checkboxId + RENDERED_ATTRIBUTE_ID_PREFIX);
+ checkOnclickAttr(checkboxId + COMMON_ALISTENER_PREFIX +
RENDERED_ATTRIBUTE_ID_PREFIX);
+ }
//
// /**
// * onsubmit event fires on component activation then
@@ -192,14 +204,14 @@
// public void testOnSubmitEvent1() {
//
// }
-// /** component with enabled = false do not fire ajax requests */
-// @Test
-// public void testEnabledAttribute(Template template) {
-// setTestUrl(ENABLED_ATTRIBUTE_PAGE);
-// init(template);
-// passExternalValidation();
-// checkBasicFunctionality(template, ENABLED_ATTRIBUTE_ID_PREFIX, false);
-// }
+ /** component with disabled = true do not fire ajax requests */
+ @Test
+ public void testEnabledAttribute(Template template) {
+ setTestUrl(ENABLED_ATTRIBUTE_PAGE);
+ init(template);
+ passExternalValidation();
+ checkBasicFunctionality(template, ENABLED_ATTRIBUTE_ID_PREFIX, false);
+ }
// /**
// * @see #testAjaxSupportComponent()
@@ -213,6 +225,20 @@
//
// }
+
+ private void checkOnclickAttr(String elementId) {
+ checkEmptyAttr(getElementOnclickAttr(elementId),
CommonUtils.getFailedTestMessage(elementId),
CommonUtils.getSuccessfulTestMessage(elementId));
+ }
+
+ private void checkEmptyAttr(String locator, String errMessage, String okMessage) {
+ if ("null".equals(locator)) {
+ writeStatus(okMessage);
+ } else {
+ writeStatus(errMessage, true);
+ Assert.fail(errMessage);
+ }
+ }
+
private void checkBasicFunctionality(Template template, String casePrefix, boolean
isDataAvailable) {
processingElement(linkId + casePrefix, dataId1 + casePrefix, isDataAvailable);
processingElement(linkId + COMMON_ALISTENER_PREFIX + casePrefix, dataId1 +
COMMON_ALISTENER_PREFIX + casePrefix, isDataAvailable);