Author: ppitonak(a)redhat.com
Date: 2010-12-20 07:27:46 -0500 (Mon, 20 Dec 2010)
New Revision: 20683
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAccordion/TestRichAccordion.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richSelect/TestRichSelect.java
Log:
* tests for rich:select fixed
* added testLimitRender for accordion
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAccordion/TestRichAccordion.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAccordion/TestRichAccordion.java 2010-12-20
08:28:19 UTC (rev 20682)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAccordion/TestRichAccordion.java 2010-12-20
12:27:46 UTC (rev 20683)
@@ -28,6 +28,7 @@
import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertNotSame;
import static org.testng.Assert.assertTrue;
import java.net.URL;
@@ -298,6 +299,26 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-9934")
+ public void testLimitRender() {
+ JQueryLocator timeLoc = jq("span[id$=requestTime]");
+
+// selenium.type(pjq("input[type=text][id$=renderInput]"),
"@this");
+// selenium.waitForPageToLoad();
+
+
selenium.click(pjq("input[type=radio][name$=limitRenderInput][value=true]"));
+ selenium.waitForPageToLoad();
+
+ String time = selenium.getText(timeLoc);
+
+ guardXhr(selenium).click(inactiveHeaders[1]);
+ waitGui.failWith("Item 2 is not
displayed.").until(isDisplayed.locator(itemContents[1]));
+
+ String newTime = selenium.getText(timeLoc);
+ assertNotSame(newTime, time, "Panel with ajaxRendered=true should not be
rerendered.");
+ }
+
+ @Test
public void testOnclick() {
testFireEvent(Event.CLICK, accordion);
}
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richSelect/TestRichSelect.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richSelect/TestRichSelect.java 2010-12-20
08:28:19 UTC (rev 20682)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richSelect/TestRichSelect.java 2010-12-20
12:27:46 UTC (rev 20683)
@@ -73,7 +73,8 @@
@Test
public void testSelectWithMouse() {
- guardNoRequest(selenium).click(button);
+ guardNoRequest(selenium).mouseDown(button);
+ selenium.mouseUp(button);
assertTrue(selenium.isVisible(popup), "Popup should be displayed.");
for (int i = 0; i < 50; i++) {
@@ -173,11 +174,11 @@
AttributeLocator readonlyAttr = input.getAttribute(new
Attribute("readonly"));
assertEquals(selenium.getAttribute(readonlyAttr), "readonly",
"Input should be read-only");
- selenium.click(button);
+ selenium.mouseDown(button);
assertTrue(selenium.isVisible(popup), "Popup should be displayed.");
selenium.click(options.format(10));
- guardXhr(selenium).fireEvent(input, Event.BLUR);
+ selenium.fireEvent(input, Event.BLUR);
assertTrue(selenium.belongsClass(options.format(10), "rf-sel-sel"));
waitGui.failWith("Bean was not
updated").until(textEquals.locator(output).text("Hawaii"));
@@ -361,8 +362,15 @@
}
@Test
- public void testOnselect() {
- testFireEvent(Event.SELECT, input);
+ public void testOnselectitem() {
+ selenium.type(pjq("input[type=text][id$=onselectitemInput]"),
"metamerEvents += \"selectitem \"");
+ selenium.waitForPageToLoad();
+
+ selenium.click(button);
+ selenium.click(options.format(10));
+
+ waitGui.failWith("Attribute onchange does not work correctly").until(
+ new EventFiredCondition(new Event("selectitem")));
}
@Test
Show replies by date