Author: jjamrich
Date: 2011-10-10 08:43:08 -0400 (Mon, 10 Oct 2011)
New Revision: 22772
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor/TestRichEditor.java
Log:
RFPL-1658: fix test for @readonly for rich:editor
Since there is selenium test trying type into editor area while @readonly is set to true
failing (it is possible to type text into are by selenium), but by hand is text refused,
changing test code to verify apporpriate attributes in textarea and editor body only.
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-10-10
11:48:25 UTC (rev 22771)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor/TestRichEditor.java 2011-10-10
12:43:08 UTC (rev 22772)
@@ -220,29 +220,16 @@
@IssueTracking("https://issues.jboss.org/browse/RFPL-1658")
public void testReadonly() {
- typeTextToEditor(text1);
-
- String currentText = getEditorText();
- assertTrue(currentText != null && currentText.contains(text1));
-
editorAttributes.set(readonly, Boolean.TRUE);
- // waitModel.until(elementPresent.locator(editor));
- typeTextToEditor("test");
- // assert that there is no "test" present in editor text area
- currentText = getEditorText();
- assertFalse(currentText != null &&
currentText.contains("test"));
+ String readOnlyAttrVal = selenium.getAttribute(
+ editorTextArea.getAttribute(new Attribute("readonly")));
+ assertTrue("readonly".equals(readOnlyAttrVal));
- // now set read-only back to false
- editorAttributes.set(readonly, Boolean.FALSE);
- // waitModel.until(elementPresent.locator(editor));
-
- // and type another text
- typeTextToEditor(text2);
-
- // now we should assert that only expected text are present
- currentText = getEditorText();
- assertTrue(currentText != null && currentText.contains(text2));
+ selenium.selectFrame(frameLocator);
+ String contentEditableVal = selenium.getAttribute(
+ editorArea.getAttribute(new Attribute("contenteditable")));
+ assertTrue("false".equals(contentEditableVal));
}
@Test
Show replies by date