Author: dsvyatobatsko
Date: 2008-07-11 13:00:31 -0400 (Fri, 11 Jul 2008)
New Revision: 9550
Added:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/InplaceInputTestBean.java
trunk/test-applications/seleniumTest/src/main/webapp/pages/inplaceInput/
trunk/test-applications/seleniumTest/src/main/webapp/pages/inplaceInput/inplaceInputTest.xhtml
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InplaceInputTest.java
Modified:
trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml
Log:
InplaceInput component test added
Added:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/InplaceInputTestBean.java
===================================================================
---
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/InplaceInputTestBean.java
(rev 0)
+++
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/InplaceInputTestBean.java 2008-07-11
17:00:31 UTC (rev 9550)
@@ -0,0 +1,24 @@
+package org.ajax4jsf.bean;
+
+public class InplaceInputTestBean {
+
+ private String text ="";
+
+ /**
+ * Gets value of text field.
+ * @return value of text field
+ */
+ public String getText() {
+ return text;
+ }
+
+ /**
+ * Set a new value for text field.
+ * @param text a new value for text field
+ */
+ public void setText(String text) {
+ this.text = text;
+ }
+
+
+}
Property changes on:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/InplaceInputTestBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified: trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
---
trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml 2008-07-11
16:54:10 UTC (rev 9549)
+++
trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml 2008-07-11
17:00:31 UTC (rev 9550)
@@ -190,12 +190,17 @@
<managed-bean-name>loadBundleBean</managed-bean-name>
<managed-bean-class>org.ajax4jsf.bean.LoadBundleTestBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
- </managed-bean>
+ </managed-bean>
<managed-bean>
<managed-bean-name>listShuttle</managed-bean-name>
<managed-bean-class>org.ajax4jsf.bean.ListShuttleBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
+ <managed-bean>
+ <managed-bean-name>inplaceInputBean</managed-bean-name>
+ <managed-bean-class>org.ajax4jsf.bean.InplaceInputTestBean</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ </managed-bean>
<navigation-rule>
<from-view-id>/pages/ajaxInclude/step1.xhtml</from-view-id>
<navigation-case>
Added:
trunk/test-applications/seleniumTest/src/main/webapp/pages/inplaceInput/inplaceInputTest.xhtml
===================================================================
(Binary files differ)
Property changes on:
trunk/test-applications/seleniumTest/src/main/webapp/pages/inplaceInput/inplaceInputTest.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InplaceInputTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InplaceInputTest.java
(rev 0)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InplaceInputTest.java 2008-07-11
17:00:31 UTC (rev 9550)
@@ -0,0 +1,104 @@
+package org.richfaces.testng;
+
+import org.ajax4jsf.template.Template;
+import org.richfaces.SeleniumTestBase;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+public class InplaceInputTest extends SeleniumTestBase {
+
+ private static final String INPLACE_INPUT_SIMPLE = "inplaceInput";
+
+ private static final String INPLACE_INPUT_DECORATED =
"inplaceInputDecorated";
+
+ private static final String INPLACE_INPUT_DECORATED_OK =
"inplaceInputDecoratedok";
+
+ private static final String INPLACE_INPUT_FIELD_POSTFIX =
"inplaceTmpValue";
+
+ private final static String EVENT_TEST_RESULT_FAILED_TEXT = "No";
+
+ private final static String EVENT_TEST_RESULT_PASSED_TEXT = "Passed";
+
+ @Test
+ public void testInplaceInputComponentLayout(Template template) {
+ renderPage(template);
+ writeStatus("Check component layout");
+
+ String inplaceInputS = getParentId() + "_form:" +
INPLACE_INPUT_SIMPLE;
+ String inplaceInputD = getParentId() + "_form:" +
INPLACE_INPUT_DECORATED;
+
+ Assert.assertTrue(isPresentById(inplaceInputS));
+ int count = selenium.getXpathCount("//*[@id='" + inplaceInputS +
"' and (name()='span' or name()='SPAN')]").intValue();
+ Assert.assertTrue(count == 1, "InplaceInput[" + inplaceInputS + "]
has layout=inline(default) and should be rendered as 'span' element");
+
+ Assert.assertTrue(isPresentById(inplaceInputD));
+ count = selenium.getXpathCount("//*[@id='" + inplaceInputD +
"' and (name()='DIV' or name()='div')]").intValue();
+ Assert.assertTrue(count == 1, "InplaceInput [" + inplaceInputD +
"] has layout=block and should be rendered as 'div' element");
+
+ }
+
+ @Test
+ public void testInplaceInputClientAPI(Template template) {
+ renderPage(template);
+ writeStatus("Check component client API");
+ }
+
+ @Test
+ public void testInplaceInputEvents(Template template) {
+ renderPage(template);
+
+ writeStatus("Check component event triggering");
+
+ String inplaceInputS = getParentId() + "_form:" +
INPLACE_INPUT_SIMPLE;
+ String inplaceInputD = getParentId() + "_form:" +
INPLACE_INPUT_DECORATED;
+ String inplaceInputDOk = getParentId() + "_form:" +
INPLACE_INPUT_DECORATED_OK;
+
+ writeStatus("Click first component being tested");
+
+ clickById(inplaceInputS);
+ AssertTextEquals(inplaceInputS + "_edit",
EVENT_TEST_RESULT_PASSED_TEXT, "oneditactivated event is not fired");
+
+ writeStatus("Stop editing first component being tested");
+
+ selenium.windowFocus();
+ AssertTextEquals(inplaceInputS + "_view",
EVENT_TEST_RESULT_PASSED_TEXT, "onviewactivated event is not fired");
+
+ writeStatus("Double-click second component being tested");
+
+ selenium.doubleClick(inplaceInputD);
+ AssertTextEquals(inplaceInputD + "_edit",
EVENT_TEST_RESULT_PASSED_TEXT, "oneditactivated event is not fired");
+
+ writeStatus("Stop editing second component being tested");
+
+ selenium.fireEvent(inplaceInputDOk, "mousedown");
+ AssertTextEquals(inplaceInputD + "_view",
EVENT_TEST_RESULT_PASSED_TEXT, "onviewactivated event is not fired");
+ }
+
+ @Test
+ public void testInplaceInputKeyAttributes(Template template) {
+ renderPage(template);
+
+ String inplaceInputS = getParentId() + "_form:" +
INPLACE_INPUT_SIMPLE;
+ String inplaceInputD = getParentId() + "_form:" +
INPLACE_INPUT_DECORATED;
+
+ String inplaceInputSInput = inplaceInputS + INPLACE_INPUT_FIELD_POSTFIX;
+ String inplaceInputDInput = inplaceInputD + INPLACE_INPUT_FIELD_POSTFIX;
+
+ writeStatus("Check component's key attributes");
+
+ writeStatus("test 'editEvent' attribute");
+
+ writeStatus("The first component must change your state by single clicking
only");
+ clickById(inplaceInputS);
+ AssertVisible(inplaceInputSInput);
+
+ writeStatus("The second component must change your state by double clicking
only");
+ selenium.doubleClick(inplaceInputD);
+ AssertVisible(inplaceInputDInput);
+ }
+
+ @Override
+ public String getTestUrl() {
+ return "pages/inplaceInput/inplaceInputTest.xhtml";
+ }
+}
Property changes on:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InplaceInputTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Show replies by date