Author: jpapouse
Date: 2011-08-17 08:16:51 -0400 (Wed, 17 Aug 2011)
New Revision: 22639
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSlider/TestRichSliderWithJSR303.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSpinner/TestRichSpinnerWithJSR303.java
Log:
fixed JSR 303 selenium tests for rich:inputNumberSlider and rich:inputNumberSpinner
components to accept messages from myfaces (are prefixed by form input identifier)
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSlider/TestRichSliderWithJSR303.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSlider/TestRichSliderWithJSR303.java 2011-08-17
11:25:52 UTC (rev 22638)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSlider/TestRichSliderWithJSR303.java 2011-08-17
12:16:51 UTC (rev 22639)
@@ -26,7 +26,9 @@
import org.jboss.test.selenium.geometry.Point;
import org.jboss.test.selenium.locator.JQueryLocator;
import org.jboss.test.selenium.utils.URLUtils;
+import org.jboss.test.selenium.waiting.TextContainsCondition;
import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
+import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
import org.testng.Assert;
import org.testng.annotations.Test;
@@ -121,7 +123,7 @@
selenium.fireEvent(inputFormat.format(ID.CUSTOM.val()), Event.BLUR);
// wait until validation appears on last input before go ahead (e.g. submit
form)
-
waitGui.until(textEquals.text(MSG_CUSTOM).locator(msgFormat.format(ID.CUSTOM.val())));
+
waitGui.until(TextContainsCondition.getInstance().text(MSG_CUSTOM).locator(msgFormat.format(ID.CUSTOM.val())));
}
@Override
@@ -133,7 +135,7 @@
public void testMin() {
selenium.type(inputFormat.format(ID.MIN.val()), WRONG_MIN_VAL);
selenium.fireEvent(inputFormat.format(ID.MIN.val()), Event.BLUR);
- waitGui.until(textEquals.locator(msgFormat.format(ID.MIN.val())).text(MSG_MIN));
+
waitGui.until(TextContainsCondition.getInstance().locator(msgFormat.format(ID.MIN.val())).text(MSG_MIN));
}
@Test
@@ -141,14 +143,14 @@
setAllCorrect();
selenium.mouseDownAt(sliderFormat.format(ID.MIN.val()), new
Point(POSITION.ZERO.val(), 0));
- waitGui.until(textEquals.locator(msgFormat.format(ID.MIN.val())).text(MSG_MIN));
+
waitGui.until(TextContainsCondition.getInstance().locator(msgFormat.format(ID.MIN.val())).text(MSG_MIN));
}
@Test
public void testMax() {
selenium.type(inputFormat.format(ID.MAX.val()), WRONG_MAX_VAL);
selenium.fireEvent(inputFormat.format(ID.MAX.val()), Event.BLUR);
- waitGui.until(textEquals.locator(msgFormat.format(ID.MAX.val())).text(MSG_MAX));
+
waitGui.until(TextContainsCondition.getInstance().locator(msgFormat.format(ID.MAX.val())).text(MSG_MAX));
}
@Test
@@ -156,14 +158,14 @@
setAllCorrect();
selenium.mouseDownAt(sliderFormat.format(ID.MAX.val()), new
Point(POSITION.MORE_THAN_TWO.val(), 0));
- waitGui.until(textEquals.locator(msgFormat.format(ID.MAX.val())).text(MSG_MAX));
+
waitGui.until(TextContainsCondition.getInstance().locator(msgFormat.format(ID.MAX.val())).text(MSG_MAX));
}
@Test
public void testCustom() {
selenium.type(inputFormat.format(ID.CUSTOM.val()), WRONG_CUSTOM_VAL);
selenium.fireEvent(inputFormat.format(ID.CUSTOM.val()), Event.BLUR);
-
waitGui.until(textEquals.text(MSG_CUSTOM).locator(msgFormat.format(ID.CUSTOM.val())));
+
waitGui.until(TextContainsCondition.getInstance().text(MSG_CUSTOM).locator(msgFormat.format(ID.CUSTOM.val())));
}
@Test
@@ -171,7 +173,7 @@
setAllCorrect();
selenium.mouseDownAt(sliderFormat.format(ID.CUSTOM.val()), new
Point(POSITION.LESS_THAN_ZERO.val(), 0));
-
waitGui.until(textEquals.locator(msgFormat.format(ID.CUSTOM.val())).text(MSG_CUSTOM));
+
waitGui.until(TextContainsCondition.getInstance().locator(msgFormat.format(ID.CUSTOM.val())).text(MSG_CUSTOM));
}
@Test
@@ -187,6 +189,7 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-11264")
public void testAllWrong() {
setAllCorrect();
@@ -194,7 +197,7 @@
selenium.click(hCommandBtn);
- waitGui.until(textEquals.locator(msgFormat.format(ID.MIN.val())).text(MSG_MIN));
+
waitGui.until(TextContainsCondition.getInstance().locator(msgFormat.format(ID.MIN.val())).text(MSG_MIN));
Assert.assertEquals(selenium.getText(msgFormat.format(ID.MAX.val())), MSG_MAX);
Assert.assertEquals(selenium.getText(msgFormat.format(ID.CUSTOM.val())),
MSG_CUSTOM);
@@ -203,7 +206,7 @@
selenium.click(a4jCommandBtn);
- waitGui.until(textEquals.locator(msgFormat.format(ID.MIN.val())).text(MSG_MIN));
+
waitGui.until(TextContainsCondition.getInstance().locator(msgFormat.format(ID.MIN.val())).text(MSG_MIN));
Assert.assertEquals(selenium.getText(msgFormat.format(ID.MAX.val())), MSG_MAX);
Assert.assertEquals(selenium.getText(msgFormat.format(ID.CUSTOM.val())),
MSG_CUSTOM);
}
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSpinner/TestRichSpinnerWithJSR303.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSpinner/TestRichSpinnerWithJSR303.java 2011-08-17
11:25:52 UTC (rev 22638)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSpinner/TestRichSpinnerWithJSR303.java 2011-08-17
12:16:51 UTC (rev 22639)
@@ -28,7 +28,9 @@
import org.jboss.test.selenium.geometry.Point;
import org.jboss.test.selenium.locator.JQueryLocator;
import org.jboss.test.selenium.utils.URLUtils;
+import org.jboss.test.selenium.waiting.TextContainsCondition;
import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
+import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
import org.testng.Assert;
import org.testng.annotations.Test;
@@ -108,7 +110,7 @@
selenium.fireEvent(inputFormat.format(ID.CUSTOM.val()), Event.BLUR);
// wait until validation appears on last input before go ahead (e.g. submit
form)
-
waitGui.until(textEquals.text(MSG_CUSTOM).locator(msgFormat.format(ID.CUSTOM.val())));
+
waitGui.until(TextContainsCondition.getInstance().text(MSG_CUSTOM).locator(msgFormat.format(ID.CUSTOM.val())));
}
private void spinUp(ID inputId, String toValue) {
@@ -146,7 +148,7 @@
public void testMin() {
selenium.type(inputFormat.format(ID.MIN.val()), WRONG_MIN_VAL);
selenium.fireEvent(inputFormat.format(ID.MIN.val()), Event.BLUR);
- waitGui.until(textEquals.locator(msgFormat.format(ID.MIN.val())).text(MSG_MIN));
+
waitGui.until(TextContainsCondition.getInstance().locator(msgFormat.format(ID.MIN.val())).text(MSG_MIN));
}
@Test
@@ -155,14 +157,14 @@
selenium.fireEvent(inputFormat.format(ID.MIN.val()), Event.BLUR);
spinDown(ID.MIN, WRONG_MIN_VAL);
- waitGui.until(textEquals.locator(msgFormat.format(ID.MIN.val())).text(MSG_MIN));
+
waitGui.until(TextContainsCondition.getInstance().locator(msgFormat.format(ID.MIN.val())).text(MSG_MIN));
}
@Test
public void testMax() {
selenium.type(inputFormat.format(ID.MAX.val()), WRONG_MAX_VAL);
selenium.fireEvent(inputFormat.format(ID.MAX.val()), Event.BLUR);
- waitGui.until(textEquals.locator(msgFormat.format(ID.MAX.val())).text(MSG_MAX));
+
waitGui.until(TextContainsCondition.getInstance().locator(msgFormat.format(ID.MAX.val())).text(MSG_MAX));
}
@Test
@@ -171,14 +173,14 @@
selenium.fireEvent(inputFormat.format(ID.MAX.val()), Event.BLUR);
spinUp(ID.MAX, WRONG_MAX_VAL);
- waitGui.until(textEquals.locator(msgFormat.format(ID.MAX.val())).text(MSG_MAX));
+
waitGui.until(TextContainsCondition.getInstance().locator(msgFormat.format(ID.MAX.val())).text(MSG_MAX));
}
@Test
public void testCustom() {
selenium.type(inputFormat.format(ID.CUSTOM.val()), WRONG_CUSTOM_VAL);
selenium.fireEvent(inputFormat.format(ID.CUSTOM.val()), Event.BLUR);
-
waitGui.until(textEquals.text(MSG_CUSTOM).locator(msgFormat.format(ID.CUSTOM.val())));
+
waitGui.until(TextContainsCondition.getInstance().text(MSG_CUSTOM).locator(msgFormat.format(ID.CUSTOM.val())));
}
@Test
@@ -187,7 +189,7 @@
selenium.fireEvent(inputFormat.format(ID.CUSTOM.val()), Event.BLUR);
spinDown(ID.CUSTOM, WRONG_CUSTOM_VAL);
-
waitGui.until(textEquals.text(MSG_CUSTOM).locator(msgFormat.format(ID.CUSTOM.val())));
+
waitGui.until(TextContainsCondition.getInstance().text(MSG_CUSTOM).locator(msgFormat.format(ID.CUSTOM.val())));
}
@Test
@@ -195,12 +197,13 @@
setAllCorrect();
-
waitGui.until(textEquals.text(CORRECT_MIN_VAL).locator(outputFormat.format(ID.MIN.val())));
+
waitGui.until(TextContainsCondition.getInstance().text(CORRECT_MIN_VAL).locator(outputFormat.format(ID.MIN.val())));
Assert.assertEquals(selenium.getText(outputFormat.format(ID.MAX.val())),
CORRECT_MAX_VAL);
Assert.assertEquals(selenium.getText(outputFormat.format(ID.CUSTOM.val())),
CORRECT_CUSTOM_VAL);
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-11264")
public void testAllWrong() {
setAllCorrect();
@@ -208,7 +211,7 @@
selenium.click(hCommandBtn);
- waitGui.until(textEquals.locator(msgFormat.format(ID.MIN.val())).text(MSG_MIN));
+
waitGui.until(TextContainsCondition.getInstance().locator(msgFormat.format(ID.MIN.val())).text(MSG_MIN));
Assert.assertEquals(selenium.getText(msgFormat.format(ID.MAX.val())), MSG_MAX);
Assert.assertEquals(selenium.getText(msgFormat.format(ID.CUSTOM.val())),
MSG_CUSTOM);
@@ -217,7 +220,7 @@
selenium.click(a4jCommandBtn);
- waitGui.until(textEquals.locator(msgFormat.format(ID.MIN.val())).text(MSG_MIN));
+
waitGui.until(TextContainsCondition.getInstance().locator(msgFormat.format(ID.MIN.val())).text(MSG_MIN));
Assert.assertEquals(selenium.getText(msgFormat.format(ID.MAX.val())), MSG_MAX);
Assert.assertEquals(selenium.getText(msgFormat.format(ID.CUSTOM.val())),
MSG_CUSTOM);
}