Author: jpapouse
Date: 2011-09-23 10:13:43 -0400 (Fri, 23 Sep 2011)
New Revision: 22755
Modified:
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/rich/RichTabPanelBean.properties
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTabPanel/TestRichTabPanel.java
Log:
RFPL-1674: tests for headerPosition and headerAlignment attributes (rich:tabPanel)
Modified:
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/rich/RichTabPanelBean.properties
===================================================================
---
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/rich/RichTabPanelBean.properties 2011-09-23
13:31:48 UTC (rev 22754)
+++
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/rich/RichTabPanelBean.properties 2011-09-23
14:13:43 UTC (rev 22755)
@@ -6,6 +6,10 @@
attr.headerAlignment.right=right
attr.headerAlignment.null=
+attr.headerPosition.bottom=bottom
+attr.headerPosition.top=top
+attr.headerPosition.null=
+
attr.switchType.client=client
attr.switchType.server=server
attr.switchType.ajax=ajax
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTabPanel/TestRichTabPanel.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTabPanel/TestRichTabPanel.java 2011-09-23
13:31:48 UTC (rev 22754)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTabPanel/TestRichTabPanel.java 2011-09-23
14:13:43 UTC (rev 22755)
@@ -33,6 +33,7 @@
import javax.faces.event.PhaseId;
+import org.jboss.test.selenium.css.CssProperty;
import org.jboss.test.selenium.dom.Event;
import org.jboss.test.selenium.encapsulated.JavaScript;
import org.jboss.test.selenium.locator.JQueryLocator;
@@ -41,6 +42,7 @@
import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
import org.richfaces.tests.metamer.ftest.annotations.RegressionTest;
import org.testng.annotations.Test;
+import static org.jboss.test.selenium.locator.LocatorFactory.jq;
/**
* Test case for page /faces/components/richTabPanel/simple.xhtml
@@ -68,6 +70,44 @@
}
@Test
+ public void testHeaderAlignment() {
+ JQueryLocator spaceLeft = jq(panel.getRawLocator() + "
*.rf-tab-hdr-spcr:eq(0)");
+ JQueryLocator spaceRight = jq(panel.getRawLocator() + "
*.rf-tab-hdr-spcr:eq(6)");
+
+ assertEquals(selenium.getStyle(spaceLeft, CssProperty.WIDTH), "0px",
"The header should be aligned to the left, but it isn't.");
+ assertTrue(Integer.parseInt(selenium.getStyle(spaceRight,
CssProperty.WIDTH).replace("px", "")) > 100, "The header
should be aligned to the left, but it isn't.");
+
+ selenium.click(pjq("input[name$=headerAlignmentInput][value=left]"));
+ selenium.waitForPageToLoad();
+
+ assertEquals(selenium.getStyle(spaceLeft, CssProperty.WIDTH), "0px",
"The header should be aligned to the left, but it isn't.");
+ assertTrue(Integer.parseInt(selenium.getStyle(spaceRight,
CssProperty.WIDTH).replace("px", "")) > 100, "The header
should be aligned to the left, but it isn't.");
+
+ selenium.click(pjq("input[name$=headerAlignmentInput][value=right]"));
+ selenium.waitForPageToLoad();
+
+ assertTrue(Integer.parseInt(selenium.getStyle(spaceLeft,
CssProperty.WIDTH).replace("px", "")) > 100, "The header
should be aligned to the right, but it isn't.");
+ assertEquals(selenium.getStyle(spaceRight, CssProperty.WIDTH), "0px",
"The header should be aligned to the right, but it isn't.");
+ }
+
+ @Test
+ public void testHeaderPosition() {
+ selenium.click(pjq("input[name$=headerPositionInput][value=bottom]"));
+ selenium.waitForPageToLoad();
+
+ JQueryLocator bottomVersion = jq(panel.getRawLocator() + "
*.rf-tab-hdr-tabline-btm-vis");
+ JQueryLocator topVersion = jq(panel.getRawLocator() + "
*.rf-tab-hdr-tabline-top-vis");
+
+ selenium.click(pjq("input[name$=headerPositionInput][value=top]"));
+ selenium.waitForPageToLoad();
+ assertTrue(selenium.isElementPresent(topVersion), "The header should be
placed on the top position (" + topVersion.getRawLocator() +")");
+
+ selenium.click(pjq("input[name$=headerPositionInput][value=bottom]"));
+ selenium.waitForPageToLoad();
+ assertTrue(selenium.isElementPresent(bottomVersion), "The header should be
placed on the bottom position (" + bottomVersion.getRawLocator() +")");
+ }
+
+ @Test
public void testInit() {
boolean displayed = selenium.isDisplayed(panel);
assertTrue(displayed, "Tab panel is not present on the page.");
@@ -101,7 +141,7 @@
}
@Test
- @IssueTracking("https://issues.jboss.org/browse/RF-10351")
+ @RegressionTest("https://issues.jboss.org/browse/RF-10351")
public void testActiveItem() {
selenium.type(pjq("input[type=text][id$=activeItemInput]"),
"tab5");
selenium.waitForPageToLoad();
Show replies by date