Author: jjamrich
Date: 2011-11-23 06:18:45 -0500 (Wed, 23 Nov 2011)
New Revision: 22978
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor/TestRichEditor.java
Log:
rich:editor: change way to retrieve @style value
Found that there is another way how to retrieve @style value in richfaces-selenium lib.
Changed test to use this prefered way.
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-23
10:30:53 UTC (rev 22977)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor/TestRichEditor.java 2011-11-23
11:18:45 UTC (rev 22978)
@@ -5,21 +5,32 @@
import static java.text.MessageFormat.format;
import static org.jboss.test.selenium.locator.LocatorFactory.jq;
+import static
org.richfaces.tests.metamer.ftest.attributes.AttributeList.editorAttributes;
+import static org.richfaces.tests.metamer.ftest.richEditor.EditorAttributes.immediate;
+import static org.richfaces.tests.metamer.ftest.richEditor.EditorAttributes.lang;
+import static org.richfaces.tests.metamer.ftest.richEditor.EditorAttributes.readonly;
+import static org.richfaces.tests.metamer.ftest.richEditor.EditorAttributes.rendered;
+import static org.richfaces.tests.metamer.ftest.richEditor.EditorAttributes.required;
+import static
org.richfaces.tests.metamer.ftest.richEditor.EditorAttributes.requiredMessage;
+import static org.richfaces.tests.metamer.ftest.richEditor.EditorAttributes.skin;
+import static org.richfaces.tests.metamer.ftest.richEditor.EditorAttributes.styleClass;
+import static org.richfaces.tests.metamer.ftest.richEditor.EditorAttributes.title;
+import static org.richfaces.tests.metamer.ftest.richEditor.EditorAttributes.toolbar;
+import static org.richfaces.tests.metamer.ftest.richEditor.EditorAttributes.value;
+import static org.richfaces.tests.metamer.ftest.richEditor.EditorAttributes.width;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;
-import static
org.richfaces.tests.metamer.ftest.attributes.AttributeList.editorAttributes;
-import static org.richfaces.tests.metamer.ftest.richEditor.EditorAttributes.*;
import java.net.URL;
+import org.jboss.test.selenium.css.CssProperty;
import org.jboss.test.selenium.dom.Event;
import org.jboss.test.selenium.encapsulated.FrameLocator;
import org.jboss.test.selenium.locator.Attribute;
import org.jboss.test.selenium.locator.AttributeLocator;
import org.jboss.test.selenium.locator.JQueryLocator;
import org.jboss.test.selenium.utils.URLUtils;
-import org.jboss.test.selenium.waiting.EventFiredCondition;
import org.jboss.test.selenium.waiting.selenium.SeleniumCondition;
import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
@@ -44,8 +55,7 @@
private JQueryLocator validationMsgLoc = pjq("span.rf-msgs-sum");
private JQueryLocator editorToolbarGroup = jq("span.cke_toolbar");
-
- private Attribute styleAttribute = new Attribute("style");
+
private Attribute langAttribute = new Attribute("lang");
public enum toolbarGroup {
@@ -171,9 +181,10 @@
editorAttributes.set(EditorAttributes.height, height);
// height style is set for area used as editor canvas (not for whole editor
component)
- String style = selenium.getAttribute(
- editor.getDescendant(jq("table.cke_editor tr:eq(1)
td")).getAttribute(styleAttribute));
-
+ // String style = selenium.getAttribute(
+ // editor.getDescendant(jq("table.cke_editor tr:eq(1)
td")).getAttribute(styleAttribute));
+ String style = selenium.getStyle(
+ editor.getDescendant(jq("table.cke_editor tr:eq(1) td")),
CssProperty.HEIGHT);
assertTrue(style != null && style.contains(height));
}
@@ -380,7 +391,7 @@
String STYLE_WIDTH = "345px";
editorAttributes.set(width, STYLE_WIDTH);
- String styleAttr = selenium.getAttribute(editor.getAttribute(styleAttribute));
+ String styleAttr = selenium.getStyle(editor, CssProperty.WIDTH);
assertTrue(styleAttr != null && styleAttr.contains(STYLE_WIDTH),
"Style attribute should contain width value");
}
Show replies by date