JBoss Rich Faces SVN: r22808 - in modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest: richTabPanel and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2011-10-14 11:17:35 -0400 (Fri, 14 Oct 2011)
New Revision: 22808
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTab/TestRichTab.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTabPanel/TestRichTabPanel.java
Log:
tests fixed
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTab/TestRichTab.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTab/TestRichTab.java 2011-10-14 14:30:47 UTC (rev 22807)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTab/TestRichTab.java 2011-10-14 15:17:35 UTC (rev 22808)
@@ -50,21 +50,23 @@
* @version $Revision$
*/
public class TestRichTab extends AbstractMetamerTest {
-
+
private static final JQueryLocator PHASE_FORMAT = jq("div#phasesPanel li:eq({0})");
private static final String PHASE_LISTENER_LOG = "* action listener invoked";
-
+
private JQueryLocator panel = pjq("div[id$=tabPanel]");
- private JQueryLocator[] itemContents = {pjq("div[id$=tab1] > div.rf-tab-cnt"), pjq("div[id$=tab2] > div.rf-tab-cnt"),
- pjq("div[id$=tab3] > div.rf-tab-cnt"), pjq("div[id$=tab4] > div.rf-tab-cnt"), pjq("div[id$=tab5] > div.rf-tab-cnt")};
- private JQueryLocator[] activeHeaders = {pjq("td[id$=tab1:header:active]"), pjq("td[id$=tab2:header:active]"),
- pjq("td[id$=tab3:header:active]"), pjq("td[id$=tab4:header:active]"), pjq("td[id$=tab5:header:active]")};
- private JQueryLocator[] inactiveHeaders = {pjq("td[id$=tab1:header:inactive]"), pjq("td[id$=tab2:header:inactive]"),
- pjq("td[id$=tab3:header:inactive]"), pjq("td[id$=tab4:header:inactive]"), pjq("td[id$=tab5:header:inactive]")};
- private JQueryLocator[] disabledHeaders = {pjq("td[id$=tab1:header:disabled]"), pjq("td[id$=tab2:header:disabled]"),
- pjq("td[id$=tab3:header:disabled]"), pjq("td[id$=tab4:header:disabled]"), pjq("td[id$=tab5:header:disabled]")};
+ private JQueryLocator[] itemContents = { pjq("div[id$=tab1] > div.rf-tab-cnt"),
+ pjq("div[id$=tab2] > div.rf-tab-cnt"), pjq("div[id$=tab3] > div.rf-tab-cnt"),
+ pjq("div[id$=tab4] > div.rf-tab-cnt"), pjq("div[id$=tab5] > div.rf-tab-cnt") };
+ private JQueryLocator[] activeHeaders = { pjq("td[id$=tab1:header:active]"), pjq("td[id$=tab2:header:active]"),
+ pjq("td[id$=tab3:header:active]"), pjq("td[id$=tab4:header:active]"), pjq("td[id$=tab5:header:active]") };
+ private JQueryLocator[] inactiveHeaders = { pjq("td[id$=tab1:header:inactive]"),
+ pjq("td[id$=tab2:header:inactive]"), pjq("td[id$=tab3:header:inactive]"), pjq("td[id$=tab4:header:inactive]"),
+ pjq("td[id$=tab5:header:inactive]") };
+ private JQueryLocator[] disabledHeaders = { pjq("td[id$=tab1:header:disabled]"),
+ pjq("td[id$=tab2:header:disabled]"), pjq("td[id$=tab3:header:disabled]"), pjq("td[id$=tab4:header:disabled]"),
+ pjq("td[id$=tab5:header:disabled]") };
private JQueryLocator tab1 = pjq("div[id$=tab1]");
-
@Override
public URL getTestUrl() {
@@ -77,18 +79,16 @@
retrieveRequestTime.initializeValue();
selenium.click(pjq("input[id$=nextTabButton]"));
waitAjax.waitForChange(retrieveRequestTime);
-
+
retrieveRequestTime.initializeValue();
selenium.click(pjq("input[id$=prevTabButton]"));
waitAjax.waitForChange(retrieveRequestTime);
-
- waitGui
- .failWith("Expected <" + PHASE_LISTENER_LOG + ">, found <" + selenium.getText(PHASE_FORMAT.format(5)) + ">")
- .until(textEquals.locator(PHASE_FORMAT.format(5)).text(
- PHASE_LISTENER_LOG)
- );
- }
-
+
+ waitGui.failWith(
+ "Expected <" + PHASE_LISTENER_LOG + ">, found <" + selenium.getText(PHASE_FORMAT.format(5)) + ">").until(
+ textEquals.locator(PHASE_FORMAT.format(5)).text(PHASE_LISTENER_LOG));
+ }
+
@Test
public void testInit() {
boolean displayed = selenium.isDisplayed(panel);
@@ -166,7 +166,8 @@
selenium.type(pjq("input[type=text][id$=headerInput]"), "ľščťťžžôúňď ацущьмщфзщйцу");
selenium.waitForPageToLoad();
- assertEquals(selenium.getText(activeHeaders[0]), "ľščťťžžôúňď ацущьмщфзщйцу", "Header of the first tab did not change.");
+ assertEquals(selenium.getText(activeHeaders[0]), "ľščťťžžôúňď ацущьмщфзщйцу",
+ "Header of the first tab did not change.");
}
@Test
@@ -184,6 +185,7 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-11549")
public void testHeaderClass() {
selenium.type(pjq("input[id$=headerClassInput]"), "metamer-ftest-class");
selenium.waitForPageToLoad();
@@ -203,12 +205,16 @@
selenium.waitForPageToLoad();
assertFalse(selenium.belongsClass(activeHeaders[0], "metamer-ftest-class"), "headerDisabledClass does not work");
- assertFalse(selenium.belongsClass(inactiveHeaders[0], "metamer-ftest-class"), "headerDisabledClass does not work");
- assertTrue(selenium.belongsClass(disabledHeaders[0], "metamer-ftest-class"), "headerDisabledClass does not work");
+ assertFalse(selenium.belongsClass(inactiveHeaders[0], "metamer-ftest-class"),
+ "headerDisabledClass does not work");
+ assertTrue(selenium.belongsClass(disabledHeaders[0], "metamer-ftest-class"),
+ "headerDisabledClass does not work");
assertFalse(selenium.belongsClass(activeHeaders[1], "metamer-ftest-class"), "headerDisabledClass does not work");
- assertFalse(selenium.belongsClass(inactiveHeaders[1], "metamer-ftest-class"), "headerDisabledClass does not work");
- assertFalse(selenium.belongsClass(disabledHeaders[1], "metamer-ftest-class"), "headerDisabledClass does not work");
+ assertFalse(selenium.belongsClass(inactiveHeaders[1], "metamer-ftest-class"),
+ "headerDisabledClass does not work");
+ assertFalse(selenium.belongsClass(disabledHeaders[1], "metamer-ftest-class"),
+ "headerDisabledClass does not work");
}
@Test
@@ -217,12 +223,16 @@
selenium.waitForPageToLoad();
assertFalse(selenium.belongsClass(activeHeaders[0], "metamer-ftest-class"), "headerInactiveClass does not work");
- assertTrue(selenium.belongsClass(inactiveHeaders[0], "metamer-ftest-class"), "headerInactiveClass does not work");
- assertFalse(selenium.belongsClass(disabledHeaders[0], "metamer-ftest-class"), "headerInactiveClass does not work");
+ assertTrue(selenium.belongsClass(inactiveHeaders[0], "metamer-ftest-class"),
+ "headerInactiveClass does not work");
+ assertFalse(selenium.belongsClass(disabledHeaders[0], "metamer-ftest-class"),
+ "headerInactiveClass does not work");
assertFalse(selenium.belongsClass(activeHeaders[1], "metamer-ftest-class"), "headerInactiveClass does not work");
- assertFalse(selenium.belongsClass(inactiveHeaders[1], "metamer-ftest-class"), "headerInactiveClass does not work");
- assertFalse(selenium.belongsClass(disabledHeaders[1], "metamer-ftest-class"), "headerInactiveClass does not work");
+ assertFalse(selenium.belongsClass(inactiveHeaders[1], "metamer-ftest-class"),
+ "headerInactiveClass does not work");
+ assertFalse(selenium.belongsClass(disabledHeaders[1], "metamer-ftest-class"),
+ "headerInactiveClass does not work");
}
@Test
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-10-14 14:30:47 UTC (rev 22807)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTabPanel/TestRichTabPanel.java 2011-10-14 15:17:35 UTC (rev 22808)
@@ -53,16 +53,19 @@
public class TestRichTabPanel extends AbstractMetamerTest {
private JQueryLocator panel = pjq("div[id$=tabPanel]");
- private JQueryLocator[] items = {pjq("div[id$=tab1]"), pjq("div[id$=tab2]"), pjq("div[id$=tab3]"), pjq("div[id$=tab4]"),
- pjq("div[id$=tab5]")};
- private JQueryLocator[] itemContents = {pjq("div[id$=tab1] > div.rf-tab-cnt"), pjq("div[id$=tab2] > div.rf-tab-cnt"),
- pjq("div[id$=tab3] > div.rf-tab-cnt"), pjq("div[id$=tab4] > div.rf-tab-cnt"), pjq("div[id$=tab5] > div.rf-tab-cnt")};
- private JQueryLocator[] activeHeaders = {pjq("td[id$=tab1:header:active]"), pjq("td[id$=tab2:header:active]"),
- pjq("td[id$=tab3:header:active]"), pjq("td[id$=tab4:header:active]"), pjq("td[id$=tab5:header:active]")};
- private JQueryLocator[] inactiveHeaders = {pjq("td[id$=tab1:header:inactive]"), pjq("td[id$=tab2:header:inactive]"),
- pjq("td[id$=tab3:header:inactive]"), pjq("td[id$=tab4:header:inactive]"), pjq("td[id$=tab5:header:inactive]")};
- private JQueryLocator[] disabledHeaders = {pjq("td[id$=tab1:header:disabled]"), pjq("td[id$=tab2:header:disabled]"),
- pjq("td[id$=tab3:header:disabled]"), pjq("td[id$=tab4:header:disabled]"), pjq("td[id$=tab5:header:disabled]")};
+ private JQueryLocator[] items = { pjq("div[id$=tab1]"), pjq("div[id$=tab2]"), pjq("div[id$=tab3]"),
+ pjq("div[id$=tab4]"), pjq("div[id$=tab5]") };
+ private JQueryLocator[] itemContents = { pjq("div[id$=tab1] > div.rf-tab-cnt"),
+ pjq("div[id$=tab2] > div.rf-tab-cnt"), pjq("div[id$=tab3] > div.rf-tab-cnt"),
+ pjq("div[id$=tab4] > div.rf-tab-cnt"), pjq("div[id$=tab5] > div.rf-tab-cnt") };
+ private JQueryLocator[] activeHeaders = { pjq("td[id$=tab1:header:active]"), pjq("td[id$=tab2:header:active]"),
+ pjq("td[id$=tab3:header:active]"), pjq("td[id$=tab4:header:active]"), pjq("td[id$=tab5:header:active]") };
+ private JQueryLocator[] inactiveHeaders = { pjq("td[id$=tab1:header:inactive]"),
+ pjq("td[id$=tab2:header:inactive]"), pjq("td[id$=tab3:header:inactive]"), pjq("td[id$=tab4:header:inactive]"),
+ pjq("td[id$=tab5:header:inactive]") };
+ private JQueryLocator[] disabledHeaders = { pjq("td[id$=tab1:header:disabled]"),
+ pjq("td[id$=tab2:header:disabled]"), pjq("td[id$=tab3:header:disabled]"), pjq("td[id$=tab4:header:disabled]"),
+ pjq("td[id$=tab5:header:disabled]") };
@Override
public URL getTestUrl() {
@@ -70,43 +73,52 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-11550")
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.");
-
+
+ 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.");
-
+
+ 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.");
+
+ 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.waitForPageToLoad();
+ JQueryLocator bottomVersion = jq(panel.getRawLocator() + " .rf-tab-hdr-tabline-vis.rf-tab-hdr-tabline-btm");
+ JQueryLocator topVersion = jq(panel.getRawLocator() + " .rf-tab-hdr-tabline-vis.rf-tab-hdr-tabline-top");
+
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.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() +")");
+ 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);
@@ -240,7 +252,8 @@
guardXhr(selenium).click(inactiveHeaders[1]);
waitGui.failWith("Tab 2 is not displayed.").until(isDisplayed.locator(itemContents[1]));
- waitGui.failWith("onbeforeitemchange attribute does not work correctly").until(new EventFiredCondition(new Event("beforeitemchange")));
+ waitGui.failWith("onbeforeitemchange attribute does not work correctly").until(
+ new EventFiredCondition(new Event("beforeitemchange")));
}
@Test
@@ -282,7 +295,8 @@
guardXhr(selenium).click(inactiveHeaders[1]);
waitGui.failWith("Tab 2 is not displayed.").until(isDisplayed.locator(itemContents[1]));
- waitGui.failWith("onitemchange attribute does not work correctly").until(new EventFiredCondition(new Event("itemchange")));
+ waitGui.failWith("onitemchange attribute does not work correctly").until(
+ new EventFiredCondition(new Event("itemchange")));
}
@Test
@@ -333,7 +347,8 @@
for (int i = 2; i >= 0; i--) {
final int index = i;
guardXhr(selenium).click(inactiveHeaders[index]);
- waitGui.failWith("Tab " + (index + 1) + " is not displayed.").until(isDisplayed.locator(itemContents[index]));
+ waitGui.failWith("Tab " + (index + 1) + " is not displayed.").until(
+ isDisplayed.locator(itemContents[index]));
}
}
@@ -353,7 +368,8 @@
for (int i = 2; i >= 0; i--) {
final int index = i;
guardNoRequest(selenium).click(inactiveHeaders[index]);
- waitGui.failWith("Tab " + (index + 1) + " is not displayed.").until(isDisplayed.locator(itemContents[index]));
+ waitGui.failWith("Tab " + (index + 1) + " is not displayed.").until(
+ isDisplayed.locator(itemContents[index]));
}
}
@@ -366,7 +382,8 @@
for (int i = 2; i >= 0; i--) {
final int index = i;
guardHttp(selenium).click(inactiveHeaders[index]);
- waitGui.failWith("Tab " + (index + 1) + " is not displayed.").until(isDisplayed.locator(itemContents[index]));
+ waitGui.failWith("Tab " + (index + 1) + " is not displayed.").until(
+ isDisplayed.locator(itemContents[index]));
}
}
@@ -419,7 +436,7 @@
}
@Test
- @IssueTracking("https://issues.jboss.org/browse/RF-9309")
+ @IssueTracking({ "https://issues.jboss.org/browse/RF-9309", "https://issues.jboss.org/browse/RF-11549" })
public void testTabHeaderClass() {
selenium.type(pjq("input[id$=tabHeaderClassInput]"), "metamer-ftest-class");
selenium.waitForPageToLoad();