Author: jjamrich
Date: 2011-11-08 11:14:18 -0500 (Tue, 08 Nov 2011)
New Revision: 22909
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichEditorBean.java
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/rich/RichEditorBean.properties
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor/EditorAttributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor/TestRichEditor.java
Log:
RFPL-1720: add default skin options + tests for rich:editor
In editor are some available skins (such as kama, richfaces, office2003). Add them into
Metamer as attribute value options, plus add ftests for them
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichEditorBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichEditorBean.java 2011-11-08
14:54:16 UTC (rev 22908)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichEditorBean.java 2011-11-08
16:14:18 UTC (rev 22909)
@@ -47,7 +47,7 @@
public class RichEditorBean implements Serializable {
public static final Logger LOG = LoggerFactory.getLogger(RichEditorBean.class);
- /** Genrated serial UID */
+ /** Generated serial UID */
private static final long serialVersionUID = -6029256813894981250L;
private Attributes attributes;
@@ -59,7 +59,9 @@
attributes.setAttribute("rendered", Boolean.TRUE);
attributes.setAttribute("requiredMessage", "Editor's value
cannot be empty!");
attributes.setAttribute("toolbar", "basic");
+ attributes.setAttribute("skin", "richfaces");
+ attributes.remove("config"); // config facet covered with
@toolbar=custom
attributes.remove("converter");
attributes.remove("converterMessage");
attributes.remove("validator");
Modified:
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/rich/RichEditorBean.properties
===================================================================
---
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/rich/RichEditorBean.properties 2011-11-08
14:54:16 UTC (rev 22908)
+++
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/rich/RichEditorBean.properties 2011-11-08
16:14:18 UTC (rev 22909)
@@ -1,3 +1,7 @@
attr.toolbar.basic=basic
attr.toolbar.full=full
attr.toolbar.custom=custom
+attr.skin.richfaces=richfaces
+attr.skin.v2=v2
+attr.skin.kama=kama
+attr.skin.office2003=office2003
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor/EditorAttributes.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor/EditorAttributes.java 2011-11-08
14:54:16 UTC (rev 22908)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor/EditorAttributes.java 2011-11-08
16:14:18 UTC (rev 22909)
@@ -35,11 +35,16 @@
immediate,
lang,
height,
+ onblur,
+ onchange,
+ ondirty,
+ onfocus,
oninit,
readonly,
rendered,
required,
requiredMessage,
+ skin,
style,
styleClass,
toolbar,
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor/TestRichEditor.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor/TestRichEditor.java 2011-11-08
14:54:16 UTC (rev 22908)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor/TestRichEditor.java 2011-11-08
16:14:18 UTC (rev 22909)
@@ -143,6 +143,19 @@
return currentText;
}
+ /**
+ * Simplified method to verify skin influence editor's class attribute.
+ * Choosen skin should be present as cke_skin_{@skinName} class
+ * in editor's container @@class attribute
+ * @param skinName
+ */
+ private void verifySkin(String skinName) {
+ editorAttributes.set(skin, skinName);
+ String editorClass = selenium.getAttribute(editor.getAttribute(new
Attribute("class")));
+ assertTrue(editorClass.contains("cke_skin_" + skinName),
+ "Seems that skin '" + skinName + "' didn't
influence editor's @class attribute!");
+ }
+
@Test
public void testValueChangeListener(){
verifyValueChangeListener(hSubmit);
@@ -263,6 +276,14 @@
}
@Test
+ public void testSkin() {
+ verifySkin("kama");
+ verifySkin("office2003");
+ verifySkin("richfaces");
+ verifySkin("v2");
+ }
+
+ @Test
public void testStyle() {
final AttributeLocator<?> styleAttr =
editor.getAttribute(Attribute.STYLE);
Show replies by date