Author: konstantin.mishin
Date: 2009-02-27 09:11:31 -0500 (Fri, 27 Feb 2009)
New Revision: 12770
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/insert/
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/insert/insertAutoTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/insert/src.txt
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InsertTest.java
Log:
RF-6309
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/insert/insertAutoTest.xhtml
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/insert/insertAutoTest.xhtml
(rev 0)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/insert/insertAutoTest.xhtml 2009-02-27
14:11:31 UTC (rev 12770)
@@ -0,0 +1,14 @@
+<!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:rich="http://richfaces.org/rich"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets">
+
+<ui:composition template="#{templateBean.autoTestTemplate}">
+ <ui:define name="component">
+ <rich:insert id="componentId" src="/pages/insert/src.txt"
rendered="#{autoTestBean.rendered}" />
+ </ui:define>
+</ui:composition>
+</html>
\ No newline at end of file
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/insert/src.txt
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/insert/src.txt
(rev 0)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/insert/src.txt 2009-02-27
14:11:31 UTC (rev 12770)
@@ -0,0 +1 @@
+some text
\ No newline at end of file
Added:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InsertTest.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InsertTest.java
(rev 0)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InsertTest.java 2009-02-27
14:11:31 UTC (rev 12770)
@@ -0,0 +1,40 @@
+package org.richfaces.testng;
+
+import org.ajax4jsf.template.Template;
+import org.richfaces.AutoTester;
+import org.richfaces.SeleniumTestBase;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+public class InsertTest extends SeleniumTestBase {
+
+ /**
+ * component is present on the page and value is output
+ */
+ @Test
+ public void testContent(Template template) {
+ AutoTester autoTester = getAutoTester(this);
+ autoTester.renderPage(template, null);
+ Assert.assertEquals(selenium.getText("id=" +
autoTester.getClientId(AutoTester.COMPONENT_ID)), "some text");
+ }
+
+ /**
+ * component with rendered = false is not present on the page
+ */
+ @Test
+ public void testRendered(Template template) {
+ AutoTester autoTester = getAutoTester(this);
+ autoTester.renderPage(template, null);
+ autoTester.testRendered();
+ }
+
+ @Override
+ public String getTestUrl() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public String getAutoTestUrl() {
+ return "pages/insert/insertAutoTest.xhtml";
+ }
+}