Author: jjamrich
Date: 2011-09-09 06:50:55 -0400 (Fri, 09 Sep 2011)
New Revision: 22695
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:
RFPL-1637: add tests for new attributes and fix some locator changed when refactored
editor component
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-09-08
21:55:07 UTC (rev 22694)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor/RichEditorComponentAttribute.java 2011-09-09
10:50:55 UTC (rev 22695)
@@ -36,6 +36,10 @@
setProperty("immediate", immediate);
}
+ public void setLang(String lang) {
+ setProperty("lang", lang);
+ }
+
public void setHeight(String height) {
setProperty("height", height);
}
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-09-08
21:55:07 UTC (rev 22694)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor/TestRichEditor.java 2011-09-09
10:50:55 UTC (rev 22695)
@@ -34,8 +34,8 @@
private static final Logger LOG = LoggerFactory.getLogger(TestRichEditor.class);
- private JQueryLocator editor = pjq("span[id$=:editor]");
- private JQueryLocator editorTextArea = pjq("textarea[id$=:editor]");
+ private JQueryLocator editor = pjq("span[id$=editor:inp]");
+ private JQueryLocator editorTextArea = pjq("textarea[id$=editor:inp]");
private JQueryLocator editorArea = jq("body");
private JQueryLocator phaseListenerFormat = jq("div#phasesPanel
li:eq({0})");
private FrameLocator frameLocator = new FrameLocator("jquery=iframe");
@@ -46,6 +46,7 @@
private JQueryLocator editorToolbarGroup = jq("span.cke_toolbar");
private Attribute styleAttribute = new Attribute("style");
+ private Attribute langAttribute = new Attribute("lang");
public enum toolbarGroup {
FILE_SAVE(7),
@@ -188,6 +189,16 @@
}
@Test
+ public void testLang() {
+ String langVal = "xyz";
+ attributes.setLang(langVal);
+
+ // there is lang attribute present in 2 editor's elements
+
assertTrue(langVal.equals(selenium.getAttribute(editorTextArea.getAttribute(langAttribute))));
+
assertTrue(langVal.equals(selenium.getAttribute(editor.getAttribute(langAttribute))));
+ }
+
+ @Test
public void testOnBlur() {
testFireEvent(Event.BLUR, editorTextArea);
}
@@ -327,6 +338,10 @@
attributes.setToolbar("full");
assertEquals(selenium.getCount(editorToolbarGroup), 11);
+
+ // since config facet has been introduced...
+ attributes.setToolbar("custom");
+ assertEquals(selenium.getCount(editorToolbarGroup), 9);
}
@Test
Show replies by date