Author: jjamrich
Date: 2011-08-04 11:43:59 -0400 (Thu, 04 Aug 2011)
New Revision: 22594
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor/RichEditorComponentAttribute.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor/TestRichEditor.java
Log:
Add selenium test for rich:editor's toolbar attribute
Add selenium test for toolbar attribute, and fix empty attrbitute setter for width
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor/RichEditorComponentAttribute.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor/RichEditorComponentAttribute.java 2011-08-04
13:19:06 UTC (rev 22593)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor/RichEditorComponentAttribute.java 2011-08-04
15:43:59 UTC (rev 22594)
@@ -73,6 +73,7 @@
}
public void setWidth(String width) {
+ setProperty("width", width);
}
}
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-08-04
13:19:06 UTC (rev 22593)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor/TestRichEditor.java 2011-08-04
15:43:59 UTC (rev 22594)
@@ -43,6 +43,35 @@
private JQueryLocator a4jSubmit = pjq("input[id$=a4jButton]");
private JQueryLocator validationMsgLoc = pjq("span.rf-msgs-sum");
+ private JQueryLocator editorToolbarGroup = jq("span.cke_toolgroup");
+
+ private JQueryLocator editorToolbarContainer = jq("td.cke_toolgroup");
+ private JQueryLocator editorToolsGroupFormat =
+ editorToolbarContainer.getDescendant(jq("span#cke_{0}.cke_toolbar"));
+
+ public enum toolbarGroup {
+ FILE_SAVE(7),
+ CLIPBOARD(14),
+ SEARCH_REPLACE(22),
+ FORM(28),
+ LISTS_ALIGNS(46),
+ BASIC_FONT_CTRL(38),
+ LINK(59),
+ RESOURCES(63),
+ STYLES_FONTS(73),
+ TEXT_BG_COLOR(77),
+ MISC(80);
+
+ int code;
+
+ toolbarGroup(int code) {
+ this.code = code;
+ }
+ int id(){
+ return code;
+ }
+ }
+
private RichEditorComponentAttribute attributes = new
RichEditorComponentAttribute();
private String text1 = "text1";
@@ -229,7 +258,18 @@
@Test
public void testToolbar() {
- // TODO jjamrich 2011-08-03: implement test when realize what this attr should do
:)
+
+ attributes.setToolbar("basic");
+
+ /* for basic configuration of editor's toolbar there should be only one
toolgroup
+ (toolgroup is group of buttons, while span.toolbar is his container)
+ Since there are not id's for toolbar based on toolbar name, it is not
possible
+ check exact toolbar present (all id's changes - for buttons as well as for
toolbars)
+ */
+ assertEquals(selenium.getCount(editorToolbarGroup), 1);
+
+ attributes.setToolbar("full");
+ assertEquals(selenium.getCount(editorToolbarGroup), 11);
}
@Test