Author: konstantin.mishin
Date: 2009-03-04 07:49:02 -0500 (Wed, 04 Mar 2009)
New Revision: 12821
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/A4JOutputPanelTestBean.java
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxOutputPanel/ajaxOutputPanelTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxOutputPanelTest.java
Log:
RF-6197
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/A4JOutputPanelTestBean.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/A4JOutputPanelTestBean.java 2009-03-04
11:21:30 UTC (rev 12820)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/A4JOutputPanelTestBean.java 2009-03-04
12:49:02 UTC (rev 12821)
@@ -29,13 +29,20 @@
private String layout;
+ private Boolean ajaxRendered;
+
private String outputText;
public void init() {
layout = "inline";
+ ajaxRendered = false;
outputText = "text";
}
+ public void submit() {
+ outputText = "changed";
+ }
+
public void setOutputText(String outputText) {
this.outputText = outputText;
}
@@ -51,4 +58,12 @@
public String getLayout() {
return layout;
}
+
+ public void setAjaxRendered(Boolean ajaxRendered) {
+ this.ajaxRendered = ajaxRendered;
+ }
+
+ public Boolean getAjaxRendered() {
+ return ajaxRendered;
+ }
}
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxOutputPanel/ajaxOutputPanelTest.xhtml
===================================================================
(Binary files differ)
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxOutputPanelTest.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxOutputPanelTest.java 2009-03-04
11:21:30 UTC (rev 12820)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxOutputPanelTest.java 2009-03-04
12:49:02 UTC (rev 12821)
@@ -35,19 +35,28 @@
private String layout;
+ private String ajaxRendered;
+
+ private String reset;
+
private String mainForm;
private String outputPanel;
private String outputText;
+ private String submit;
+
private void init(Template template) {
renderPage(null, template, "#{a4jOutputPanelBean.init}");
String attrForm = getParentId() + "attrForm";
layout = attrForm + ":layout";
+ ajaxRendered = attrForm + ":ajaxRendered";
+ reset = attrForm + ":reset";
mainForm = getParentId() + "mainForm";
outputPanel = mainForm + ":outputPanel";
outputText = mainForm + ":outputText";
+ submit = mainForm + ":submit";
}
/**
@@ -60,7 +69,23 @@
Assert.assertTrue(selenium.isElementPresent(outputText));
}
+ /**
+ * component with ajaxRendered = true is updated on each request
+ */
@Test
+ public void testAjaxRendered(Template template) {
+ init(template);
+ Assert.assertEquals(selenium.getText(outputText), "text");
+ clickAjaxCommandAndWait(submit);
+ Assert.assertEquals(selenium.getText(outputText), "text");
+ clickAjaxCommandAndWait(reset);
+ clickAjaxCommandAndWait(ajaxRendered);
+ Assert.assertEquals(selenium.getText(outputText), "text");
+ clickAjaxCommandAndWait(submit);
+ Assert.assertEquals(selenium.getText(outputText), "changed");
+ }
+
+ @Test
public void testLayoutAttribute(Template template) {
init(template);
Assert.assertEquals(selenium.getAttribute("xpath=id('" + mainForm +
"')/span/span/span@id"), outputText);