Author: jpapouse
Date: 2011-10-13 11:11:19 -0400 (Thu, 13 Oct 2011)
New Revision: 22800
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richNotify/TestRichNotifyMoreStacks.java
Log:
notify: fixed test for more stacks
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richNotify/TestRichNotifyMoreStacks.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richNotify/TestRichNotifyMoreStacks.java 2011-10-13
12:55:52 UTC (rev 22799)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richNotify/TestRichNotifyMoreStacks.java 2011-10-13
15:11:19 UTC (rev 22800)
@@ -50,15 +50,25 @@
private final JQueryLocator stack2 = jq("div.bottomRight");
/**
- * locater of the input which is associated with messages for the first stack
+ * locator of the input which is associated with messages for the first stack
*/
private final JQueryLocator number1 = pjq("input[id$=number1]");
/**
- * locater of the input which is associated with messages for the second stack
+ * locator of the input which is associated with messages for the second stack
*/
private final JQueryLocator number2 = pjq("input[id$=number2]");
+ /**
+ * locator of the h:commnadButton submit
+ */
+ private final JQueryLocator submitHCommandButton =
pjq("input[id$=hCommandButtonSubmit]");
+
+ /**
+ * locator of the a4j:commnadButton submit
+ */
+ private final JQueryLocator submitA4jCommandButton =
pjq("input[id$=a4jCommandButtonSubmit]");
+
@Override
public URL getTestUrl() {
return buildUrl(contextPath,
"faces/components/richNotify/moreStacks.xhtml");
@@ -66,8 +76,6 @@
@Test
public void testInit() {
- assertTrue(selenium.isElementPresent(stack1), "The first stack is not
present.");
- assertTrue(selenium.isElementPresent(stack2), "The second stack is not
present.");
assertTrue(selenium.isElementPresent(inStack(stack1, notify)), "The notify
in the first stack is not present.");
assertTrue(selenium.isElementPresent(inStack(stack2, notify)), "The notify
in the second stack is not present.");
assertEquals(1, getNumberOfNotifies(stack1), "The initial number of notifies
in the first stack should be <1>, found <" + getNumberOfNotifies(stack1) +
">.");
@@ -77,32 +85,28 @@
@Test
public void testValidationErrorInTwoStacks() {
// notify in stacks
- JQueryLocator message1 = inStack(stack1, notify);
- JQueryLocator message2 = inStack(stack2, notify);
- // close notifes in both stacks
- close(message1);
- close(message2);
+ JQueryLocator message1 = inStack(stack1, notifyError);
+ JQueryLocator message2 = inStack(stack2, notifyError);
// try to fill the number 1 field (wrong)
selenium.type(number1, "1");
- selenium.fireEvent(number1, Event.BLUR);
- delay(1000);
+ selenium.type(number2, "5");
+ selenium.click(submitHCommandButton);
+ selenium.waitForPageToLoad();
waitGui
.failWith("After wrong filling the first form field the number of
messages in the first stack should be <1>, found <" +
selenium.getCount(message1) + ">")
.until(countEquals.locator(message1).count(1));
waitGui
.failWith("After wrong filling the first form field the number of
messages in the second stack should be <0>, found <" +
selenium.getCount(message2) + ">")
- .until(countEquals.locator(message1).count(0));
-
- // close produced notifies
+ .until(countEquals.locator(message2).count(0));
close(message1);
- close(message2);
// try to fill the number 2 field (wrong)
+ selenium.type(number1, "10");
selenium.type(number2, "1");
- selenium.fireEvent(number2, Event.BLUR);
- delay(1000);
+ selenium.click(submitHCommandButton);
+ selenium.waitForPageToLoad();
waitGui
.failWith("After wrong filling the second form field the number of
messages in the second stack should be <1>, found <" +
selenium.getCount(message2) + ">")
- .until(countEquals.locator(message1).count(1));
+ .until(countEquals.locator(message2).count(1));
waitGui
.failWith("After wrong filling the second form field the number of
messages in the first stack should be <0>, found <" +
selenium.getCount(message1) + ">")
.until(countEquals.locator(message1).count(0));