Author: jjamrich
Date: 2012-01-24 05:53:00 -0500 (Tue, 24 Jan 2012)
New Revision: 23181
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richContextMenu/TestRichContextMenu.java
Log:
RF-10197: fix @style and @rendered tests for rich:contextMenu
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richContextMenu/TestRichContextMenu.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richContextMenu/TestRichContextMenu.java 2012-01-24
10:52:48 UTC (rev 23180)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richContextMenu/TestRichContextMenu.java 2012-01-24
10:53:00 UTC (rev 23181)
@@ -301,15 +301,15 @@
String minWidth = "333";
contextMenuAttributes.set(popupWidth, minWidth);
clickOnTarget(menuElem);
- String style =
selenium.getAttribute(contextMenuContent.getAttribute(Attribute.STYLE));
- assertTrue(style.contains("min-width: " + minWidth));
+ String style = selenium.getStyle(contextMenuContent, new
CssProperty("min-width"));
+ assertEquals(style, minWidth + "px");
}
@Test
public void testRendered() {
contextMenuAttributes.set(rendered, Boolean.FALSE);
clickOnTarget(menuElem);
- assertTrue(selenium.isElementPresent(contextMenuContent));
+ assertFalse(selenium.isElementPresent(contextMenuContent));
}
// @Test
@@ -324,12 +324,13 @@
@Test
public void testStyle() {
- String styleVal = "background-color: yellow;";
+ String color = "yellow";
+ String styleVal = "background-color: " + color + ";";
contextMenuAttributes.set(style, styleVal);
clickOnTarget(menuElem);
-
waitModel.until(attributeEquals.locator(contextMenu.getAttribute(Attribute.STYLE)).text(styleVal));
- String style = selenium.getAttribute(contextMenu.getAttribute(Attribute.STYLE));
- assertTrue(style.contains(styleVal));
+ String backgroundColor = selenium.getStyle(contextMenu,
CssProperty.BACKGROUND_COLOR);
+ // don't know why exactly selenium retrieve bg color in RGB format
+ assertTrue(backgroundColor.equals(color) || backgroundColor.equals("rgb(255,
255, 0)"));
}
@Test