JBoss Rich Faces SVN: r22641 - in modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest: richInplaceInput and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: jpapouse
Date: 2011-08-17 11:47:16 -0400 (Wed, 17 Aug 2011)
New Revision: 22641
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/TestAutocompleteByKeys.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceInput/TestRichInplaceInput.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestRichInplaceSelect.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSlider/TestRichSlider.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSpinner/TestRichSpinner.java
Log:
added issue tracking
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/TestAutocompleteByKeys.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/TestAutocompleteByKeys.java 2011-08-17 15:06:31 UTC (rev 22640)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/TestAutocompleteByKeys.java 2011-08-17 15:47:16 UTC (rev 22641)
@@ -81,6 +81,7 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-11323")
public void testTypingPrefixAndThenConfirm() {
assertCompletionVisible(false);
typePrefix("ala");
@@ -91,6 +92,7 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-11323")
public void testTypingPrefixAndThenDeleteAll() {
assertCompletionVisible(false);
typePrefix("ala");
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceInput/TestRichInplaceInput.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceInput/TestRichInplaceInput.java 2011-08-17 15:06:31 UTC (rev 22640)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceInput/TestRichInplaceInput.java 2011-08-17 15:47:16 UTC (rev 22641)
@@ -427,6 +427,7 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-10980")
public void testTabindex() {
AttributeLocator<?> attr = input.getAttribute(new Attribute("tabindex"));
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestRichInplaceSelect.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestRichInplaceSelect.java 2011-08-17 15:06:31 UTC (rev 22640)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestRichInplaceSelect.java 2011-08-17 15:47:16 UTC (rev 22641)
@@ -623,6 +623,7 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-10980")
public void testTabindex() {
AttributeLocator<?> attr = input.getAttribute(new Attribute("tabindex"));
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSlider/TestRichSlider.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSlider/TestRichSlider.java 2011-08-17 15:06:31 UTC (rev 22640)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSlider/TestRichSlider.java 2011-08-17 15:47:16 UTC (rev 22641)
@@ -131,6 +131,7 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-11315")
public void testAccesskey() {
testHtmlAttribute(input, "accesskey", "x");
}
@@ -614,6 +615,7 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-10980")
public void testTabindex() {
selenium.type(pjq("input[id$=tabindexInput]"), "55");
selenium.waitForPageToLoad(TIMEOUT);
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSpinner/TestRichSpinner.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSpinner/TestRichSpinner.java 2011-08-17 15:06:31 UTC (rev 22640)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSpinner/TestRichSpinner.java 2011-08-17 15:47:16 UTC (rev 22641)
@@ -109,6 +109,7 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-11315")
public void testAccesskey() {
testHtmlAttribute(input, "accesskey", "x");
}
@@ -476,6 +477,7 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-10980")
public void testTabindex() {
testHtmlAttribute(input, "tabindex", "57");
}
13 years, 4 months
JBoss Rich Faces SVN: r22640 - in modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest: richSelect and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: jpapouse
Date: 2011-08-17 11:06:31 -0400 (Wed, 17 Aug 2011)
New Revision: 22640
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestRichInplaceSelect.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestRichInplaceSelectFAjax.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestSelectsWithJSR303.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richSelect/TestRichSelect.java
Log:
added issue tracking and tried to fix JSR 303 tests for inplace select (not tested)
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestRichInplaceSelect.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestRichInplaceSelect.java 2011-08-17 12:16:51 UTC (rev 22639)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestRichInplaceSelect.java 2011-08-17 15:06:31 UTC (rev 22640)
@@ -76,7 +76,7 @@
}
@Test
- @IssueTracking("https://issues.jboss.org/browse/RF-9664")
+ @IssueTracking("https://issues.jboss.org/browse/RF-11227")
public void testClick() {
guardNoRequest(selenium).click(select);
assertFalse(selenium.belongsClass(edit, "rf-is-none"), "Edit should not contain class rf-is-none when popup is open.");
@@ -104,6 +104,7 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-11227")
public void testChangedClass() {
selenium.type(pjq("input[id$=changedClassInput]"), "metamer-ftest-class");
selenium.waitForPageToLoad();
@@ -172,6 +173,7 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-11227")
public void testActiveClass() {
selenium.type(pjq("input[id$=activeClassInput]"), "metamer-ftest-class");
selenium.waitForPageToLoad();
@@ -187,6 +189,7 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-11227")
public void testImmediate() {
selenium.click(pjq("input[type=radio][name$=immediateInput][value=true]"));
selenium.waitForPageToLoad();
@@ -271,7 +274,7 @@
}
@Test
- @IssueTracking("https://issues.jboss.org/browse/RF-9849")
+ @IssueTracking("https://issues.jboss.org/browse/RF-11227")
public void testOnblur() {
selenium.type(pjq("input[id$=onblurInput]"), "metamerEvents += \"blur \"");
selenium.waitForPageToLoad(TIMEOUT);
@@ -283,7 +286,7 @@
}
@Test
- @IssueTracking("https://issues.jboss.org/browse/RF-9571")
+ @IssueTracking("https://issues.jboss.org/browse/RF-11227")
public void testOnchange() {
selenium.type(pjq("input[type=text][id$=onchangeInput]"), "metamerEvents += \"change \"");
selenium.waitForPageToLoad();
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestRichInplaceSelectFAjax.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestRichInplaceSelectFAjax.java 2011-08-17 12:16:51 UTC (rev 22639)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestRichInplaceSelectFAjax.java 2011-08-17 15:06:31 UTC (rev 22640)
@@ -61,7 +61,7 @@
}
@Test
- @IssueTracking("https://issues.jboss.org/browse/RF-10538")
+ @IssueTracking("https://issues.jboss.org/browse/RF-11227")
public void testClick() {
guardNoRequest(selenium).click(select);
assertFalse(selenium.belongsClass(edit, "rf-is-none"), "Edit should not contain class rf-is-none when popup is open.");
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestSelectsWithJSR303.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestSelectsWithJSR303.java 2011-08-17 12:16:51 UTC (rev 22639)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestSelectsWithJSR303.java 2011-08-17 15:06:31 UTC (rev 22640)
@@ -26,6 +26,7 @@
import org.jboss.test.selenium.dom.Event;
import org.jboss.test.selenium.locator.Attribute;
import org.jboss.test.selenium.locator.JQueryLocator;
+import org.jboss.test.selenium.waiting.TextContainsCondition;
import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
/**
@@ -103,9 +104,9 @@
selenium.click(notEmptySelect.getDescendant(optionEmpty));
selenium.fireEvent(notEmptyInput, Event.BLUR);
// give selenium time set new value to appropriate field before submit
- waitGui.until(textEquals.locator(input1Msg).text(NOT_EMPTY_VALIDATION_MSG));
+ waitGui.until(TextContainsCondition.getInstance().locator(input1Msg).text(NOT_EMPTY_VALIDATION_MSG));
selenium.click(a4jCommandButton);
- waitAjax.until(textEquals.locator(input1Msg).text(NOT_EMPTY_VALIDATION_MSG));
+ waitAjax.until(TextContainsCondition.getInstance().locator(input1Msg).text(NOT_EMPTY_VALIDATION_MSG));
setAllCorrect();
@@ -113,10 +114,10 @@
selenium.click(notEmptySelect.getDescendant(optionEmpty));
selenium.fireEvent(notEmptyInput, Event.BLUR);
// give selenium time set new value to appropriate field before submit
- waitGui.until(textEquals.locator(input1Msg).text(NOT_EMPTY_VALIDATION_MSG));
+ waitGui.until(TextContainsCondition.getInstance().locator(input1Msg).text(NOT_EMPTY_VALIDATION_MSG));
selenium.click(hCommandButton);
selenium.waitForPageToLoad();
- waitGui.until(textEquals.locator(input1Msg).text(NOT_EMPTY_VALIDATION_MSG));
+ waitGui.until(TextContainsCondition.getInstance().locator(input1Msg).text(NOT_EMPTY_VALIDATION_MSG));
}
protected void verifyRegExpPattern() {
@@ -126,9 +127,9 @@
selenium.click(regExpPatternSelect.getDescendant(option.format(WRONG_REG_EXP)));
selenium.fireEvent(regExpPatternInput, Event.BLUR);
// give selenium time set new value to appropriate field before submit
- waitGui.until(textEquals.locator(input2Msg).text(REGEXP_VALIDATION_MSG));
+ waitGui.until(TextContainsCondition.getInstance().locator(input2Msg).text(REGEXP_VALIDATION_MSG));
selenium.click(a4jCommandButton);
- waitGui.until(textEquals.locator(input2Msg).text(REGEXP_VALIDATION_MSG));
+ waitGui.until(TextContainsCondition.getInstance().locator(input2Msg).text(REGEXP_VALIDATION_MSG));
setAllCorrect();
@@ -136,10 +137,10 @@
selenium.click(regExpPatternSelect.getDescendant(option.format(WRONG_REG_EXP)));
selenium.fireEvent(regExpPatternInput, Event.BLUR);
// give selenium time set new value to appropriate field before submit
- waitGui.until(textEquals.locator(input2Msg).text(REGEXP_VALIDATION_MSG));
+ waitGui.until(TextContainsCondition.getInstance().locator(input2Msg).text(REGEXP_VALIDATION_MSG));
selenium.click(hCommandButton);
selenium.waitForPageToLoad();
- waitGui.until(textEquals.locator(input2Msg).text(REGEXP_VALIDATION_MSG));
+ waitGui.until(TextContainsCondition.getInstance().locator(input2Msg).text(REGEXP_VALIDATION_MSG));
}
protected void verifyStringSize() {
@@ -149,9 +150,9 @@
selenium.click(stringSizeSelect.getDescendant(option.format(WRONG_STRING_SIZE)));
selenium.fireEvent(stringSizeInput, Event.BLUR);
// give selenium time set new value to appropriate field before submit
- waitGui.until(textEquals.locator(input3Msg).text(STRING_SIZE_VALIDATION_MSG));
+ waitGui.until(TextContainsCondition.getInstance().locator(input3Msg).text(STRING_SIZE_VALIDATION_MSG));
selenium.click(a4jCommandButton);
- waitGui.until(textEquals.locator(input3Msg).text(STRING_SIZE_VALIDATION_MSG));
+ waitGui.until(TextContainsCondition.getInstance().locator(input3Msg).text(STRING_SIZE_VALIDATION_MSG));
setAllCorrect();
@@ -159,10 +160,10 @@
selenium.click(stringSizeSelect.getDescendant(option.format(WRONG_STRING_SIZE)));
selenium.fireEvent(stringSizeInput, Event.BLUR);
// give selenium time set new value to appropriate field before submit
- waitGui.until(textEquals.locator(input3Msg).text(STRING_SIZE_VALIDATION_MSG));
+ waitGui.until(TextContainsCondition.getInstance().locator(input3Msg).text(STRING_SIZE_VALIDATION_MSG));
selenium.click(hCommandButton);
selenium.waitForPageToLoad();
- waitGui.until(textEquals.locator(input3Msg).text(STRING_SIZE_VALIDATION_MSG));
+ waitGui.until(TextContainsCondition.getInstance().locator(input3Msg).text(STRING_SIZE_VALIDATION_MSG));
}
protected void verifyCustomString() {
@@ -172,9 +173,9 @@
selenium.click(customStringSelect.getDescendant(option.format(WRONG_CUSTOM_STRING)));
selenium.fireEvent(customStringInput, Event.BLUR);
// give selenium time set new value to appropriate field before submit
- waitGui.until(textEquals.locator(input4Msg).text(CUSTOM_STRING_VALIDATION_MSG));
+ waitGui.until(TextContainsCondition.getInstance().locator(input4Msg).text(CUSTOM_STRING_VALIDATION_MSG));
selenium.click(a4jCommandButton);
- waitGui.until(textEquals.locator(input4Msg).text(CUSTOM_STRING_VALIDATION_MSG));
+ waitGui.until(TextContainsCondition.getInstance().locator(input4Msg).text(CUSTOM_STRING_VALIDATION_MSG));
setAllCorrect();
@@ -182,10 +183,10 @@
selenium.click(customStringSelect.getDescendant(option.format(WRONG_CUSTOM_STRING)));
selenium.fireEvent(customStringInput, Event.BLUR);
// give selenium time set new value to appropriate field before submit
- waitGui.until(textEquals.locator(input4Msg).text(CUSTOM_STRING_VALIDATION_MSG));
+ waitGui.until(TextContainsCondition.getInstance().locator(input4Msg).text(CUSTOM_STRING_VALIDATION_MSG));
selenium.click(hCommandButton);
selenium.waitForPageToLoad();
- waitGui.until(textEquals.locator(input4Msg).text(CUSTOM_STRING_VALIDATION_MSG));
+ waitGui.until(TextContainsCondition.getInstance().locator(input4Msg).text(CUSTOM_STRING_VALIDATION_MSG));
}
protected void verifyRequired() {
@@ -195,9 +196,9 @@
selenium.click(requiredSelect.getDescendant(optionEmpty));
selenium.fireEvent(requiredInput, Event.BLUR);
// give selenium time set new value to appropriate field before submit
- // waitGui.until(textEquals.locator(input5Msg).text(REQUIRED_VALIDATION_MSG));
+ // waitGui.until(TextContainsCondition.getInstance().locator(input5Msg).text(REQUIRED_VALIDATION_MSG));
selenium.click(a4jCommandButton);
- waitGui.until(textEquals.locator(input5Msg).text(REQUIRED_VALIDATION_MSG));
+ waitGui.until(TextContainsCondition.getInstance().locator(input5Msg).text(REQUIRED_VALIDATION_MSG));
setAllCorrect();
@@ -205,10 +206,10 @@
selenium.click(requiredSelect.getDescendant(optionEmpty));
selenium.fireEvent(requiredInput, Event.BLUR);
// give selenium time set new value to appropriate field before submit
- waitGui.until(textEquals.locator(input5Msg).text(REQUIRED_VALIDATION_MSG));
+ waitGui.until(TextContainsCondition.getInstance().locator(input5Msg).text(REQUIRED_VALIDATION_MSG));
selenium.click(hCommandButton);
selenium.waitForPageToLoad();
- waitGui.until(textEquals.locator(input5Msg).text(REQUIRED_VALIDATION_MSG));
+ waitGui.until(TextContainsCondition.getInstance().locator(input5Msg).text(REQUIRED_VALIDATION_MSG));
}
@@ -217,22 +218,22 @@
setAllWrong();
selenium.click(a4jCommandButton);
- waitGui.until(textEquals.locator(input1Msg).text(NOT_EMPTY_VALIDATION_MSG));
- waitGui.until(textEquals.locator(input2Msg).text(REGEXP_VALIDATION_MSG));
- waitGui.until(textEquals.locator(input3Msg).text(STRING_SIZE_VALIDATION_MSG));
- waitGui.until(textEquals.locator(input4Msg).text(CUSTOM_STRING_VALIDATION_MSG));
- waitGui.until(textEquals.locator(input5Msg).text(REQUIRED_VALIDATION_MSG));
+ waitGui.until(TextContainsCondition.getInstance().locator(input1Msg).text(NOT_EMPTY_VALIDATION_MSG));
+ waitGui.until(TextContainsCondition.getInstance().locator(input2Msg).text(REGEXP_VALIDATION_MSG));
+ waitGui.until(TextContainsCondition.getInstance().locator(input3Msg).text(STRING_SIZE_VALIDATION_MSG));
+ waitGui.until(TextContainsCondition.getInstance().locator(input4Msg).text(CUSTOM_STRING_VALIDATION_MSG));
+ waitGui.until(TextContainsCondition.getInstance().locator(input5Msg).text(REQUIRED_VALIDATION_MSG));
setAllCorrect();
setAllWrong();
selenium.click(hCommandButton);
selenium.waitForPageToLoad();
- waitGui.until(textEquals.locator(input1Msg).text(NOT_EMPTY_VALIDATION_MSG));
- waitGui.until(textEquals.locator(input2Msg).text(REGEXP_VALIDATION_MSG));
- waitGui.until(textEquals.locator(input3Msg).text(STRING_SIZE_VALIDATION_MSG));
- waitGui.until(textEquals.locator(input4Msg).text(CUSTOM_STRING_VALIDATION_MSG));
- waitGui.until(textEquals.locator(input5Msg).text(REQUIRED_VALIDATION_MSG));
+ waitGui.until(TextContainsCondition.getInstance().locator(input1Msg).text(NOT_EMPTY_VALIDATION_MSG));
+ waitGui.until(TextContainsCondition.getInstance().locator(input2Msg).text(REGEXP_VALIDATION_MSG));
+ waitGui.until(TextContainsCondition.getInstance().locator(input3Msg).text(STRING_SIZE_VALIDATION_MSG));
+ waitGui.until(TextContainsCondition.getInstance().locator(input4Msg).text(CUSTOM_STRING_VALIDATION_MSG));
+ waitGui.until(TextContainsCondition.getInstance().locator(input5Msg).text(REQUIRED_VALIDATION_MSG));
}
protected void verifyAllInputsCorrect() {
@@ -246,15 +247,15 @@
selenium.click(hCommandButton);
selenium.waitForPageToLoad();
- waitGui.until(textEquals.locator(outputFormat.format(NOT_EMPTY_ID))
+ waitGui.until(TextContainsCondition.getInstance().locator(outputFormat.format(NOT_EMPTY_ID))
.text(CORRECT_NOT_EMPTY));
- waitGui.until(textEquals.locator(outputFormat.format(REG_EXP_PATTERN_ID))
+ waitGui.until(TextContainsCondition.getInstance().locator(outputFormat.format(REG_EXP_PATTERN_ID))
.text(CORRECT_REG_EXP));
- waitGui.until(textEquals.locator(outputFormat.format(STRING_SIZE_ID))
+ waitGui.until(TextContainsCondition.getInstance().locator(outputFormat.format(STRING_SIZE_ID))
.text(CORRECT_STRING_SIZE));
- waitGui.until(textEquals.locator(outputFormat.format(CUSTOM_STRING_ID))
+ waitGui.until(TextContainsCondition.getInstance().locator(outputFormat.format(CUSTOM_STRING_ID))
.text(CORRECT_CUSTOM_STRING));
- waitGui.until(textEquals.locator(outputFormat.format(REQUIRED_ID))
+ waitGui.until(TextContainsCondition.getInstance().locator(outputFormat.format(REQUIRED_ID))
.text(CORRECT_REQUIRED_STRING));
// with ajax form submit
@@ -262,15 +263,15 @@
setAllCorrect();
// no submit button click need, values in output fields are updated
- waitGui.until(textEquals.locator(outputFormat.format(NOT_EMPTY_ID))
+ waitGui.until(TextContainsCondition.getInstance().locator(outputFormat.format(NOT_EMPTY_ID))
.text(CORRECT_NOT_EMPTY));
- waitGui.until(textEquals.locator(outputFormat.format(REG_EXP_PATTERN_ID))
+ waitGui.until(TextContainsCondition.getInstance().locator(outputFormat.format(REG_EXP_PATTERN_ID))
.text(CORRECT_REG_EXP));
- waitGui.until(textEquals.locator(outputFormat.format(STRING_SIZE_ID))
+ waitGui.until(TextContainsCondition.getInstance().locator(outputFormat.format(STRING_SIZE_ID))
.text(CORRECT_STRING_SIZE));
- waitGui.until(textEquals.locator(outputFormat.format(CUSTOM_STRING_ID))
+ waitGui.until(TextContainsCondition.getInstance().locator(outputFormat.format(CUSTOM_STRING_ID))
.text(CORRECT_CUSTOM_STRING));
- waitGui.until(textEquals.locator(outputFormat.format(REQUIRED_ID))
+ waitGui.until(TextContainsCondition.getInstance().locator(outputFormat.format(REQUIRED_ID))
.text(CORRECT_REQUIRED_STRING));
}
@@ -278,7 +279,7 @@
selenium.click(notEmptyInput);
selenium.click(notEmptySelect.getDescendant(optionEmpty));
- waitGui.until(textEquals.locator(notEmptyInput).text(WRONG_NOT_EMPTY));
+ waitGui.until(TextContainsCondition.getInstance().locator(notEmptyInput).text(WRONG_NOT_EMPTY));
selenium.fireEvent(notEmptyInput, Event.BLUR);
selenium.click(regExpPatternInput);
@@ -297,7 +298,7 @@
selenium.click(requiredSelect.getDescendant(optionEmpty));
selenium.fireEvent(requiredInput, Event.BLUR);
- waitGui.until(textEquals.locator(input5Msg).text(REQUIRED_VALIDATION_MSG));
+ waitGui.until(TextContainsCondition.getInstance().locator(input5Msg).text(REQUIRED_VALIDATION_MSG));
}
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 2011-08-17 12:16:51 UTC (rev 22639)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richSelect/TestRichSelect.java 2011-08-17 15:06:31 UTC (rev 22640)
@@ -125,7 +125,7 @@
}
@Test
- @IssueTracking("https://issues.jboss.org/browse/RF-11163")
+ @IssueTracking("https://issues.jboss.org/browse/RF-11320")
public void testFiltering() {
selenium.focus(input);
guardNoRequest(selenium).keyPress(input, "a");
@@ -453,6 +453,7 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-11320")
public void testSelectFirst() {
selenium.click(pjq("input[type=radio][name$=selectFirstInput][value=true]"));
selenium.waitForPageToLoad();
13 years, 4 months
JBoss Rich Faces SVN: r22639 - in modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest: richInputNumberSpinner and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
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);
}
13 years, 4 months
JBoss Rich Faces SVN: r22638 - in modules/tests/metamer/trunk/ftest-source/src/main/java/org: richfaces/tests/metamer/ftest/richSelect and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: jpapouse
Date: 2011-08-17 07:25:52 -0400 (Wed, 17 Aug 2011)
New Revision: 22638
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/jboss/test/selenium/waiting/TextContainsCondition.java
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richSelect/TestSelectWithJSR303.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richSelect/TestSelectsWithJSR303.java
Log:
fixed JSR 303 selenium tests for rich:select component to accept messages from myfaces (are prefixed by form input identifier)
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/jboss/test/selenium/waiting/TextContainsCondition.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/jboss/test/selenium/waiting/TextContainsCondition.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/jboss/test/selenium/waiting/TextContainsCondition.java 2011-08-17 11:25:52 UTC (rev 22638)
@@ -0,0 +1,125 @@
+package org.jboss.test.selenium.waiting;
+
+import static org.apache.commons.lang.StringEscapeUtils.escapeJavaScript;
+import static org.jboss.test.selenium.encapsulated.JavaScript.js;
+import static org.jboss.test.selenium.utils.text.SimplifiedFormat.format;
+
+import org.apache.commons.lang.Validate;
+import org.jboss.test.selenium.encapsulated.JavaScript;
+import org.jboss.test.selenium.framework.AjaxSelenium;
+import org.jboss.test.selenium.framework.AjaxSeleniumProxy;
+import org.jboss.test.selenium.locator.ElementLocator;
+import org.jboss.test.selenium.waiting.ajax.JavaScriptCondition;
+import org.jboss.test.selenium.waiting.conditions.TextEquals;
+import org.jboss.test.selenium.waiting.selenium.SeleniumCondition;
+
+/**
+ *
+ * <p>
+ * Implementation of Condition for waiting if element given by elementLocator has text containing the given text.
+ * </p>
+ *
+ * <p>
+ * Implements Condition and JavaScriptCondition used in SeleniumWaiting and AjaxWaiting.
+ * </p>
+ *
+ * @author <a href="mailto:jpapouse@redhat.com">Jan Papousek</a>
+ * @version $Revision$
+ */
+public class TextContainsCondition implements SeleniumCondition, JavaScriptCondition {
+
+ /**
+ * Proxy to local selenium instance
+ */
+ private AjaxSelenium selenium = AjaxSeleniumProxy.getInstance();
+
+ /** The element locator. */
+ private ElementLocator<?> elementLocator;
+
+ /** The text. */
+ private String text;
+
+ /**
+ * Instantiates a new text equals.
+ */
+ protected TextContainsCondition() {
+ }
+
+
+ @Override
+ public JavaScript getJavaScriptCondition() {
+ String escapedLocator = escapeJavaScript(this.elementLocator.getAsString());
+ String escapedText = escapeJavaScript(this.text);
+ return js(format("selenium.isElementPresent('{0}') && (selenium.getText('{0}').indexOf('{1}') != -1)", escapedLocator,
+ escapedText));
+ }
+
+ /**
+ * Factory method.
+ *
+ * @return single instance of TextContainsCondition
+ */
+ public static TextContainsCondition getInstance() {
+ return new TextContainsCondition();
+ }
+
+ @Override
+ public boolean isTrue() {
+ Validate.notNull(elementLocator);
+ Validate.notNull(text);
+ return selenium.getText(elementLocator).contains(text);
+ }
+
+ /**
+ * <p>
+ * Returns the TextContainsCondition instance with given elementLocator set.
+ * </p>
+ *
+ * <p>
+ * From this locator will be obtained the text.
+ * </p>
+ *
+ * @param elementLocator
+ * the element locator
+ * @return the TextContainsCondition object with preset locator
+ */
+ public TextContainsCondition locator(ElementLocator<?> elementLocator) {
+ Validate.notNull(elementLocator);
+
+ TextContainsCondition copy = copy();
+ copy.elementLocator = elementLocator;
+
+ return copy;
+ }
+
+ /**
+ * <p>
+ * Returns the TextContainsCondition instance with text set.
+ * </p>
+ *
+ * @param text
+ * it should wait for the containg
+ * @return the TextContainsCondition object with preset text
+ */
+ public TextContainsCondition text(String text) {
+ Validate.notNull(text);
+
+ TextContainsCondition copy = copy();
+ copy.text = text;
+
+ return copy;
+ }
+
+ /**
+ * Returns the exact copy of this ElementPresent object.
+ *
+ * @return the copy of this TextContainsCondition object
+ */
+ private TextContainsCondition copy() {
+ TextContainsCondition copy = new TextContainsCondition();
+ copy.elementLocator = elementLocator;
+ copy.text = text;
+ return copy;
+ }
+
+}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richSelect/TestSelectWithJSR303.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richSelect/TestSelectWithJSR303.java 2011-08-17 08:07:59 UTC (rev 22637)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richSelect/TestSelectWithJSR303.java 2011-08-17 11:25:52 UTC (rev 22638)
@@ -24,6 +24,7 @@
import java.net.URL;
import org.jboss.test.selenium.utils.URLUtils;
+import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
import org.testng.annotations.Test;
/**
@@ -60,6 +61,7 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-11264")
public void testAllInputsWrong() {
verifyAllInputsWrong();
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richSelect/TestSelectsWithJSR303.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richSelect/TestSelectsWithJSR303.java 2011-08-17 08:07:59 UTC (rev 22637)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richSelect/TestSelectsWithJSR303.java 2011-08-17 11:25:52 UTC (rev 22638)
@@ -26,6 +26,7 @@
import org.jboss.test.selenium.dom.Event;
import org.jboss.test.selenium.locator.Attribute;
import org.jboss.test.selenium.locator.JQueryLocator;
+import org.jboss.test.selenium.waiting.TextContainsCondition;
import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
/**
@@ -99,9 +100,13 @@
selenium.click(notEmptySelect.getDescendant(optionEmpty));
selenium.fireEvent(notEmptyInput, Event.BLUR);
// give selenium time set new value to appropriate field before submit
- waitGui.until(textEquals.locator(input1Msg).text(NOT_EMPTY_VALIDATION_MSG));
+ waitGui
+ .failWith("After selecting empty value, the correct message is not displayed.")
+ .until(TextContainsCondition.getInstance().locator(input1Msg).text(NOT_EMPTY_VALIDATION_MSG));
selenium.click(a4jCommandButton);
- waitAjax.until(textEquals.locator(input1Msg).text(NOT_EMPTY_VALIDATION_MSG));
+ waitGui
+ .failWith("After submitting (a4j:commandButton) empty value, the correct message is not displayed.")
+ .until(TextContainsCondition.getInstance().locator(input1Msg).text(NOT_EMPTY_VALIDATION_MSG));
setAllCorrect();
@@ -109,10 +114,14 @@
selenium.click(notEmptySelect.getDescendant(optionEmpty));
selenium.fireEvent(notEmptyInput, Event.BLUR);
// give selenium time set new value to appropriate field before submit
- waitGui.until(textEquals.locator(input1Msg).text(NOT_EMPTY_VALIDATION_MSG));
+ waitGui
+ .failWith("After selecting empty value, the correct message is not displayed.")
+ .until(TextContainsCondition.getInstance().locator(input1Msg).text(NOT_EMPTY_VALIDATION_MSG));
selenium.click(hCommandButton);
selenium.waitForPageToLoad();
- waitGui.until(textEquals.locator(input1Msg).text(NOT_EMPTY_VALIDATION_MSG));
+ waitGui
+ .failWith("After submitting (h:commandButton) empty value, the correct message is not displayed.")
+ .until(TextContainsCondition.getInstance().locator(input1Msg).text(NOT_EMPTY_VALIDATION_MSG));
}
protected void verifyRegExpPattern() {
@@ -122,9 +131,13 @@
selenium.click(regExpPatternSelect.getDescendant(option.format(WRONG_REG_EXP)));
selenium.fireEvent(regExpPatternInput, Event.BLUR);
// give selenium time set new value to appropriate field before submit
- waitGui.until(textEquals.locator(input2Msg).text(REGEXP_VALIDATION_MSG));
+ waitGui
+ .failWith("After selecting value which doesn't match the given REGEXP, the correct message is not displayed.")
+ .until(TextContainsCondition.getInstance().locator(input2Msg).text(REGEXP_VALIDATION_MSG));
selenium.click(a4jCommandButton);
- waitGui.until(textEquals.locator(input2Msg).text(REGEXP_VALIDATION_MSG));
+ waitGui
+ .failWith("After submitting (a4j:commandButton) value which doesn't match the given REGEXP, the correct message is not displayed.")
+ .until(TextContainsCondition.getInstance().locator(input2Msg).text(REGEXP_VALIDATION_MSG));
setAllCorrect();
@@ -132,10 +145,14 @@
selenium.click(regExpPatternSelect.getDescendant(option.format(WRONG_REG_EXP)));
selenium.fireEvent(regExpPatternInput, Event.BLUR);
// give selenium time set new value to appropriate field before submit
- waitGui.until(textEquals.locator(input2Msg).text(REGEXP_VALIDATION_MSG));
+ waitGui
+ .failWith("After selecting value which doesn't match the given REGEXP, the correct message is not displayed.")
+ .until(TextContainsCondition.getInstance().locator(input2Msg).text(REGEXP_VALIDATION_MSG));
selenium.click(hCommandButton);
selenium.waitForPageToLoad();
- waitGui.until(textEquals.locator(input2Msg).text(REGEXP_VALIDATION_MSG));
+ waitGui
+ .failWith("After submitting (h:commandButton) value which doesn't match the given REGEXP, the correct message is not displayed.")
+ .until(TextContainsCondition.getInstance().locator(input2Msg).text(REGEXP_VALIDATION_MSG));
}
protected void verifyStringSize() {
@@ -145,9 +162,13 @@
selenium.click(stringSizeSelect.getDescendant(option.format(WRONG_STRING_SIZE)));
selenium.fireEvent(stringSizeInput, Event.BLUR);
// give selenium time set new value to appropriate field before submit
- waitGui.until(textEquals.locator(input3Msg).text(STRING_SIZE_VALIDATION_MSG));
+ waitGui
+ .failWith("After selecting string with wrong size, the correct message is not displayed.")
+ .until(TextContainsCondition.getInstance().locator(input3Msg).text(STRING_SIZE_VALIDATION_MSG));
selenium.click(a4jCommandButton);
- waitGui.until(textEquals.locator(input3Msg).text(STRING_SIZE_VALIDATION_MSG));
+ waitGui
+ .failWith("After submitting (a4j:commandButton) string with wrong size, the correct message is not displayed.")
+ .until(TextContainsCondition.getInstance().locator(input3Msg).text(STRING_SIZE_VALIDATION_MSG));
setAllCorrect();
@@ -155,10 +176,14 @@
selenium.click(stringSizeSelect.getDescendant(option.format(WRONG_STRING_SIZE)));
selenium.fireEvent(stringSizeInput, Event.BLUR);
// give selenium time set new value to appropriate field before submit
- waitGui.until(textEquals.locator(input3Msg).text(STRING_SIZE_VALIDATION_MSG));
+ waitGui
+ .failWith("After selecting string with wrong size, the correct message is not displayed.")
+ .until(TextContainsCondition.getInstance().locator(input3Msg).text(STRING_SIZE_VALIDATION_MSG));
selenium.click(hCommandButton);
selenium.waitForPageToLoad();
- waitGui.until(textEquals.locator(input3Msg).text(STRING_SIZE_VALIDATION_MSG));
+ waitGui
+ .failWith("After submitting (h:commandButton) string with wrong size, the correct message is not displayed.")
+ .until(TextContainsCondition.getInstance().locator(input3Msg).text(STRING_SIZE_VALIDATION_MSG));
}
protected void verifyCustomString() {
@@ -168,9 +193,13 @@
selenium.click(customStringSelect.getDescendant(option.format(WRONG_CUSTOM_STRING)));
selenium.fireEvent(customStringInput, Event.BLUR);
// give selenium time set new value to appropriate field before submit
- waitGui.until(textEquals.locator(input4Msg).text(CUSTOM_STRING_VALIDATION_MSG));
+ waitGui
+ .failWith("After selecting value which doesn't match the given string ('RichFaces'), the correct message is not displayed.")
+ .until(TextContainsCondition.getInstance().locator(input4Msg).text(CUSTOM_STRING_VALIDATION_MSG));
selenium.click(a4jCommandButton);
- waitGui.until(textEquals.locator(input4Msg).text(CUSTOM_STRING_VALIDATION_MSG));
+ waitGui
+ .failWith("After submitting (a4j:commandButton) value which doesn't match the given string ('RichFaces'), the correct message is not displayed.")
+ .until(TextContainsCondition.getInstance().locator(input4Msg).text(CUSTOM_STRING_VALIDATION_MSG));
setAllCorrect();
@@ -178,31 +207,50 @@
selenium.click(customStringSelect.getDescendant(option.format(WRONG_CUSTOM_STRING)));
selenium.fireEvent(customStringInput, Event.BLUR);
// give selenium time set new value to appropriate field before submit
- waitGui.until(textEquals.locator(input4Msg).text(CUSTOM_STRING_VALIDATION_MSG));
+ waitGui
+ .failWith("After selecting value which doesn't match the given string ('RichFaces'), the correct message is not displayed.")
+ .until(TextContainsCondition.getInstance().locator(input4Msg).text(CUSTOM_STRING_VALIDATION_MSG));
selenium.click(hCommandButton);
selenium.waitForPageToLoad();
- waitGui.until(textEquals.locator(input4Msg).text(CUSTOM_STRING_VALIDATION_MSG));
+ waitGui
+ .failWith("After submitting (h:commandButton) value which doesn't match the given string ('RichFaces'), the correct message is not displayed.")
+ .until(TextContainsCondition.getInstance().locator(input4Msg).text(CUSTOM_STRING_VALIDATION_MSG));
}
protected void verifyAllInputsWrong() {
setAllCorrect();
setAllWrong();
selenium.click(a4jCommandButton);
+ waitGui
+ .failWith("After submitting (a4j:commandButton) empty value, the correct message is not displayed.")
+ .until(TextContainsCondition.getInstance().locator(input1Msg).text(NOT_EMPTY_VALIDATION_MSG));
+ waitGui
+ .failWith("After submitting (a4j:commandButton) value which doesn't match the given REGEXP, the correct message is not displayed.")
+ .until(TextContainsCondition.getInstance().locator(input2Msg).text(REGEXP_VALIDATION_MSG));
+ waitGui
+ .failWith("After submitting (a4j:commandButton) string with wrong size, the correct message is not displayed.")
+ .until(TextContainsCondition.getInstance().locator(input3Msg).text(STRING_SIZE_VALIDATION_MSG));
+ waitGui
+ .failWith("After submitting (a4j:commandButton) value which doesn't match the given string ('RichFaces'), the correct message is not displayed.")
+ .until(TextContainsCondition.getInstance().locator(input4Msg).text(CUSTOM_STRING_VALIDATION_MSG));
- waitGui.until(textEquals.locator(input1Msg).text(NOT_EMPTY_VALIDATION_MSG));
- waitGui.until(textEquals.locator(input2Msg).text(REGEXP_VALIDATION_MSG));
- waitGui.until(textEquals.locator(input3Msg).text(STRING_SIZE_VALIDATION_MSG));
- waitGui.until(textEquals.locator(input4Msg).text(CUSTOM_STRING_VALIDATION_MSG));
-
setAllCorrect();
setAllWrong();
selenium.click(hCommandButton);
selenium.waitForPageToLoad();
- waitGui.until(textEquals.locator(input1Msg).text(NOT_EMPTY_VALIDATION_MSG));
- waitGui.until(textEquals.locator(input2Msg).text(REGEXP_VALIDATION_MSG));
- waitGui.until(textEquals.locator(input3Msg).text(STRING_SIZE_VALIDATION_MSG));
- waitGui.until(textEquals.locator(input4Msg).text(CUSTOM_STRING_VALIDATION_MSG));
+ waitGui
+ .failWith("After submitting (h:commandButton) empty value, the correct message is not displayed.")
+ .until(TextContainsCondition.getInstance().locator(input1Msg).text(NOT_EMPTY_VALIDATION_MSG));
+ waitGui
+ .failWith("After submitting (h:commandButton) value which doesn't match the given REGEXP, the correct message is not displayed.")
+ .until(TextContainsCondition.getInstance().locator(input2Msg).text(REGEXP_VALIDATION_MSG));
+ waitGui
+ .failWith("After submitting (h:commandButton) string with wrong size, the correct message is not displayed.")
+ .until(TextContainsCondition.getInstance().locator(input3Msg).text(STRING_SIZE_VALIDATION_MSG));
+ waitGui
+ .failWith("After submitting (h:commandButton) value which doesn't match the given string ('RichFaces'), the correct message is not displayed.")
+ .until(TextContainsCondition.getInstance().locator(input4Msg).text(CUSTOM_STRING_VALIDATION_MSG));
}
protected void verifyAllInputsCorrect() {
13 years, 4 months
JBoss Rich Faces SVN: r22637 - in modules/tests/metamer/trunk: application/src/main/webapp/components/richOrderingList and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: jpapouse
Date: 2011-08-17 04:07:59 -0400 (Wed, 17 Aug 2011)
New Revision: 22637
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichOrderingListBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richOrderingList/simple.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richOrderingList/withColumn.xhtml
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/AbstractOrderingListTest.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/TestOrderingListAttributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/TestOrderingListMoving.java
Log:
RFPL-1547:
- removed attribut 'showButton' from pages and tests containg ordering list
- updated tests of ordering list to check whether the selected item is surely selected
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichOrderingListBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichOrderingListBean.java 2011-08-16 16:07:23 UTC (rev 22636)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichOrderingListBean.java 2011-08-17 08:07:59 UTC (rev 22637)
@@ -70,7 +70,6 @@
attributes.setAttribute("listWidth", 300);
attributes.setAttribute("listHeight", 500);
attributes.setAttribute("rendered", true);
- attributes.setAttribute("showButton", true);
attributes.setAttribute("var", "capital");
attributes.setAttribute("upText", "Up");
attributes.setAttribute("upTopText", "First");
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richOrderingList/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richOrderingList/simple.xhtml 2011-08-16 16:07:23 UTC (rev 22636)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richOrderingList/simple.xhtml 2011-08-17 08:07:59 UTC (rev 22637)
@@ -81,7 +81,6 @@
required="#{richOrderingListBean.attributes['required'].value}"
requiredMessage="#{richOrderingListBean.attributes['requiredMessage'].value}"
selectItemClass="#{richOrderingListBean.attributes['selectItemClass'].value}"
- showButton="#{richOrderingListBean.attributes['showButton'].value}"
style="#{richOrderingListBean.attributes['style'].value}"
styleClass="#{richOrderingListBean.attributes['styleClass'].value}"
upText="#{richOrderingListBean.attributes['upText'].value}"
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richOrderingList/withColumn.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richOrderingList/withColumn.xhtml 2011-08-16 16:07:23 UTC (rev 22636)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richOrderingList/withColumn.xhtml 2011-08-17 08:07:59 UTC (rev 22637)
@@ -80,7 +80,6 @@
required="#{richOrderingListBean.attributes['required'].value}"
requiredMessage="#{richOrderingListBean.attributes['requiredMessage'].value}"
selectItemClass="#{richOrderingListBean.attributes['selectItemClass'].value}"
- showButton="#{richOrderingListBean.attributes['showButton'].value}"
style="#{richOrderingListBean.attributes['style'].value}"
styleClass="#{richOrderingListBean.attributes['styleClass'].value}"
upText="#{richOrderingListBean.attributes['upText'].value}"
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/AbstractOrderingListTest.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/AbstractOrderingListTest.java 2011-08-16 16:07:23 UTC (rev 22636)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/AbstractOrderingListTest.java 2011-08-17 08:07:59 UTC (rev 22637)
@@ -124,6 +124,11 @@
}
}
+ protected void selectItem(int index) {
+ getOrderingList().selectItem(index);
+ assertTrue(selenium.belongsClass(getOrderingList().getItem(index), "rf-ord-sel"), "After selecting an item, the item should belong to the class <rf-ord-sel>.");
+ }
+
private void checkColumnValuesSwapped(int indexA, String stateA, String cityA, int indexB, String stateB, String cityB) {
assertEquals(orderingList.getItemColumnValue(indexA, 0), stateB, "The rows weren't swapped succesfully after moving.");
assertEquals(orderingList.getItemColumnValue(indexA, 1), cityB, "The rows weren't swapped succesfully after moving.");
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/TestOrderingListAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/TestOrderingListAttributes.java 2011-08-16 16:07:23 UTC (rev 22636)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/TestOrderingListAttributes.java 2011-08-17 08:07:59 UTC (rev 22637)
@@ -73,6 +73,7 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-11317")
public void testItemClass() {
fillAttribute("itemClass", "some-class");
assertTrue(selenium.belongsClass(getOrderingList().getItem(0), "some-class"), "The attribute <itemClass> is set to <some-class>, but the first item doesn't belong to this class.");
@@ -112,23 +113,14 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-11310")
public void testSelectItemClass() {
fillAttribute("selectItemClass", "some-class");
- getOrderingList().selectItem(0);
+ selectItem(0);
assertTrue(selenium.belongsClass(getOrderingList().getItem(0), "some-class"), "The attribute <selectItemClass> is set to <some-class>, but it has no effect.");
}
@Test
- @IssueTracking("https://issues.jboss.org/browse/RF-11311")
- public void testShowButton() {
- fillAttribute("showButton", false);
- assertFalse(getOrderingList().isButtonBottomPresent(), "The attribute <showButton> is set <false>, but the button [bottom] is present.");
- assertFalse(getOrderingList().isButtonDownPresent(), "The attribute <showButton> is set <false>, but the button [down] is present.");
- assertFalse(getOrderingList().isButtonTopPresent(), "The attribute <showButton> is set <false>, but the button [top] is present.");
- assertFalse(getOrderingList().isButtonUpPresent(), "The attribute <showButton> is set <false>, but the button [up] is present.");
- }
-
- @Test
public void testStyle() {
super.testStyle(getOrderingList().getLocator(), "style");
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/TestOrderingListMoving.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/TestOrderingListMoving.java 2011-08-16 16:07:23 UTC (rev 22636)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/TestOrderingListMoving.java 2011-08-17 08:07:59 UTC (rev 22637)
@@ -42,49 +42,49 @@
@Test
public void testMoveFirstBottom() {
- getOrderingList().selectItem(0);
+ selectItem(0);
moveBottom();
}
@Test
public void testMoveFirstDown() {
- getOrderingList().selectItem(0);
+ selectItem(0);
moveDown();
}
@Test
public void testMoveLastTop() {
- getOrderingList().selectItem(getOrderingList().getNumberOfItems() - 1);
+ selectItem(getOrderingList().getNumberOfItems() - 1);
moveTop();
}
@Test
public void testMoveLastUp() {
- getOrderingList().selectItem(getOrderingList().getNumberOfItems() - 1);
+ selectItem(getOrderingList().getNumberOfItems() - 1);
moveUp();
}
@Test
public void testMoveMiddleBottom() {
- getOrderingList().selectItem(2);
+ selectItem(2);
moveBottom();
}
@Test
public void testMoveMiddleDown() {
- getOrderingList().selectItem(2);
+ selectItem(2);
moveDown();
}
@Test
public void testMoveMiddleTop() {
- getOrderingList().selectItem(2);
+ selectItem(2);
moveTop();
}
@Test
public void testMoveMiddleUp() {
- getOrderingList().selectItem(2);
+ selectItem(2);
moveUp();
}
13 years, 4 months
JBoss Rich Faces SVN: r22636 - in modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest: richCalendar and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2011-08-16 12:07:23 -0400 (Tue, 16 Aug 2011)
New Revision: 22636
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCalendar/TestRichCalendarAttributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceInput/TestRichInplaceInputFAjax.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSlider/TestRichSlider.java
Log:
issue tracking info added
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java 2011-08-16 14:00:20 UTC (rev 22635)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java 2011-08-16 16:07:23 UTC (rev 22636)
@@ -141,7 +141,6 @@
* @param millis
* number of miliseconds for which the thread will sleep
*/
- @Deprecated
protected void waitFor(long millis) {
try {
Thread.sleep(millis);
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCalendar/TestRichCalendarAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCalendar/TestRichCalendarAttributes.java 2011-08-16 14:00:20 UTC (rev 22635)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCalendar/TestRichCalendarAttributes.java 2011-08-16 16:07:23 UTC (rev 22636)
@@ -235,6 +235,7 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-11313")
public void testConverterMessage() {
JQueryLocator message = pjq("span[id$=msg] .rf-msg-det");
@@ -871,6 +872,7 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-10980")
public void testTabindexInput() {
testHtmlAttribute(input, "tabindex", "99");
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceInput/TestRichInplaceInputFAjax.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceInput/TestRichInplaceInputFAjax.java 2011-08-16 14:00:20 UTC (rev 22635)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceInput/TestRichInplaceInputFAjax.java 2011-08-16 16:07:23 UTC (rev 22636)
@@ -49,8 +49,6 @@
private JQueryLocator label = pjq("span.rf-ii-lbl");
private JQueryLocator input = pjq("input[id$=inplaceInputInput]");
private JQueryLocator edit = pjq("span.rf-ii-fld-cntr");
- private JQueryLocator okButton = pjq("input.rf-ii-btn[id$=Okbtn]");
- private JQueryLocator cancelButton = pjq("input.rf-ii-btn[id$=Cancelbtn]");
private JQueryLocator output = pjq("span[id$=output]");
@Override
@@ -61,22 +59,25 @@
@Test
public void testClick() {
guardNoRequest(selenium).click(inplaceInput);
- assertFalse(selenium.belongsClass(edit, "rf-ii-none"), "Edit should not contain class rf-ii-none when popup is open.");
+ assertFalse(selenium.belongsClass(edit, "rf-ii-none"),
+ "Edit should not contain class rf-ii-none when popup is open.");
assertTrue(selenium.isDisplayed(input), "Input should be displayed.");
selenium.type(input, "new value");
selenium.fireEvent(input, Event.BLUR);
assertTrue(selenium.belongsClass(inplaceInput, "rf-ii-chng"), "New class should be added to inplace input.");
- assertTrue(selenium.belongsClass(edit, "rf-ii-none"), "Edit should contain class rf-ii-none when popup is closed.");
+ assertTrue(selenium.belongsClass(edit, "rf-ii-none"),
+ "Edit should contain class rf-ii-none when popup is closed.");
assertEquals(selenium.getText(label), "new value", "Label should contain selected value.");
- assertEquals(selenium.getText(output), "new value", "Output did not change.");
-
+ waitGui.failWith("Output did not change.").until(textEquals.locator(output).text("new value"));
+
String listenerText = selenium.getText(jq("div#phasesPanel li:eq(3)"));
- assertEquals(listenerText, "*1 value changed: RichFaces 4 -> new value", "Value change listener was not invoked.");
+ assertEquals(listenerText, "*1 value changed: RichFaces 4 -> new value",
+ "Value change listener was not invoked.");
phaseInfo.assertPhases(PhaseId.RESTORE_VIEW, PhaseId.APPLY_REQUEST_VALUES, PhaseId.PROCESS_VALIDATIONS,
- PhaseId.UPDATE_MODEL_VALUES, PhaseId.INVOKE_APPLICATION, PhaseId.RENDER_RESPONSE);
+ PhaseId.UPDATE_MODEL_VALUES, PhaseId.INVOKE_APPLICATION, PhaseId.RENDER_RESPONSE);
phaseInfo.assertListener(PhaseId.PROCESS_VALIDATIONS, "value changed: RichFaces 4 -> new value");
}
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSlider/TestRichSlider.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSlider/TestRichSlider.java 2011-08-16 14:00:20 UTC (rev 22635)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSlider/TestRichSlider.java 2011-08-16 16:07:23 UTC (rev 22636)
@@ -112,6 +112,7 @@
@Test
@Override
+ @IssueTracking("https://issues.jboss.org/browse/RF-11314")
public void testClick() {
super.testClick();
}
@@ -182,7 +183,7 @@
selenium.click(selectOption);
selenium.waitForPageToLoad();
- AttributeLocator disabledAttribute = input.getAttribute(new Attribute("disabled"));
+ AttributeLocator<?> disabledAttribute = input.getAttribute(new Attribute("disabled"));
assertEquals(selenium.getAttribute(disabledAttribute), "disabled", "Input should be disabled.");
assertFalse(selenium.isElementPresent(handle), "Handle should not be present on the page.");
@@ -198,7 +199,7 @@
selenium.click(selectOption);
selenium.waitForPageToLoad();
- AttributeLocator readonlyAttribute = input.getAttribute(new Attribute("readonly"));
+ AttributeLocator<?> readonlyAttribute = input.getAttribute(new Attribute("readonly"));
assertEquals(selenium.getAttribute(readonlyAttribute), "readonly", "Input should be read-only.");
testClick();
@@ -306,7 +307,7 @@
selenium.type(selectOption, "2");
selenium.waitForPageToLoad();
- AttributeLocator sizeAttribute = input.getAttribute(new Attribute("size"));
+ AttributeLocator<?> sizeAttribute = input.getAttribute(new Attribute("size"));
assertEquals(selenium.getAttribute(sizeAttribute), "2", "Input's size attribute.");
selenium.type(selectOption, "40");
@@ -363,7 +364,7 @@
selenium.type(pjq("input[type=text][id$=maxlengthInput]"), "5");
selenium.waitForPageToLoad();
- AttributeLocator attr = input.getAttribute(Attribute.MAXLENGTH);
+ AttributeLocator<?> attr = input.getAttribute(Attribute.MAXLENGTH);
assertEquals(selenium.getAttribute(attr), "5", "Attribute maxlength of input.");
selenium.type(pjq("input[type=text][id$=maxlengthInput]"), "");
@@ -617,7 +618,7 @@
selenium.type(pjq("input[id$=tabindexInput]"), "55");
selenium.waitForPageToLoad(TIMEOUT);
- AttributeLocator attr = track.getAttribute(new Attribute("tabindex"));
+ AttributeLocator<?> attr = track.getAttribute(new Attribute("tabindex"));
assertTrue(selenium.isAttributePresent(attr), "Attribute tabindex of track is not present.");
assertEquals(selenium.getAttribute(attr), "55", "Attribute tabindex of track.");
13 years, 4 months
JBoss Rich Faces SVN: r22635 - in modules/tests/metamer/trunk: ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataGrid and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: jpapouse
Date: 2011-08-16 10:00:20 -0400 (Tue, 16 Aug 2011)
New Revision: 22635
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataGrid/iterationStatus.xhtml
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataGrid/TestIterationStatus.java
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataGrid/list.xhtml
Log:
RFPL-743:
- metamer page containing data grid and iteration status
- selenium tests checking iteration state in data grid
Added: modules/tests/metamer/trunk/application/src/main/webapp/components/richDataGrid/iterationStatus.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richDataGrid/iterationStatus.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richDataGrid/iterationStatus.xhtml 2011-08-16 14:00:20 UTC (rev 22635)
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:metamer="http://java.sun.com/jsf/composite/metamer" xmlns:rich="http://richfaces.org/rich">
+
+ <!--
+JBoss, Home of Professional Open Source
+Copyright 2010-2011, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+ <ui:composition template="/templates/template.xhtml">
+
+ <ui:define name="view">
+ <f:metadata>
+ <f:viewParam name="templates" value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ </ui:define>
+
+ <ui:define name="head"/>
+
+ <ui:define name="component">
+
+ <rich:dataGrid id="richDataGrid"
+ columns="#{richDataGridBean.attributes['columns'].value}"
+ first="#{richDataGridBean.attributes['first'].value}"
+ elements="#{richDataGridBean.attributes['elements'].value}"
+ iterationStatusVar="status"
+ keepSaved="#{richDataGridBean.attributes['keepSaved'].value}"
+ rendered="#{richDataGridBean.attributes['rendered'].value}"
+ style="#{richDataGridBean.attributes['style'].value}"
+ styleClass="#{richDataGridBean.attributes['styleClass'].value}"
+ title="#{richDataGridBean.attributes['title'].value}"
+ value="#{richDataGridBean.state ? model.capitals : null}"
+ var="record">
+
+ <f:facet name="noData">
+ <h:outputText value="There is no data." style="color: red;"/>
+ </f:facet>
+
+ <f:facet name="header">
+ <h:outputText value="header" />
+ </f:facet>
+
+ <f:facet name="сaption">
+ <h:outputText value="caption" />
+ </f:facet>
+
+ <a4j:outputPanel id="statusPanel" styleClass="statuses">
+ <h:outputText id="recordState" value="#{record.state} " style="font-weight: bold;" />
+ <br />
+ <h:outputText id="recordName" value="#{record.name}" />
+ <hr />
+ <h:outputText id="statusBegin" value="begin=#{status.begin}" />,
+ <h:outputText id="statusEnd" value="end=#{status.end}" />,
+ <h:outputText id="statusIndex" value="index=#{status.index}" />,
+ <h:outputText id="statusCount" value="count=#{status.count}" />,
+ <h:outputText id="statusFirst" value="first=#{status.first}" />,
+ <h:outputText id="statusLast" value="last=#{status.last}" />,
+ <h:outputText id="statusEven" value="even=#{status.even}" />,
+ <h:outputText id="statusRowCount" value="rowCount=#{status.rowCount}" />
+ </a4j:outputPanel>
+
+ <f:facet name="footer">
+ <h:outputText value="footer" />
+ </f:facet>
+
+ </rich:dataGrid>
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <metamer:attributes value="#{richDataGridBean.attributes}" id="attributes" />
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richDataGrid/list.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richDataGrid/list.xhtml 2011-08-16 12:55:42 UTC (rev 22634)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richDataGrid/list.xhtml 2011-08-16 14:00:20 UTC (rev 22635)
@@ -61,6 +61,11 @@
Page for testing attribute keepSaved of <b>rich:dataGrid</b>.
</metamer:testPageLink>
+ <metamer:testPageLink id="iterationStatus" outcome="iterationStatus" value="Iteration Status">
+ Simple page that contains <b>rich:dataGrid</b> (with model containing capitals) with iteration status and
+ input boxes for all its attributes.
+ </metamer:testPageLink>
+
</ui:define>
</ui:composition>
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataGrid/TestIterationStatus.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataGrid/TestIterationStatus.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataGrid/TestIterationStatus.java 2011-08-16 14:00:20 UTC (rev 22635)
@@ -0,0 +1,127 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.richDataGrid;
+
+import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+
+import java.net.URL;
+
+import javax.xml.bind.JAXBException;
+import org.jboss.test.selenium.locator.JQueryLocator;
+import org.testng.annotations.Test;
+import static org.testng.Assert.assertEquals;
+import static org.jboss.test.selenium.locator.LocatorFactory.jq;
+
+/**
+ * @author <a href="mailto:jpapouse@redhat.com">Jan Papousek</a>
+ */
+public class TestIterationStatus extends AbstractDataGridTest {
+
+ public TestIterationStatus() throws JAXBException {
+ super();
+ }
+
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath, "faces/components/richDataGrid/iterationStatus.xhtml");
+ }
+
+ @Test
+ public void testBegin() {
+ for(int i=0; i<dataGrid.getElementCount(); i++) {
+ JQueryLocator beginLocator = jq("span[id$=statusBegin]:eq(" + i + ")");
+ assertEquals(selenium.getText(beginLocator), "begin=0", "The iteration status property <begin> doesn't match (item: " + i + ").");
+ }
+ }
+
+ @Test
+ public void testCount() {
+ for(int i=0; i<dataGrid.getElementCount(); i++) {
+ JQueryLocator propertyLocator = jq("span[id$=statusCount]:eq(" + i + ")");
+ String expected = "count=" + (i + 1);
+ assertEquals(selenium.getText(propertyLocator), expected, "The iteration status property <count> doesn't match (item: " + i + ").");
+ }
+ }
+
+ @Test
+ public void testEnd() {
+ String expected = "end=" + (dataGrid.getElementCount() - 1);
+ for(int i=0; i<dataGrid.getElementCount(); i++) {
+ JQueryLocator propertyLocator = jq("span[id$=statusEnd]:eq(" + i + ")");
+ assertEquals(selenium.getText(propertyLocator), expected, "The iteration status property <end> doesn't match (item: " + i + ").");
+ }
+ }
+
+ @Test
+ public void testEven() {
+ for(int i=0; i<dataGrid.getElementCount(); i++) {
+ boolean expected = false;
+ if (i%2 == 1) {
+ expected = true;
+ }
+ JQueryLocator propertyLocator = jq("span[id$=statusEven]:eq(" + i + ")");
+ assertEquals(selenium.getText(propertyLocator), "even=" + Boolean.toString(expected), "The iteration status property <even> doesn't match (item: " + i + ").");
+ }
+ }
+
+ @Test
+ public void testFirst() {
+ for(int i=0; i<dataGrid.getElementCount(); i++) {
+ boolean expected = false;
+ if (i == 0) {
+ expected = true;
+ }
+ JQueryLocator propertyLocator = jq("span[id$=statusFirst]:eq(" + i + ")");
+ assertEquals(selenium.getText(propertyLocator), "first=" + Boolean.toString(expected), "The iteration status property <first> doesn't match (item: " + i + ").");
+ }
+ }
+
+ @Test
+ public void testIndex() {
+ for(int i=0; i<dataGrid.getElementCount(); i++) {
+ JQueryLocator propertyLocator = jq("span[id$=statusIndex]:eq(" + i + ")");
+ String expected = "index=" + i;
+ assertEquals(selenium.getText(propertyLocator), expected, "The iteration status property <index> doesn't match (item: " + i + ").");
+ }
+ }
+
+ @Test
+ public void testLast() {
+ for(int i=0; i<dataGrid.getElementCount(); i++) {
+ boolean expected = false;
+ if (i == dataGrid.getElementCount() - 1) {
+ expected = true;
+ }
+ JQueryLocator propertyLocator = jq("span[id$=statusLast]:eq(" + i + ")");
+ assertEquals(selenium.getText(propertyLocator), "last=" + Boolean.toString(expected), "The iteration status property <last> doesn't match (item: " + i + ").");
+ }
+ }
+
+ @Test
+ public void testRowCount() {
+ String expected = "rowCount=" + dataGrid.getElementCount();
+ for(int i=0; i<dataGrid.getElementCount(); i++) {
+ JQueryLocator propertyLocator = jq("span[id$=statusRowCount]:eq(" + i + ")");
+ assertEquals(selenium.getText(propertyLocator), expected, "The iteration status property <rowCount> doesn't match (item: " + i + ").");
+ }
+ }
+}
13 years, 4 months
JBoss Rich Faces SVN: r22634 - in modules/tests/metamer/trunk: application/src/main/java/org/richfaces/tests/metamer/converter and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: jpapouse
Date: 2011-08-16 08:55:42 -0400 (Tue, 16 Aug 2011)
New Revision: 22634
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richOrderingList/withColumn.xhtml
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichOrderingListBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/converter/CapitalConverter.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richOrderingList/list.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richOrderingList/simple.xhtml
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/TestOrderingList.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/TestOrderingListAttributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/TestOrderingListMoving.java
Log:
RFPL-1547: improved metamer sample containg ordering list
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichOrderingListBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichOrderingListBean.java 2011-08-16 12:24:43 UTC (rev 22633)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichOrderingListBean.java 2011-08-16 12:55:42 UTC (rev 22634)
@@ -22,6 +22,8 @@
package org.richfaces.tests.metamer.bean.rich;
import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collection;
import java.util.List;
import javax.annotation.PostConstruct;
@@ -51,6 +53,7 @@
//FIXME: @ManagedProperty(value="#{model.capitals}")
private List<Capital> capitals;
private Attributes attributes;
+ private Collection<String> hiddenAttributes = new ArrayList<String>();
@ManagedProperty(value="#{capitalConverter}")
private Converter converter;
@@ -72,41 +75,52 @@
attributes.setAttribute("upText", "Up");
attributes.setAttribute("upTopText", "First");
- attributes.remove("value");
- // TODO has to be tested in another way
- attributes.remove("converter");
- attributes.remove("converterMessage");
- attributes.remove("validator");
- attributes.remove("validatorMessage");
- attributes.remove("valueChangeListener");
+ String[] attrsToHide = new String[] {
+ "itemLabel", "itemValue", "value", "var",
+ // TODO has to be tested in another way
+ "converter", "converterMessage", "validator", "validatorMessage", "valueChangeListener"
+ };
+ for (String attribute : attrsToHide) {
+ hiddenAttributes.add(attribute);
+ attributes.remove(attribute);
+ }
+
// FIXME
capitals = Model.unmarshallCapitals();
}
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
public List<Capital> getCapitals() {
logger.info("size of returned capitals is <" + capitals.size() + ">");
return capitals;
+ }
+
+ public Converter getConverter() {
+ return converter;
}
-
- public Attributes getAttributes() {
- return attributes;
+
+ public Collection<String> getHiddenAttributes() {
+ return hiddenAttributes;
}
-
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
public void setCapitals(List<Capital> capitals) {
logger.info("size of set capitals is <" + capitals.size() + ">");
this.capitals = capitals;
}
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-
- public Converter getConverter() {
- return converter;
- }
-
public void setConverter(Converter converter) {
this.converter = converter;
}
+ public void setHiddenAttributes(Collection<String> hiddenAttributes) {
+ this.hiddenAttributes = hiddenAttributes;
+ }
+
}
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/converter/CapitalConverter.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/converter/CapitalConverter.java 2011-08-16 12:24:43 UTC (rev 22633)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/converter/CapitalConverter.java 2011-08-16 12:55:42 UTC (rev 22634)
@@ -47,7 +47,7 @@
@Override
public Object getAsObject(FacesContext context, UIComponent component, String value) {
- LOGGER.info(value);
+ LOGGER.info("capital as object: " + value);
for(Capital capital : capitals) {
if (capitalAsString(capital).equals(value)) {
Capital toReturn = new Capital();
@@ -77,6 +77,7 @@
}
private String capitalAsString(Capital capital) {
+ LOGGER.info("capital as string: " + capital.getName());
return capital.getName();
}
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richOrderingList/list.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richOrderingList/list.xhtml 2011-08-16 12:24:43 UTC (rev 22633)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richOrderingList/list.xhtml 2011-08-16 12:55:42 UTC (rev 22634)
@@ -33,9 +33,12 @@
<metamer:testPageLink id="simple" outcome="simple" value="Simple">
Simple page that contains <b>rich:panel</b> and input boxes for all its attributes.
</metamer:testPageLink>
-
+
+ <metamer:testPageLink id="withColumn" outcome="withColumn" value="With Column">
+ Simple page that contains <b>rich:panel</b> with <b>rich:column</b> and input boxes for all its attributes.
+ </metamer:testPageLink>
</ui:define>
-
+
</ui:composition>
</html>
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richOrderingList/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richOrderingList/simple.xhtml 2011-08-16 12:24:43 UTC (rev 22633)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richOrderingList/simple.xhtml 2011-08-16 12:55:42 UTC (rev 22634)
@@ -37,8 +37,6 @@
<br />
<rich:orderingList columnClasses="#{richOrderingListBean.attributes['columnClasses'].value}"
columnVar="#{richOrderingListBean.attributes['columnVar'].value}"
- converter="#{richOrderingListBean.attributes['converter'].value}"
- converterMessage="#{richOrderingListBean.attributes['converterMessage'].value}"
defaultLabel="#{richOrderingListBean.attributes['defaultLabel'].value}"
disabled="#{richOrderingListBean.attributes['disabled'].value}"
disabledClass="#{richOrderingListBean.attributes['disabledClass'].value}"
@@ -48,9 +46,8 @@
id="orderingList"
immediate="#{richOrderingListBean.attributes['immediate'].value}"
itemClass="#{richOrderingListBean.attributes['itemClass'].value}"
- itemLabel="#{richOrderingListBean.attributes['itemlabel'].value}"
+ itemLabel="#{capital.name}"
itemValue="#{capital}"
- itemValues="#{richOrderingListBean.attributes['itemValues'].value}"
listHeight="#{richOrderingListBean.attributes['listHeight'].value}"
listWidth="#{richOrderingListBean.attributes['listWidth'].value}"
maxListHeight="#{richOrderingListBean.attributes['maxListHeight'].value}"
@@ -88,26 +85,15 @@
style="#{richOrderingListBean.attributes['style'].value}"
styleClass="#{richOrderingListBean.attributes['styleClass'].value}"
upText="#{richOrderingListBean.attributes['upText'].value}"
- upTopText="#{richOrderingListBean.attributes['upTopText'].value}"
- validator="#{richOrderingListBean.attributes['validator'].value}"
- validatorMessage="#{richOrderingListBean.attributes['validatorMessage'].value}"
+ upTopText="#{richOrderingListBean.attributes['upTopText'].value}"
value="#{richOrderingListBean.capitals}"
- valueChangeListener="#{richOrderingListBean.attributes['valueChangeListener'].value}"
- var="#{richOrderingListBean.attributes['var'].value}"
+ var="capital"
>
<f:converter converterId="capitalConverter" />
- <rich:column>
- <f:facet name="header">State</f:facet>
- #{capital.state}
- </rich:column>
- <rich:column>
- <f:facet name="header">Name</f:facet>
- #{capital.name}
- </rich:column>
</rich:orderingList>
<br />
<rich:list id="output" value="#{richOrderingListBean.capitals}" var="capital">
- <h:outputText value="#{capital.state}, #{capital.name}" />
+ <h:outputText value="#{capital.name}" />
</rich:list>
</h:form>
@@ -115,6 +101,13 @@
<ui:define name="outOfTemplateAfter">
<metamer:attributes value="#{richOrderingListBean.attributes}" id="attributes" />
+ <hr />
+ <p>
+ Following attributes are hidden:
+ </p>
+ <rich:list id="hiddenAttributes" value="#{richOrderingListBean.hiddenAttributes}" var="attribute">
+ <h:outputText value="#{attribute}" />
+ </rich:list>
</ui:define>
</ui:composition>
Added: modules/tests/metamer/trunk/application/src/main/webapp/components/richOrderingList/withColumn.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richOrderingList/withColumn.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richOrderingList/withColumn.xhtml 2011-08-16 12:55:42 UTC (rev 22634)
@@ -0,0 +1,129 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
+ xmlns:rich="http://richfaces.org/rich" xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:it="http://richfaces.org/iteration">
+
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2010-2011, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+<ui:composition template="/templates/template.xhtml">
+
+ <ui:define name="component">
+ <h:form>
+ <h:commandButton value="submit">
+ <f:ajax execute="@form" render="orderingList output" />
+ </h:commandButton>
+ <hr />
+ <rich:orderingList columnClasses="#{richOrderingListBean.attributes['columnClasses'].value}"
+ columnVar="#{richOrderingListBean.attributes['columnVar'].value}"
+ defaultLabel="#{richOrderingListBean.attributes['defaultLabel'].value}"
+ disabled="#{richOrderingListBean.attributes['disabled'].value}"
+ disabledClass="#{richOrderingListBean.attributes['disabledClass'].value}"
+ downBottomText="#{richOrderingListBean.attributes['downBottomText'].value}"
+ downText="#{richOrderingListBean.attributes['downText'].value}"
+ headerClass="#{richOrderingListBean.attributes['headerClass'].value}"
+ id="orderingList"
+ immediate="#{richOrderingListBean.attributes['immediate'].value}"
+ itemClass="#{richOrderingListBean.attributes['itemClass'].value}"
+ itemLabel="#{richOrderingListBean.attributes['itemlabel'].value}"
+ listHeight="#{richOrderingListBean.attributes['listHeight'].value}"
+ listWidth="#{richOrderingListBean.attributes['listWidth'].value}"
+ maxListHeight="#{richOrderingListBean.attributes['maxListHeight'].value}"
+ minListHeight="#{richOrderingListBean.attributes['minListHeight'].value}"
+ onadditem="#{richOrderingListBean.attributes['onadditem'].value}"
+ onblur="#{richOrderingListBean.attributes['onblur'].value}"
+ onchange="#{richOrderingListBean.attributes['onchange'].value}"
+ onclick="#{richOrderingListBean.attributes['onclick'].value}"
+ ondblclick="#{richOrderingListBean.attributes['ondbclick'].value}"
+ onfocus="#{richOrderingListBean.attributes['onfocus'].value}"
+ onkeydown="#{richOrderingListBean.attributes['onkeydown'].value}"
+ onkeypress="#{richOrderingListBean.attributes['onkeypress'].value}"
+ onkeyup="#{richOrderingListBean.attributes['onkeyup'].value}"
+ onlistclick="#{richOrderingListBean.attributes['onlistclick'].value}"
+ onlistdblclick="#{richOrderingListBean.attributes['onlistdblclick'].value}"
+ onlistkeydown="#{richOrderingListBean.attributes['onlistkeydown'].value}"
+ onlistkeypress="#{richOrderingListBean.attributes['onlistkeypress'].value}"
+ onlistkeyup="#{richOrderingListBean.attributes['onlistkeyup'].value}"
+ onlistmousedown="#{richOrderingListBean.attributes['onlistmousedown'].value}"
+ onlistmousemove="#{richOrderingListBean.attributes['onlistmousemove'].value}"
+ onlistmouseout="#{richOrderingListBean.attributes['onlistmouseout'].value}"
+ onlistmouseover="#{richOrderingListBean.attributes['onlistmouseover'].value}"
+ onlistmouseup="#{richOrderingListBean.attributes['onlistmouseup'].value}"
+ onmousedown="#{richOrderingListBean.attributes['onmousedown'].value}"
+ onmousemove="#{richOrderingListBean.attributes['onmousemove'].value}"
+ onmouseout="#{richOrderingListBean.attributes['onmouseout'].value}"
+ onmouseover="#{richOrderingListBean.attributes['onmouseover'].value}"
+ onmouseup="#{richOrderingListBean.attributes['onmouseup'].value}"
+ onremoveitem="#{richOrderingListBean.attributes['onremoveitem'].value}"
+ rendered="#{richOrderingListBean.attributes['rendered'].value}"
+ required="#{richOrderingListBean.attributes['required'].value}"
+ requiredMessage="#{richOrderingListBean.attributes['requiredMessage'].value}"
+ selectItemClass="#{richOrderingListBean.attributes['selectItemClass'].value}"
+ showButton="#{richOrderingListBean.attributes['showButton'].value}"
+ style="#{richOrderingListBean.attributes['style'].value}"
+ styleClass="#{richOrderingListBean.attributes['styleClass'].value}"
+ upText="#{richOrderingListBean.attributes['upText'].value}"
+ upTopText="#{richOrderingListBean.attributes['upTopText'].value}"
+ value="#{richOrderingListBean.capitals}"
+ >
+ <f:converter converterId="capitalConverter" />
+ <rich:column>
+ <f:facet name="header">State</f:facet>
+ #{capital.state}
+ </rich:column>
+ <rich:column>
+ <f:facet name="header">Name</f:facet>
+ #{capital.name}
+ </rich:column>
+ </rich:orderingList>
+ <hr />
+ <rich:list id="output" value="#{richOrderingListBean.capitals}" var="capital">
+ <h:outputText value="#{capital.state}, #{capital.name}" />
+ </rich:list>
+ <hr />
+ <p>
+ Following attributes are <strong>not used</strong>:
+ </p>
+ <ul>
+ <li>itemValue</li>
+ <li>itemValues</li>
+ <li>var</li>
+ </ul>
+ </h:form>
+
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <metamer:attributes value="#{richOrderingListBean.attributes}" id="attributes" />
+ <hr />
+ <p>
+ Following attributes are hidden:
+ </p>
+ <rich:list id="hiddenAttributes" value="#{richOrderingListBean.hiddenAttributes}" var="attribute">
+ <h:outputText value="#{attribute}" />
+ </rich:list>
+ </ui:define>
+
+</ui:composition>
+</html>
\ No newline at end of file
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/TestOrderingList.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/TestOrderingList.java 2011-08-16 12:24:43 UTC (rev 22633)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/TestOrderingList.java 2011-08-16 12:55:42 UTC (rev 22634)
@@ -30,7 +30,7 @@
import static org.testng.Assert.assertTrue;
/**
- * Selenium tests for page faces/components/richOrderingList/simple.xhtml.
+ * Selenium tests for page faces/components/richOrderingList/withColumn.xhtml.
*
* It checks whether the moving is OK.
*
@@ -42,7 +42,7 @@
@Override
public URL getTestUrl() {
- return URLUtils.buildUrl(contextPath, "faces/components/richOrderingList/simple.xhtml");
+ return URLUtils.buildUrl(contextPath, "faces/components/richOrderingList/withColumn.xhtml");
}
@Test
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/TestOrderingListAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/TestOrderingListAttributes.java 2011-08-16 12:24:43 UTC (rev 22633)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/TestOrderingListAttributes.java 2011-08-16 12:55:42 UTC (rev 22634)
@@ -37,7 +37,7 @@
import static org.testng.Assert.fail;
/**
- * Selenium tests for page faces/components/richOrderingList/simple.xhtml.
+ * Selenium tests for page faces/components/richOrderingList/withColumn.xhtml.
*
* @author <a href="mailto:jpapouse@redhat.com">Jan Papousek</a>
*/
@@ -45,7 +45,7 @@
@Override
public URL getTestUrl() {
- return URLUtils.buildUrl(contextPath, "faces/components/richOrderingList/simple.xhtml");
+ return URLUtils.buildUrl(contextPath, "faces/components/richOrderingList/withColumn.xhtml");
}
@Test
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/TestOrderingListMoving.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/TestOrderingListMoving.java 2011-08-16 12:24:43 UTC (rev 22633)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/TestOrderingListMoving.java 2011-08-16 12:55:42 UTC (rev 22634)
@@ -27,7 +27,7 @@
import org.testng.annotations.Test;
/**
- * Selenium tests for page faces/components/richOrderingList/simple.xhtml.
+ * Selenium tests for page faces/components/richOrderingList/withColumn.xhtml.
*
* It checks whether the moving is OK.
*
@@ -37,7 +37,7 @@
@Override
public URL getTestUrl() {
- return URLUtils.buildUrl(contextPath, "faces/components/richOrderingList/simple.xhtml");
+ return URLUtils.buildUrl(contextPath, "faces/components/richOrderingList/withColumn.xhtml");
}
@Test
13 years, 4 months
JBoss Rich Faces SVN: r22633 - in modules/tests/metamer/trunk: ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jOutputPanel and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2011-08-16 08:24:43 -0400 (Tue, 16 Aug 2011)
New Revision: 22633
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/filtering.xhtml
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jOutputPanel/TestA4JOutputPanel.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTableToggler/TestCollapsibleSubTableToggler.java
Log:
sample for rich:collapsibleSubTable reformatted
added issue tracking info to a4j:outputPanel test
locator fixed in sub table
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/filtering.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/filtering.xhtml 2011-08-16 11:43:57 UTC (rev 22632)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/filtering.xhtml 2011-08-16 12:24:43 UTC (rev 22633)
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
- xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
- xmlns:rich="http://richfaces.org/rich" xmlns:a4j="http://richfaces.org/a4j" xmlns:fn="http://java.sun.com/jsp/jstl/functions">
+ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
+ xmlns:rich="http://richfaces.org/rich" xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:fn="http://java.sun.com/jsp/jstl/functions">
- <!--
+<!--
JBoss, Home of Professional Open Source
Copyright 2010-2011, Red Hat, Inc. and individual contributors
by the @authors tag. See the copyright.txt in the distribution for a
@@ -26,115 +27,115 @@
02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->
- <ui:composition template="/templates/template.xhtml">
+<ui:composition template="/templates/template.xhtml">
- <ui:define name="view">
- <f:metadata>
- <f:viewParam name="templates" value="#{templateBean.templates}">
- <f:converter converterId="templatesListConverter" />
- </f:viewParam>
- </f:metadata>
- </ui:define>
+ <ui:define name="view">
+ <f:metadata>
+ <f:viewParam name="templates" value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ </ui:define>
- <ui:define name="outOfTemplateBefore">
- <br/>
- <h:outputText value="Show data in table: " />
- <h:selectBooleanCheckbox id="noDataCheckbox" value="#{richSubTableBean.state}">
- <a4j:ajax render="richDataTable"/>
- </h:selectBooleanCheckbox>
- <br/><br/>
- </ui:define>
+ <ui:define name="outOfTemplateBefore">
+ <br />
+ <h:outputText value="Show data in table: " />
+ <h:selectBooleanCheckbox id="noDataCheckbox" value="#{richSubTableBean.state}">
+ <a4j:ajax render="richDataTable" />
+ </h:selectBooleanCheckbox>
+ <br />
+ <br />
+ </ui:define>
- <ui:define name="component">
+ <ui:define name="component">
- <rich:dataTable id="richDataTable" value="#{richSubTableBean.lists}" var="list" keepSaved="true">
- <f:facet name="header">
- <rich:columnGroup id="columnGroup">
- <rich:column id="columnHeaderEmployees" colspan="3">
- <h:outputText id="columnHeaderEmployeesText" value="Employees" />
- </rich:column>
- <rich:column id="columnHeaderName" breakRowBefore="true">
- <h:outputText id="columnHeaderNameText" value="Name" />
- <br/>
- <h:outputText id="columnHeaderNameType" value="(expression contains ignore case)" />
- <br/>
- <h:inputText id="columnHeaderNameInput" value="#{richSubTableBean.filtering['name']}">
- <a4j:ajax render="commonGrid" event="change"/>
- </h:inputText>
- </rich:column>
- <rich:column id="columnHeaderTitle">
- <h:outputText id="columnHeaderTitleText" value="Title" />
- <br/>
- <h:outputText id="columnHeaderTitleType" value="(expression equals)" />
- <br/>
- <h:inputText id="columnHeaderTitleInput" value="#{richSubTableBean.filtering['title']}">
- <a4j:ajax render="commonGrid" event="change"/>
- </h:inputText>
- </rich:column>
- <rich:column id="columnHeaderBirthdate">
- <h:outputText id="columnHeaderBirthdateText" value="Birthdate" />
- </rich:column>
- </rich:columnGroup>
- </f:facet>
-
- <rich:column id="columnSubTable" colspan="3">
- <rich:collapsibleSubTableToggler id="subTableTC" for="richSubTable"/>
- <h:outputText value="#{list[0].sex == 'MALE' ? 'Men' : 'Women'}" />
- </rich:column>
-
- <rich:collapsibleSubTable id="richSubTable"
- expanded="#{richSubTableBean.expanded[list]}"
- expandMode="#{richSubTableBean.attributes['expandMode'].value}"
- filterVar="#{richSubTableBean.attributes['filterVar'].value}"
- first="#{richSubTableBean.attributes['first'].value}"
- iterationStatusVar="#{richSubTableBean.attributes['iterationStatusVar'].value}"
- keepSaved="#{richSubTableBean.attributes['keepSaved'].value}"
- noDataLabel="#{richSubTableBean.attributes['noDataLabel'].value}"
- onrowclick="#{richSubTableBean.attributes['onrowclick'].value}"
- onrowdblclick="#{richSubTableBean.attributes['onrowdblclick'].value}"
- onrowkeydown="#{richSubTableBean.attributes['onrowkeydown'].value}"
- onrowkeypress="#{richSubTableBean.attributes['onrowkeypress'].value}"
- onrowkeyup="#{richSubTableBean.attributes['onrowkeyup'].value}"
- onrowmousedown="#{richSubTableBean.attributes['onrowmousedown'].value}"
- onrowmousemove="#{richSubTableBean.attributes['onrowmousemove'].value}"
- onrowmouseout="#{richSubTableBean.attributes['onrowmouseout'].value}"
- onrowmouseover="#{richSubTableBean.attributes['onrowmouseover'].value}"
- onrowmouseup="#{richSubTableBean.attributes['onrowmouseup'].value}"
- rendered="#{richSubTableBean.attributes['rendered'].value}"
- rowKeyConverter="#{richSubTableBean.attributes['rowKeyConverter'].value}"
- rows="#{richSubTableBean.attributes['rows'].value}"
- sortMode="#{richSubTableBean.attributes['sortMode'].value}"
- sortPriority="#{richSubTableBean.attributes['sortPriority'].value}"
- columnClasses="#{richSubTableBean.attributes['columnClasses'].value}"
- footerClass="#{richSubTableBean.attributes['footerClass'].value}"
- headerClass="#{richSubTableBean.attributes['headerClass'].value}"
- rowClass="#{richSubTableBean.attributes['rowClass'].value}"
- rowClasses="#{richSubTableBean.attributes['rowClasses'].value}"
- style="#{richSubTableBean.attributes['style'].value}"
- styleClass="#{richSubTableBean.attributes['styleClass'].value}"
- value="#{richSubTableBean.state ? list : null}"
- var="item">
-
- <rich:column id="columnName" filterExpression="#{fn:containsIgnoreCase(item.name, richSubTableBean.filtering['name'])}">
- <h:outputText id="name" value="#{item.name}" />
+ <rich:dataTable id="richDataTable" value="#{richSubTableBean.lists}" var="list" keepSaved="true">
+ <f:facet name="header">
+ <rich:columnGroup id="columnGroup">
+ <rich:column id="columnHeaderEmployees" colspan="3">
+ <h:outputText id="columnHeaderEmployeesText" value="Employees" />
</rich:column>
- <rich:column id="columnTitle" filterExpression="#{richSubTableBean.filtering['title'] == null || richSubTableBean.filtering['title'] == '' || item.title == richSubTableBean.filtering['title']}">
- <h:outputText id="title" value="#{item.title}" />
+ <rich:column id="columnHeaderName" breakRowBefore="true">
+ <h:outputText id="columnHeaderNameText" value="Name" />
+ <br />
+ <h:outputText id="columnHeaderNameType" value="(expression contains ignore case)" />
+ <br />
+ <h:inputText id="columnHeaderNameInput" value="#{richSubTableBean.filtering['name']}">
+ <a4j:ajax execute="columnHeaderNameInput" render="richDataTable" event="change" />
+ </h:inputText>
</rich:column>
- <rich:column id="columnBirthdate">
- <h:outputText id="birthdate" value="#{item.birthdate}">
- <f:convertDateTime pattern="d MMM yyyy"/>
- </h:outputText>
+ <rich:column id="columnHeaderTitle">
+ <h:outputText id="columnHeaderTitleText" value="Title" />
+ <br />
+ <h:outputText id="columnHeaderTitleType" value="(expression equals)" />
+ <br />
+ <h:inputText id="columnHeaderTitleInput" value="#{richSubTableBean.filtering['title']}">
+ <a4j:ajax execute="columnHeaderTitleInput" render="richDataTable" event="change" />
+ </h:inputText>
</rich:column>
+ <rich:column id="columnHeaderBirthdate">
+ <h:outputText id="columnHeaderBirthdateText" value="Birthdate" />
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
- </rich:collapsibleSubTable>
- </rich:dataTable>
+ <rich:column id="columnSubTable" colspan="3">
+ <rich:collapsibleSubTableToggler id="subTableTC" for="richSubTable" />
+ <h:outputText value="#{list[0].sex == 'MALE' ? 'Men' : 'Women'}" />
+ </rich:column>
- </ui:define>
+ <rich:collapsibleSubTable id="richSubTable" expanded="#{richSubTableBean.expanded[list]}"
+ expandMode="#{richSubTableBean.attributes['expandMode'].value}"
+ filterVar="#{richSubTableBean.attributes['filterVar'].value}"
+ first="#{richSubTableBean.attributes['first'].value}"
+ iterationStatusVar="#{richSubTableBean.attributes['iterationStatusVar'].value}"
+ keepSaved="#{richSubTableBean.attributes['keepSaved'].value}"
+ noDataLabel="#{richSubTableBean.attributes['noDataLabel'].value}"
+ onrowclick="#{richSubTableBean.attributes['onrowclick'].value}"
+ onrowdblclick="#{richSubTableBean.attributes['onrowdblclick'].value}"
+ onrowkeydown="#{richSubTableBean.attributes['onrowkeydown'].value}"
+ onrowkeypress="#{richSubTableBean.attributes['onrowkeypress'].value}"
+ onrowkeyup="#{richSubTableBean.attributes['onrowkeyup'].value}"
+ onrowmousedown="#{richSubTableBean.attributes['onrowmousedown'].value}"
+ onrowmousemove="#{richSubTableBean.attributes['onrowmousemove'].value}"
+ onrowmouseout="#{richSubTableBean.attributes['onrowmouseout'].value}"
+ onrowmouseover="#{richSubTableBean.attributes['onrowmouseover'].value}"
+ onrowmouseup="#{richSubTableBean.attributes['onrowmouseup'].value}"
+ rendered="#{richSubTableBean.attributes['rendered'].value}"
+ rowKeyConverter="#{richSubTableBean.attributes['rowKeyConverter'].value}"
+ rows="#{richSubTableBean.attributes['rows'].value}" sortMode="#{richSubTableBean.attributes['sortMode'].value}"
+ sortPriority="#{richSubTableBean.attributes['sortPriority'].value}"
+ columnClasses="#{richSubTableBean.attributes['columnClasses'].value}"
+ footerClass="#{richSubTableBean.attributes['footerClass'].value}"
+ headerClass="#{richSubTableBean.attributes['headerClass'].value}"
+ rowClass="#{richSubTableBean.attributes['rowClass'].value}"
+ rowClasses="#{richSubTableBean.attributes['rowClasses'].value}"
+ style="#{richSubTableBean.attributes['style'].value}"
+ styleClass="#{richSubTableBean.attributes['styleClass'].value}" value="#{richSubTableBean.state ? list : null}"
+ var="item">
- <ui:define name="outOfTemplateAfter">
- <metamer:attributes value="#{richSubTableBean.attributes}" id="attributes" />
- </ui:define>
+ <rich:column id="columnName"
+ filterExpression="#{fn:containsIgnoreCase(item.name, richSubTableBean.filtering['name'])}">
+ <h:outputText id="name" value="#{item.name}" />
+ </rich:column>
+ <rich:column id="columnTitle"
+ filterExpression="#{richSubTableBean.filtering['title'] == null || richSubTableBean.filtering['title'] == '' || item.title == richSubTableBean.filtering['title']}">
+ <h:outputText id="title" value="#{item.title}" />
+ </rich:column>
+ <rich:column id="columnBirthdate">
+ <h:outputText id="birthdate" value="#{item.birthdate}">
+ <f:convertDateTime pattern="d MMM yyyy" />
+ </h:outputText>
+ </rich:column>
- </ui:composition>
+ </rich:collapsibleSubTable>
+ </rich:dataTable>
+
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <metamer:attributes value="#{richSubTableBean.attributes}" id="attributes" />
+ </ui:define>
+
+</ui:composition>
</html>
\ No newline at end of file
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jOutputPanel/TestA4JOutputPanel.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jOutputPanel/TestA4JOutputPanel.java 2011-08-16 11:43:57 UTC (rev 22632)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jOutputPanel/TestA4JOutputPanel.java 2011-08-16 12:24:43 UTC (rev 22633)
@@ -87,6 +87,7 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-11312")
public void testClick() {
selenium.click(increaseCounterButton);
waitGui.until(textEquals.locator(outputDiv).text("1"));
@@ -148,6 +149,7 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-11312")
public void testRendered() {
JQueryLocator renderedInputFalse = pjq("input[type=radio][name$=renderedInput][value=false]");
JQueryLocator renderedInputTrue = pjq("input[type=radio][name$=renderedInput][value=true]");
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTableToggler/TestCollapsibleSubTableToggler.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTableToggler/TestCollapsibleSubTableToggler.java 2011-08-16 11:43:57 UTC (rev 22632)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTableToggler/TestCollapsibleSubTableToggler.java 2011-08-16 12:24:43 UTC (rev 22633)
@@ -54,7 +54,7 @@
private static final String LABEL = "Label";
CollapsibleSubTableTogglerAttributes attributes = new CollapsibleSubTableTogglerAttributes();
- DataTable dataTable = new DataTable(pjq("table.rf-dt"));
+ DataTable dataTable = new DataTable(pjq("table.rf-dt[id$=richDataTable]"));
JQueryLocator link = jq("a");
JQueryLocator image = jq("img");
13 years, 4 months
JBoss Rich Faces SVN: r22632 - in modules/tests/metamer/trunk: ftest-source/src/main/java/org/richfaces/tests/metamer/ftest and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: jpapouse
Date: 2011-08-16 07:43:57 -0400 (Tue, 16 Aug 2011)
New Revision: 22632
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/OrderingList.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/AbstractOrderingListTest.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/TestOrderingList.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/TestOrderingListAttributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/TestOrderingListMoving.java
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichOrderingListBean.java
Log:
RFPL-1547: selenium tests for ordering list
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichOrderingListBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichOrderingListBean.java 2011-08-15 12:41:51 UTC (rev 22631)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichOrderingListBean.java 2011-08-16 11:43:57 UTC (rev 22632)
@@ -72,6 +72,13 @@
attributes.setAttribute("upText", "Up");
attributes.setAttribute("upTopText", "First");
+ attributes.remove("value");
+ // TODO has to be tested in another way
+ attributes.remove("converter");
+ attributes.remove("converterMessage");
+ attributes.remove("validator");
+ attributes.remove("validatorMessage");
+ attributes.remove("valueChangeListener");
// FIXME
capitals = Model.unmarshallCapitals();
}
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/OrderingList.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/OrderingList.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/OrderingList.java 2011-08-16 11:43:57 UTC (rev 22632)
@@ -0,0 +1,168 @@
+package org.richfaces.tests.metamer.ftest.model;
+
+import static org.richfaces.tests.metamer.ftest.AbstractMetamerTest.pjq;
+import org.apache.commons.lang.Validate;
+import org.jboss.test.selenium.RequestTypeModelGuard.Model;
+import org.jboss.test.selenium.framework.AjaxSelenium;
+import org.jboss.test.selenium.framework.AjaxSeleniumProxy;
+import org.jboss.test.selenium.locator.JQueryLocator;
+import static org.jboss.test.selenium.locator.LocatorFactory.jq;
+
+/**
+ * Object representing ordering list and all its elements
+ *
+ * @author <a href="mailto:jpapouse@redhat.com">Jan Papousek</a>
+ */
+public class OrderingList implements Model {
+
+ private final JQueryLocator buttonBottom = jq("button.rf-ord-down-bottom");
+ private final JQueryLocator buttonDown = jq("button.rf-ord-down");
+ private final JQueryLocator buttonTop = jq("button.rf-ord-up-top");
+ private final JQueryLocator buttonUp = jq("button.rf-ord-up");
+ private final JQueryLocator header = pjq("thead.rf-ord-lst-header > tr");
+ private final JQueryLocator item = pjq("tbody[id$=orderingListItems] > tr.rf-ord-opt");
+ private final JQueryLocator itemSelected = pjq("tbody[id$=orderingListItems] > tr.rf-ord-opt.rf-ord-sel");
+ private final JQueryLocator list = pjq("div.rf-ord-lst-scrl");
+ private final JQueryLocator orderingList = pjq("div[id$=orderingList]");
+ private int numberOfItems = -1;
+ private int numberOfColumns = -1;
+ private final AjaxSelenium selenium;
+
+ public OrderingList() {
+ this(AjaxSeleniumProxy.getInstance());
+ }
+
+ public OrderingList(AjaxSelenium selenium) {
+ Validate.notNull(selenium);
+ this.selenium = selenium;
+ }
+
+ public JQueryLocator getHeader() {
+ return header;
+ }
+
+ public int getIndexOfSelectedItem() {
+ if (!isItemSelected()) {
+ throw new IllegalStateException("There is no selected item.");
+ }
+ return getNumberOfItems() - selenium.getCount(jq(itemSelected.getRawLocator() + " ~ tr")) - 1;
+ }
+
+ public JQueryLocator getItem(int index) {
+ if (index < 0 || index >= getNumberOfItems()) {
+ throw new IndexOutOfBoundsException("The index <" + index + "> is out of the range [0, "
+ + getNumberOfItems() + "].");
+ }
+ return jq(item.getRawLocator() + ":eq(" + index + ")");
+ }
+
+ public JQueryLocator getItemColumn(int indexItem, int indexColumn) {
+ if (indexColumn < 0 || indexColumn >= getNumberOfColumns()) {
+ throw new IndexOutOfBoundsException("The index of column <" + indexColumn + "> is out of the range [0, " + getNumberOfColumns() + "]");
+ }
+ return jq(getItem(indexItem).getRawLocator() + " > .rf-ord-cell:eq(" + indexColumn + ")");
+ }
+
+ public String getItemColumnValue(int indexItem, int indexColumn) {
+ return selenium.getText(getItemColumn(indexItem, indexColumn));
+ }
+
+ public JQueryLocator getList() {
+ return list;
+ }
+
+ public JQueryLocator getLocator() {
+ return orderingList;
+ }
+
+ public int getNumberOfColumns() {
+ if (numberOfColumns == -1) {
+ numberOfColumns = selenium.getCount(jq(getItem(0).getRawLocator() + " > .rf-ord-cell"));
+ }
+ return numberOfColumns;
+ }
+
+ public int getNumberOfItems() {
+ if (numberOfItems == -1) {
+ numberOfItems = selenium.getCount(item);
+ }
+ return numberOfItems;
+ }
+
+ public boolean isButtonBottomEnabled() {
+ return isButtonEnabled(buttonBottom);
+ }
+
+ public boolean isButtonDownEnabled() {
+ return isButtonEnabled(buttonDown);
+ }
+
+ public boolean isButtonTopEnabled() {
+ return isButtonEnabled(buttonTop);
+ }
+
+ public boolean isButtonUpEnabled() {
+ return isButtonEnabled(buttonUp);
+ }
+
+ public boolean isButtonBottomPresent() {
+ return selenium.isElementPresent(buttonBottom);
+ }
+
+ public boolean isButtonDownPresent() {
+ return selenium.isElementPresent(buttonDown);
+ }
+
+ public boolean isButtonTopPresent() {
+ return selenium.isElementPresent(buttonTop);
+ }
+
+ public boolean isButtonUpPresent() {
+ return selenium.isElementPresent(buttonUp);
+ }
+
+ public boolean isItemSelected() {
+ return selenium.isElementPresent(itemSelected);
+ }
+
+ public boolean isOrderingListPresent() {
+ return selenium.isElementPresent(orderingList);
+ }
+
+ public void moveBottom() {
+ move(buttonBottom);
+ }
+
+ public void moveDown() {
+ move(buttonDown);
+ }
+
+ public void moveTop() {
+ move(buttonTop);
+ }
+
+ public void moveUp() {
+ move(buttonUp);
+ }
+
+ public void selectItem(int index) {
+ selenium.mouseDown(getItem(index));
+ selenium.mouseUp(getItem(index));
+ selenium.click(getItem(index));
+ }
+
+ private boolean isButtonEnabled(JQueryLocator button) {
+ return !selenium.isElementPresent(jq(button.getRawLocator() + ".rf-ord-btn-dis"));
+ }
+
+ private void move(JQueryLocator button) {
+ if (!selenium.isElementPresent(itemSelected)) {
+ throw new IllegalStateException("No item is selected, so the moving action can't be proceeded.");
+ }
+ if (!isButtonEnabled(button)) {
+ throw new IllegalStateException("The moving action can't be proceeded because the moving button is disabled.");
+ }
+ selenium.click(button);
+ }
+
+}
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/AbstractOrderingListTest.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/AbstractOrderingListTest.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/AbstractOrderingListTest.java 2011-08-16 11:43:57 UTC (rev 22632)
@@ -0,0 +1,141 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.richOrderingList;
+
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertTrue;
+
+import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
+import org.richfaces.tests.metamer.ftest.model.OrderingList;
+
+/**
+ * Abstract test case for pages faces/components/richOrderingList/
+ *
+ * @author <a href="mailto:jpapouse@redhat.com">Jan Papousek</a>
+ */
+public abstract class AbstractOrderingListTest extends AbstractMetamerTest {
+
+ private OrderingList orderingList = new OrderingList();
+
+ protected void checkButtonsBottom() {
+ assertFalse(orderingList.isButtonBottomEnabled(), "The button [bottom] should be disabled.");
+ assertFalse(orderingList.isButtonDownEnabled(), "The button [down] should be disabled.");
+ assertTrue(orderingList.isButtonTopEnabled(), "The button [top] should be enabled.");
+ assertTrue(orderingList.isButtonUpEnabled(), "The button [up] should be enabled.");
+ }
+
+ protected void checkButtonsMiddle() {
+ assertTrue(orderingList.isButtonBottomEnabled(), "The button [bottom] should be enabled.");
+ assertTrue(orderingList.isButtonDownEnabled(), "The button [down] should be enabled.");
+ assertTrue(orderingList.isButtonTopEnabled(), "The button [top] should be enabled.");
+ assertTrue(orderingList.isButtonUpEnabled(), "The button [up] should be enabled.");
+ }
+
+ protected void checkButtonsTop() {
+ assertTrue(orderingList.isButtonBottomEnabled(), "The button [bottom] should be enabled.");
+ assertTrue(orderingList.isButtonDownEnabled(), "The button [down] should be enabled.");
+ assertFalse(orderingList.isButtonTopEnabled(), "The button [top] should be disabled.");
+ assertFalse(orderingList.isButtonUpEnabled(), "The button [up] should be disabled.");
+ }
+
+ protected OrderingList getOrderingList() {
+ return orderingList;
+ }
+
+ protected void moveBottom() {
+ int beforeIndex = orderingList.getIndexOfSelectedItem();
+ String stateA = orderingList.getItemColumnValue(beforeIndex, 0);
+ String cityA = orderingList.getItemColumnValue(beforeIndex, 1);
+ String stateB = orderingList.getItemColumnValue(orderingList.getNumberOfItems() - 1, 0);
+ String cityB = orderingList.getItemColumnValue(orderingList.getNumberOfItems() - 1, 1);
+ orderingList.moveBottom();
+ int after = orderingList.getIndexOfSelectedItem();
+ assertEquals(after, orderingList.getNumberOfItems() - 1, "The index of selected item doesn't match.");
+ checkColumnValuesMoved(beforeIndex, stateA, cityA, orderingList.getNumberOfItems() - 1, stateB, cityB);
+ checkButtonsBottom();
+ }
+
+ protected void moveDown() {
+ int beforeIndex = orderingList.getIndexOfSelectedItem();
+ String stateA = orderingList.getItemColumnValue(beforeIndex, 0);
+ String cityA = orderingList.getItemColumnValue(beforeIndex, 1);
+ String stateB = orderingList.getItemColumnValue(beforeIndex + 1, 0);
+ String cityB = orderingList.getItemColumnValue(beforeIndex + 1, 1);
+ orderingList.moveDown();
+ int afterIndex = orderingList.getIndexOfSelectedItem();
+ assertEquals(afterIndex, beforeIndex + 1, "The index of selected item doesn't match.");
+ checkColumnValuesSwapped(beforeIndex, stateA, cityA, afterIndex, stateB, cityB);
+ if (afterIndex < orderingList.getNumberOfItems() - 1) {
+ checkButtonsMiddle();
+ }
+ else {
+ checkButtonsBottom();
+ }
+ }
+
+ protected void moveTop() {
+ int beforeIndex = orderingList.getIndexOfSelectedItem();
+ String stateA = orderingList.getItemColumnValue(beforeIndex, 0);
+ String cityA = orderingList.getItemColumnValue(beforeIndex, 1);
+ String stateB = orderingList.getItemColumnValue(0, 0);
+ String cityB = orderingList.getItemColumnValue(0, 1);
+ orderingList.moveTop();
+ int afterIndex = orderingList.getIndexOfSelectedItem();
+ assertEquals(afterIndex, 0, "The index of selected item doesn't match.");
+ checkColumnValuesMoved(beforeIndex, stateA, cityA, afterIndex, stateB, cityB);
+ checkButtonsTop();
+ }
+
+ protected void moveUp() {
+ int beforeIndex = orderingList.getIndexOfSelectedItem();
+ String stateA = orderingList.getItemColumnValue(beforeIndex, 0);
+ String cityA = orderingList.getItemColumnValue(beforeIndex, 1);
+ String stateB = orderingList.getItemColumnValue(beforeIndex - 1, 0);
+ String cityB = orderingList.getItemColumnValue(beforeIndex - 1, 1);
+ orderingList.moveUp();
+ int afterIndex = orderingList.getIndexOfSelectedItem();
+ assertEquals(afterIndex, beforeIndex - 1, "The index of selected item doesn't match.");
+ checkColumnValuesSwapped(beforeIndex, stateA, cityA, afterIndex, stateB, cityB);
+ if (afterIndex > 0) {
+ checkButtonsMiddle();
+ }
+ else {
+ checkButtonsTop();
+ }
+ }
+
+ private void checkColumnValuesSwapped(int indexA, String stateA, String cityA, int indexB, String stateB, String cityB) {
+ assertEquals(orderingList.getItemColumnValue(indexA, 0), stateB, "The rows weren't swapped succesfully after moving.");
+ assertEquals(orderingList.getItemColumnValue(indexA, 1), cityB, "The rows weren't swapped succesfully after moving.");
+ assertEquals(orderingList.getItemColumnValue(indexB, 0), stateA, "The rows weren't swapped succesfully after moving.");
+ assertEquals(orderingList.getItemColumnValue(indexB, 1), cityA, "The rows weren't swapped succesfully after moving.");
+ }
+
+ private void checkColumnValuesMoved(int indexA, String stateA, String cityA, int indexB, String stateB, String cityB) {
+ assertEquals(orderingList.getItemColumnValue(indexB + (int) Math.signum(indexA - indexB), 0), stateB, "The rows weren't moved succesfully after moving.");
+ assertEquals(orderingList.getItemColumnValue(indexB + (int) Math.signum(indexA - indexB), 1), cityB, "The rows weren't moved succesfully after moving.");
+ assertEquals(orderingList.getItemColumnValue(indexB, 0), stateA, "The rows weren't moved succesfully after moving.");
+ assertEquals(orderingList.getItemColumnValue(indexB, 1), cityA, "The rows weren't moved succesfully after moving.");
+ }
+
+}
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/TestOrderingList.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/TestOrderingList.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/TestOrderingList.java 2011-08-16 11:43:57 UTC (rev 22632)
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.richOrderingList;
+
+import java.net.URL;
+
+import org.jboss.test.selenium.utils.URLUtils;
+import org.richfaces.tests.metamer.ftest.model.OrderingList;
+import org.testng.annotations.Test;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertTrue;
+
+/**
+ * Selenium tests for page faces/components/richOrderingList/simple.xhtml.
+ *
+ * It checks whether the moving is OK.
+ *
+ * @author <a href="mailto:jpapouse@redhat.com">Jan Papousek</a>
+ */
+public class TestOrderingList extends AbstractOrderingListTest {
+
+ private OrderingList orderingList = new OrderingList();
+
+ @Override
+ public URL getTestUrl() {
+ return URLUtils.buildUrl(contextPath, "faces/components/richOrderingList/simple.xhtml");
+ }
+
+ @Test
+ public void testInit() {
+ assertTrue(orderingList.isOrderingListPresent(), "The ordering list should be present.");
+ assertFalse(orderingList.isButtonBottomEnabled(), "The button [bottom] should be disabled.");
+ assertFalse(orderingList.isButtonDownEnabled(), "The button [down] should be disabled.");
+ assertFalse(orderingList.isButtonTopEnabled(), "The button [top] should be disabled.");
+ assertFalse(orderingList.isButtonUpEnabled(), "The button [up] should be disabled.");
+ }
+
+ @Test
+ public void testSelectFirst() {
+ orderingList.selectItem(0);
+ checkButtonsTop();
+ }
+
+ @Test
+ public void testSelectLast() {
+ orderingList.selectItem(orderingList.getNumberOfItems() - 1);
+ checkButtonsBottom();
+ }
+
+ @Test
+ public void testSelectMiddle() {
+ orderingList.selectItem(2);
+ checkButtonsMiddle();
+ }
+
+
+}
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/TestOrderingListAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/TestOrderingListAttributes.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/TestOrderingListAttributes.java 2011-08-16 11:43:57 UTC (rev 22632)
@@ -0,0 +1,160 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.richOrderingList;
+
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jboss.test.selenium.css.CssProperty;
+import org.jboss.test.selenium.dom.Event;
+import org.jboss.test.selenium.locator.JQueryLocator;
+import org.jboss.test.selenium.utils.URLUtils;
+import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
+import org.testng.annotations.Test;
+import static org.testng.Assert.assertTrue;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.fail;
+
+/**
+ * Selenium tests for page faces/components/richOrderingList/simple.xhtml.
+ *
+ * @author <a href="mailto:jpapouse@redhat.com">Jan Papousek</a>
+ */
+public class TestOrderingListAttributes extends AbstractOrderingListTest {
+
+ @Override
+ public URL getTestUrl() {
+ return URLUtils.buildUrl(contextPath, "faces/components/richOrderingList/simple.xhtml");
+ }
+
+ @Test
+ public void testColumnClasses() {
+ fillAttribute("columnClasses", "some-class");
+ for (int i=0; i<getOrderingList().getNumberOfColumns(); i++) {
+ assertTrue(selenium.belongsClass(getOrderingList().getItemColumn(0, i), "some-class"), "The column <" + i + "> doesn't belong to set class <some-class>.");
+ }
+ }
+
+ @Test
+ public void testDisabled() {
+ fillAttribute("disabled", true);
+ try {
+ getOrderingList().getIndexOfSelectedItem();
+ fail("The attribute <disabled> is set to true, but the ordering list is still enabled.");
+ }
+ catch(IllegalStateException e) {}
+ }
+
+ @Test
+ public void testHeaderClass() {
+ fillAttribute("headerClass", "some-class");
+ assertTrue(selenium.belongsClass(getOrderingList().getHeader(), "some-class"), "The attribute <headerClass> is set to <some-class>, but the header doesn't belong to this class.");
+ }
+
+ @Test
+ public void testItemClass() {
+ fillAttribute("itemClass", "some-class");
+ assertTrue(selenium.belongsClass(getOrderingList().getItem(0), "some-class"), "The attribute <itemClass> is set to <some-class>, but the first item doesn't belong to this class.");
+ }
+
+ @Test
+ public void testListHeight() {
+ testSizeCssProperty(getOrderingList().getList(), "listHeight", CssProperty.HEIGHT);
+ }
+
+ @Test
+ public void testListWidth() {
+ testSizeCssProperty(getOrderingList().getList(), "listWidth", CssProperty.WIDTH);
+ }
+
+ @Test
+ public void testMaxListHeight() {
+ fillAttribute("listHeight", "");
+ testSizeCssProperty(getOrderingList().getList(), "maxListHeight", new CssProperty("max-height"));
+ }
+
+ @Test
+ public void testMinListHeight() {
+ fillAttribute("listHeight", "");
+ testSizeCssProperty(getOrderingList().getList(), "minListHeight", new CssProperty("min-height"));
+ }
+
+ @Test(enabled=false)
+ public void testOnClick() {
+ testFireEvent(Event.CLICK, pjq("div[id$=orderingList] tr[id$=orderingList]:first"));
+ }
+
+ @Test
+ public void testRendered() {
+ fillAttribute("rendered", false);
+ assertFalse(getOrderingList().isOrderingListPresent(), "The attribute <rendered> is set to <false>, but it has no effect.");
+ }
+
+ @Test
+ public void testSelectItemClass() {
+ fillAttribute("selectItemClass", "some-class");
+ getOrderingList().selectItem(0);
+ assertTrue(selenium.belongsClass(getOrderingList().getItem(0), "some-class"), "The attribute <selectItemClass> is set to <some-class>, but it has no effect.");
+ }
+
+ @Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-11311")
+ public void testShowButton() {
+ fillAttribute("showButton", false);
+ assertFalse(getOrderingList().isButtonBottomPresent(), "The attribute <showButton> is set <false>, but the button [bottom] is present.");
+ assertFalse(getOrderingList().isButtonDownPresent(), "The attribute <showButton> is set <false>, but the button [down] is present.");
+ assertFalse(getOrderingList().isButtonTopPresent(), "The attribute <showButton> is set <false>, but the button [top] is present.");
+ assertFalse(getOrderingList().isButtonUpPresent(), "The attribute <showButton> is set <false>, but the button [up] is present.");
+ }
+
+ @Test
+ public void testStyle() {
+ super.testStyle(getOrderingList().getLocator(), "style");
+ }
+
+ private void fillAttribute(String name, boolean value) {
+ JQueryLocator attribute = pjq("input[type=radio][name$=" + name + "Input][value=" + Boolean.toString(value) + "]");
+ selenium.click(attribute);
+ selenium.waitForPageToLoad();
+ }
+
+ private void fillAttribute(String name, String value) {
+ JQueryLocator attribute = pjq("input[name$=" + name + "Input]");
+ selenium.type(attribute, value);
+ selenium.fireEvent(attribute, Event.BLUR);
+ selenium.waitForPageToLoad();
+ }
+
+ private void testSizeCssProperty(JQueryLocator element, String attributeName, CssProperty cssProperty) {
+ Map<String, String> values = new HashMap<String, String>();
+ values.put("100", "100px");
+ values.put("200px", "200px");
+// values.put("200em", "200em");
+// values.put("200cm", "200cm");
+ for(String value : values.keySet()) {
+ fillAttribute(attributeName, value);
+ assertEquals(selenium.getStyle(getOrderingList().getList(), cssProperty), values.get(value), "The attribute <" + attributeName +"> is set to <" + value + ">, but it has no effect.");
+ }
+ }
+}
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/TestOrderingListMoving.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/TestOrderingListMoving.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richOrderingList/TestOrderingListMoving.java 2011-08-16 11:43:57 UTC (rev 22632)
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.richOrderingList;
+
+import java.net.URL;
+
+import org.jboss.test.selenium.utils.URLUtils;
+import org.testng.annotations.Test;
+
+/**
+ * Selenium tests for page faces/components/richOrderingList/simple.xhtml.
+ *
+ * It checks whether the moving is OK.
+ *
+ * @author <a href="mailto:jpapouse@redhat.com">Jan Papousek</a>
+ */
+public class TestOrderingListMoving extends AbstractOrderingListTest {
+
+ @Override
+ public URL getTestUrl() {
+ return URLUtils.buildUrl(contextPath, "faces/components/richOrderingList/simple.xhtml");
+ }
+
+ @Test
+ public void testMoveFirstBottom() {
+ getOrderingList().selectItem(0);
+ moveBottom();
+ }
+
+ @Test
+ public void testMoveFirstDown() {
+ getOrderingList().selectItem(0);
+ moveDown();
+ }
+
+ @Test
+ public void testMoveLastTop() {
+ getOrderingList().selectItem(getOrderingList().getNumberOfItems() - 1);
+ moveTop();
+ }
+
+ @Test
+ public void testMoveLastUp() {
+ getOrderingList().selectItem(getOrderingList().getNumberOfItems() - 1);
+ moveUp();
+ }
+
+ @Test
+ public void testMoveMiddleBottom() {
+ getOrderingList().selectItem(2);
+ moveBottom();
+ }
+
+ @Test
+ public void testMoveMiddleDown() {
+ getOrderingList().selectItem(2);
+ moveDown();
+ }
+
+ @Test
+ public void testMoveMiddleTop() {
+ getOrderingList().selectItem(2);
+ moveTop();
+ }
+
+ @Test
+ public void testMoveMiddleUp() {
+ getOrderingList().selectItem(2);
+ moveUp();
+ }
+
+}
13 years, 4 months