Author: ppitonak(a)redhat.com
Date: 2011-10-12 09:41:54 -0400 (Wed, 12 Oct 2011)
New Revision: 22788
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/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/richInputNumberSlider/TestRichSliderWithJSR303.java
Log:
tests for inplace input, inplace select and slider fixed
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-10-12
12:20:01 UTC (rev 22787)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceInput/TestRichInplaceInput.java 2011-10-12
13:41:54 UTC (rev 22788)
@@ -43,6 +43,7 @@
import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
import org.richfaces.tests.metamer.ftest.annotations.RegressionTest;
+import org.richfaces.tests.metamer.ftest.annotations.Templates;
import org.testng.annotations.Test;
/**
@@ -80,22 +81,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.");
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");
}
@@ -166,13 +170,16 @@
selenium.type(pjq("input[id$=activeClassInput]"),
"metamer-ftest-class");
selenium.waitForPageToLoad();
- assertFalse(selenium.belongsClass(inplaceInput, "metamer-ftest-class"),
"Inplace input should not have class metamer-ftest-class.");
+ assertFalse(selenium.belongsClass(inplaceInput,
"metamer-ftest-class"),
+ "Inplace input should not have class metamer-ftest-class.");
selenium.click(inplaceInput);
- assertTrue(selenium.belongsClass(inplaceInput, "metamer-ftest-class"),
"Inplace input should have class metamer-ftest-class.");
+ assertTrue(selenium.belongsClass(inplaceInput, "metamer-ftest-class"),
+ "Inplace input should have class metamer-ftest-class.");
selenium.fireEvent(input, Event.BLUR);
- assertFalse(selenium.belongsClass(inplaceInput, "metamer-ftest-class"),
"Inplace input should not have class metamer-ftest-class.");
+ assertFalse(selenium.belongsClass(inplaceInput,
"metamer-ftest-class"),
+ "Inplace input should not have class metamer-ftest-class.");
}
@Test
@@ -187,7 +194,7 @@
waitGui.failWith("Page was not updated").waitForChange(timeValue,
retrieveText.locator(time));
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.APPLY_REQUEST_VALUES, "value changed:
RichFaces 4 -> new value");
}
@@ -205,7 +212,8 @@
// it cannot handle null because of a bug in Mojarra and Myfaces and
// generates style="width: ; " instead of default value
- assertTrue(selenium.isAttributePresent(input.getAttribute(Attribute.STYLE)),
"Input doesn't have attribute style.");
+ assertTrue(selenium.isAttributePresent(input.getAttribute(Attribute.STYLE)),
+ "Input doesn't have attribute style.");
width = selenium.getAttribute(input.getAttribute(Attribute.STYLE));
assertTrue(!width.contains("width: ;"), "Default width of input
was not set (was " + width + ").");
}
@@ -236,7 +244,7 @@
waitGui.failWith("Page was not updated").waitForChange(timeValue,
retrieveText.locator(time));
waitGui.failWith("Attribute onchange does not work correctly").until(
- new EventFiredCondition(new Event("change")));
+ new EventFiredCondition(new Event("change")));
}
@Test
@@ -369,13 +377,16 @@
selenium.waitForPageToLoad();
selenium.click(inplaceInput);
- assertFalse(selenium.belongsClass(edit, "rf-ii-none"), "Edit
should not contain class rf-is-none when popup is open.");
+ assertFalse(selenium.belongsClass(edit, "rf-ii-none"),
+ "Edit should not contain class rf-is-none when popup is open.");
assertTrue(selenium.isDisplayed(input), "Input should be displayed.");
selenium.type(input, "new value");
selenium.fireEvent(input, Event.BLUR);
- assertFalse(selenium.belongsClass(inplaceInput, "rf-ii-c-s"), "New
class rf-ii-c-s should not be added to inplace input.");
- assertTrue(selenium.belongsClass(edit, "rf-ii-none"), "Edit should
contain class rf-is-none when popup is closed.");
+ assertFalse(selenium.belongsClass(inplaceInput, "rf-ii-c-s"),
+ "New class rf-ii-c-s should not be added to inplace input.");
+ assertTrue(selenium.belongsClass(edit, "rf-ii-none"),
+ "Edit should contain class rf-is-none when popup is closed.");
assertEquals(selenium.getText(label), "RichFaces 4", "Label should
not change.");
assertEquals(selenium.getText(output), "RichFaces 4", "Output
should not change.");
@@ -428,7 +439,7 @@
}
@Test
- @IssueTracking("https://issues.jboss.org/browse/RF-10980")
+ @Templates(exclude = { "richPopupPanel" })
public void testTabindex() {
AttributeLocator<?> attr = input.getAttribute(new
Attribute("tabindex"));
@@ -438,6 +449,18 @@
assertTrue(selenium.getAttribute(attr).contains("47"), "Attribute
tabindex should contain \"47\".");
}
+ @Test(groups = { "4.Future" })
+ @IssueTracking("https://issues.jboss.org/browse/RF-10980")
+ @Templates(value = { "richPopupPanel" })
+ public void testTabindexInPopupPanel() {
+ AttributeLocator<?> attr = input.getAttribute(new
Attribute("tabindex"));
+
+ selenium.type(pjq("input[id$=tabindexInput]"), "47");
+ selenium.waitForPageToLoad();
+
+ assertTrue(selenium.getAttribute(attr).contains("47"), "Attribute
tabindex should contain \"47\".");
+ }
+
@Test
public void testValue() {
selenium.type(pjq("input[type=text][id$=valueInput]"), "new
value");
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-10-12
12:20:01 UTC (rev 22787)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestRichInplaceSelect.java 2011-10-12
13:41:54 UTC (rev 22788)
@@ -43,6 +43,7 @@
import org.jboss.test.selenium.waiting.EventFiredCondition;
import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
+import org.richfaces.tests.metamer.ftest.annotations.Templates;
import org.testng.annotations.Test;
/**
@@ -81,14 +82,15 @@
@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.");
+ assertFalse(selenium.belongsClass(edit, "rf-is-none"),
+ "Edit should not contain class rf-is-none when popup is open.");
assertTrue(selenium.isDisplayed(popup), "Popup should be displayed.");
for (int i = 0; i < 50; i++) {
assertTrue(selenium.isDisplayed(options.format(i)), "Select option
" + i + " should be displayed.");
}
- String[] selectOptions = {"Alabama", "Hawaii",
"Massachusetts", "New Mexico", "South Dakota"};
+ String[] selectOptions = { "Alabama", "Hawaii",
"Massachusetts", "New Mexico", "South Dakota" };
for (int i = 0; i < 50; i += 10) {
assertEquals(selenium.getText(options.format(i)), selectOptions[i / 10],
"Select option nr. " + i);
}
@@ -98,7 +100,8 @@
waitGui.failWith("Output did not
change.").until(textEquals.locator(output).text("Hawaii"));
assertTrue(selenium.belongsClass(select, "rf-is-chng"), "New class
should be added to inplace select.");
- assertTrue(selenium.belongsClass(edit, "rf-is-none"), "Edit should
contain class rf-is-none when popup is closed.");
+ assertTrue(selenium.belongsClass(edit, "rf-is-none"),
+ "Edit should contain class rf-is-none when popup is closed.");
assertEquals(selenium.getText(label), "Hawaii", "Label should
contain selected value.");
@@ -180,14 +183,17 @@
selenium.type(pjq("input[id$=activeClassInput]"),
"metamer-ftest-class");
selenium.waitForPageToLoad();
- assertFalse(selenium.belongsClass(select, "metamer-ftest-class"),
"Inplace input should not have class metamer-ftest-class.");
+ assertFalse(selenium.belongsClass(select, "metamer-ftest-class"),
+ "Inplace input should not have class metamer-ftest-class.");
selenium.click(select);
- assertTrue(selenium.belongsClass(select, "metamer-ftest-class"),
"Inplace input should have class metamer-ftest-class.");
+ assertTrue(selenium.belongsClass(select, "metamer-ftest-class"),
+ "Inplace input should have class metamer-ftest-class.");
selenium.click(options.format(10));
guardXhr(selenium).fireEvent(input, Event.BLUR);
- assertFalse(selenium.belongsClass(select, "metamer-ftest-class"),
"Inplace input should not have class metamer-ftest-class.");
+ assertFalse(selenium.belongsClass(select, "metamer-ftest-class"),
+ "Inplace input should not have class metamer-ftest-class.");
}
@Test
@@ -203,7 +209,7 @@
waitGui.failWith("Page was not updated").waitForChange(reqTime,
retrieveText.locator(time));
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.APPLY_REQUEST_VALUES, "value changed: ->
Hawaii");
}
@@ -218,7 +224,8 @@
selenium.type(pjq("input[type=text][id$=inputWidthInput]"),
"");
selenium.waitForPageToLoad();
- assertFalse(selenium.isAttributePresent(input.getAttribute(Attribute.STYLE)),
"Input should not have attribute style.");
+ assertFalse(selenium.isAttributePresent(input.getAttribute(Attribute.STYLE)),
+ "Input should not have attribute style.");
}
@Test
@@ -228,8 +235,8 @@
selenium.waitForPageToLoad();
for (int i = 0; i < 50; i++) {
- assertTrue(selenium.belongsClass(options.format(i), value), "Select
option "
- + selenium.getText(options.format(i)) + " does not contain class
" + value);
+ assertTrue(selenium.belongsClass(options.format(i), value),
+ "Select option " + selenium.getText(options.format(i)) + "
does not contain class " + value);
}
}
@@ -297,8 +304,7 @@
selenium.click(options.format(10));
guardXhr(selenium).fireEvent(input, Event.BLUR);
- waitGui.failWith("Attribute onchange does not work correctly").until(
- new EventFiredCondition(Event.CHANGE));
+ waitGui.failWith("Attribute onchange does not work
correctly").until(new EventFiredCondition(Event.CHANGE));
}
@Test
@@ -319,8 +325,7 @@
selenium.click(select);
- waitGui.failWith("Attribute onfocus does not work correctly").until(
- new EventFiredCondition(Event.FOCUS));
+ waitGui.failWith("Attribute onfocus does not work correctly").until(new
EventFiredCondition(Event.FOCUS));
}
@Test
@@ -478,7 +483,7 @@
selenium.click(options.format(10));
waitGui.failWith("Attribute onselectitem does not work
correctly").until(
- new EventFiredCondition(new Event("selectitem")));
+ new EventFiredCondition(new Event("selectitem")));
}
@Test
@@ -487,7 +492,8 @@
selenium.waitForPageToLoad();
selenium.click(select);
- assertFalse(selenium.belongsClass(edit, "rf-is-none"), "Edit
should not contain class rf-is-none when popup is open.");
+ assertFalse(selenium.belongsClass(edit, "rf-is-none"),
+ "Edit should not contain class rf-is-none when popup is open.");
assertFalse(selenium.isDisplayed(popup), "Popup should not be
displayed.");
selenium.click(input);
@@ -569,9 +575,11 @@
selenium.click(select);
selenium.mouseOver(options.format(0));
- assertTrue(selenium.belongsClass(options.format(0),
"metamer-ftest-class"), "Selected item does not contain defined
class.");
+ assertTrue(selenium.belongsClass(options.format(0),
"metamer-ftest-class"),
+ "Selected item does not contain defined class.");
for (int i = 1; i < 50; i++) {
- assertFalse(selenium.belongsClass(options.format(i),
"metamer-ftest-class"), "Not selected item " + i + " should not
contain defined class.");
+ assertFalse(selenium.belongsClass(options.format(i),
"metamer-ftest-class"), "Not selected item " + i
+ + " should not contain defined class.");
}
}
@@ -625,7 +633,7 @@
}
@Test
- @IssueTracking("https://issues.jboss.org/browse/RF-10980")
+ @Templates(exclude = { "richPopupPanel" })
public void testTabindex() {
AttributeLocator<?> attr = input.getAttribute(new
Attribute("tabindex"));
@@ -635,12 +643,25 @@
assertTrue(selenium.getAttribute(attr).contains("47"), "Attribute
tabindex should contain \"47\".");
}
+ @Test(groups = { "4.Future" })
+ @IssueTracking("https://issues.jboss.org/browse/RF-10980")
+ @Templates(value = { "richPopupPanel" })
+ public void testTabindexInPopupPanel() {
+ AttributeLocator<?> attr = input.getAttribute(new
Attribute("tabindex"));
+
+ selenium.type(pjq("input[id$=tabindexInput]"), "47");
+ selenium.waitForPageToLoad();
+
+ assertTrue(selenium.getAttribute(attr).contains("47"), "Attribute
tabindex should contain \"47\".");
+ }
+
@Test
public void testValue() {
selenium.type(pjq("input[type=text][id$=valueInput]"), "North
Carolina");
selenium.waitForPageToLoad();
- assertTrue(selenium.belongsClass(edit, "rf-is-none"), "Edit should
contain class rf-is-none when popup is closed.");
+ assertTrue(selenium.belongsClass(edit, "rf-is-none"),
+ "Edit should contain class rf-is-none when popup is closed.");
assertEquals(selenium.getText(label), "North Carolina", "Label
should contain selected 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-10-12
12:20:01 UTC (rev 22787)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSlider/TestRichSlider.java 2011-10-12
13:41:54 UTC (rev 22788)
@@ -49,6 +49,7 @@
import org.jboss.test.selenium.locator.ElementLocator;
import org.jboss.test.selenium.locator.JQueryLocator;
import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
+import org.richfaces.tests.metamer.ftest.annotations.Templates;
import org.richfaces.tests.metamer.ftest.annotations.Use;
import org.testng.annotations.Test;
@@ -112,12 +113,26 @@
}
@Test
+ @Templates(exclude = { "richPopupPanel", "richAccordion" })
@Override
- @IssueTracking("https://issues.jboss.org/browse/RF-11314")
public void testClick() {
super.testClick();
}
+ @Test(groups = { "4.Future" })
+ @IssueTracking("https://issues.jboss.org/browse/RF-11314")
+ @Templates(value = { "richPopupPanel" })
+ public void testClickInPopupPanel() {
+ super.testClick();
+ }
+
+ @Test(groups = { "4.Future" })
+ @IssueTracking("https://issues.jboss.org/browse/RF-11314")
+ @Templates(value = { "richAccordion" })
+ public void testClickInAccordion() {
+ super.testClick();
+ }
+
@Test
public void testInit() {
assertTrue(selenium.isDisplayed(slider), "Slider is not present on the
page.");
@@ -132,11 +147,18 @@
}
@Test
- @IssueTracking("https://issues.jboss.org/browse/RF-11315")
+ @Templates(exclude = { "richPopupPanel" })
public void testAccesskey() {
testHtmlAttribute(input, "accesskey", "x");
}
+ @Test(groups = { "4.Future" })
+ @IssueTracking("https://issues.jboss.org/browse/RF-11315")
+ @Templates(value = { "richPopupPanel" })
+ public void testAccesskeyInPopupPanel() {
+ testHtmlAttribute(input, "accesskey", "x");
+ }
+
@Test
public void testDecreaseClass() {
selenium.click(pjq("input[type=radio][name$=showArrowsInput][value=true]"));
@@ -159,7 +181,7 @@
}
@Test
- @Use(field = "delay", ints = {800, 1250, 3700})
+ @Use(field = "delay", ints = { 800, 1250, 3700 })
public void testDelay() {
selenium.type(pjq("input[type=text][id$=delayInput]"),
delay.toString());
selenium.waitForPageToLoad();
@@ -196,6 +218,7 @@
}
@Test
+ @Templates(exclude = { "richPopupPanel", "richAccordion" })
public void testEnableManualInput() {
JQueryLocator selectOption =
pjq("input[type=radio][name$=enableManualInputInput][value=false]");
selenium.click(selectOption);
@@ -207,6 +230,18 @@
testClick();
}
+ @Test(groups = { "4.Future" })
+ @Templates(value = { "richPopupPanel" })
+ public void testEnableManualInputInPopupPanel() {
+ testEnableManualInput();
+ }
+
+ @Test(groups = { "4.Future" })
+ @Templates(value = { "richAccordion" })
+ public void testEnableManualInputInAccordion() {
+ testEnableManualInput();
+ }
+
@Test
public void testHandleClass() {
testStyleClass(handle, handleClass);
@@ -228,13 +263,15 @@
selenium.waitForPageToLoad();
String reqTime = selenium.getText(time);
- guardXhr(selenium).mouseDownAt(track, new Point(0, 0));
+ guardXhr(selenium).type(input, "-10");
waitGui.failWith("Page was not updated").waitForChange(reqTime,
retrieveText.locator(time));
phaseInfo.assertPhases(PhaseId.RESTORE_VIEW, PhaseId.APPLY_REQUEST_VALUES,
PhaseId.PROCESS_VALIDATIONS,
- PhaseId.UPDATE_MODEL_VALUES, PhaseId.INVOKE_APPLICATION,
PhaseId.RENDER_RESPONSE);
- // Remove first 2 preceding chars from correct message (used to remove usual
'* ' token)
+ PhaseId.UPDATE_MODEL_VALUES, PhaseId.INVOKE_APPLICATION,
PhaseId.RENDER_RESPONSE);
+ // Remove first 2 preceding chars from correct message (used to remove usual
'* ' token)
phaseInfo.assertListener(PhaseId.APPLY_REQUEST_VALUES, "value changed: 2
-> -10");
+
+ assertEquals(selenium.getText(output), "-10", "Output was not
updated.");
}
@Test
@@ -340,6 +377,7 @@
}
@Test
+ @Templates(exclude = { "richPopupPanel", "richAccordion" })
public void testMaxValueClick() {
selenium.type(pjq("input[type=text][id$=maxValueInput]"),
"20");
selenium.waitForPageToLoad();
@@ -350,16 +388,30 @@
waitGui.failWith("Page was not updated").waitForChange(reqTime,
retrieveText.locator(time));
assertEquals(selenium.getText(output), "17", "Output was not
updated.");
int margin = selenium.getElementPositionLeft(handle) -
selenium.getElementPositionLeft(track);
- assertTrue(margin >= 167 && margin <= 173, "Left margin of
handle should be between 167 and 173 (was " + margin + ").");
+ assertTrue(margin >= 167 && margin <= 173, "Left margin of
handle should be between 167 and 173 (was " + margin
+ + ").");
reqTime = selenium.getText(time);
guardXhr(selenium).mouseDownAt(track, new Point(195, 0));
waitGui.failWith("Page was not updated").waitForChange(reqTime,
retrieveText.locator(time));
assertEquals(selenium.getText(output), "20", "Output was not
updated.");
margin = selenium.getElementPositionLeft(handle) -
selenium.getElementPositionLeft(track);
- assertTrue(margin >= 192 && margin <= 198, "Left margin of
handle should be between 192 and 198 (was " + margin + ").");
+ assertTrue(margin >= 192 && margin <= 198, "Left margin of
handle should be between 192 and 198 (was " + margin
+ + ").");
}
+ @Test(groups = { "4.Future" })
+ @Templates(value = { "richAccordion" })
+ public void testMaxValueClickInAccordion() {
+ testMaxValueClick();
+ }
+
+ @Test(groups = { "4.Future" })
+ @Templates(value = { "richPopupPanel" })
+ public void testMaxValueClickInPopupPanel() {
+ testMaxValueClick();
+ }
+
@Test
@IssueTracking("https://issues.jboss.org/browse/RF-9860")
public void testMaxlength() {
@@ -393,6 +445,7 @@
}
@Test
+ @Templates(exclude = { "richPopupPanel", "richAccordion" })
public void testMinValueClick() {
selenium.type(pjq("input[type=text][id$=minValueInput]"),
"-20");
selenium.waitForPageToLoad();
@@ -403,7 +456,8 @@
waitGui.failWith("Page was not updated").waitForChange(reqTime,
retrieveText.locator(time));
assertEquals(selenium.getText(output), "-16", "Output was not
updated.");
int margin = selenium.getElementPositionLeft(handle) -
selenium.getElementPositionLeft(track);
- assertTrue(margin >= 25 && margin <= 31, "Left margin of
handle should be between 25 and 31 (was " + margin + ").");
+ assertTrue(margin >= 25 && margin <= 31, "Left margin of
handle should be between 25 and 31 (was " + margin
+ + ").");
reqTime = selenium.getText(time);
guardXhr(selenium).mouseDownAt(track, new Point(0, 0));
@@ -413,7 +467,19 @@
assertTrue(margin <= 3, "Left margin of handle should be between 0 and 3
(was " + margin + ").");
}
- @Test
+ @Test(groups = { "4.Future" })
+ @Templates(value = { "richAccordion" })
+ public void testMinValueClickInAccordion() {
+ testMinValueClick();
+ }
+
+ @Test(groups = { "4.Future" })
+ @Templates(value = { "richPopupPanel" })
+ public void testMinValueClickInPopupPanel() {
+ testMinValueClick();
+ }
+
+ @Test(groups = { "4.Future" })
@IssueTracking("https://issues.jboss.org/browse/RF-10829")
public void testOnblur() {
testFireEvent(Event.BLUR, slider);
@@ -438,6 +504,7 @@
}
@Test
+ @Templates(exclude = { "richPopupPanel" })
public void testOnchangeClick() {
selenium.click(pjq("input[type=radio][name$=showArrowsInput][value=true]"));
selenium.waitForPageToLoad();
@@ -461,6 +528,12 @@
assertEquals(events.length, 3, "Three events should be fired.");
}
+ @Test(groups = { "4.Future" })
+ @Templates(value = { "richPopupPanel" })
+ public void testOnchangeClickInPopupPanel() {
+ testOnchangeClick();
+ }
+
@Test
public void testOnclick() {
testFireEvent(Event.CLICK, slider);
@@ -471,7 +544,7 @@
testFireEvent(Event.DBLCLICK, slider);
}
- @Test
+ @Test(groups = { "4.Future" })
@IssueTracking("https://issues.jboss.org/browse/RF-10829")
public void testOnfocus() {
testFireEvent(Event.FOCUS, slider);
@@ -517,7 +590,7 @@
testFireEvent(Event.MOUSEUP, slider);
}
- @Test
+ @Test(groups = { "4.Future" })
@IssueTracking("https://issues.jboss.org/browse/RF-10829")
public void testOnselect() {
testFireEvent(Event.SELECT, slider);
@@ -562,7 +635,7 @@
}
@Test
- @IssueTracking("https://issues.jboss.org/browse/RF-11314")
+ @Templates(exclude = { "richPopupPanel", "richAccordion" })
public void testShowTooltip() {
selenium.click(pjq("input[type=radio][name$=showTooltipInput][value=true]"));
selenium.waitForPageToLoad();
@@ -578,6 +651,20 @@
assertFalse(selenium.isVisible(tooltip), "Tooltip should not be
visible.");
}
+ @Test(groups = { "4.Future" })
+ @IssueTracking("https://issues.jboss.org/browse/RF-11314")
+ @Templates(value = { "richAccordion" })
+ public void testShowTooltipInAccordion() {
+ testShowTooltip();
+ }
+
+ @Test(groups = { "4.Future" })
+ @IssueTracking("https://issues.jboss.org/browse/RF-11314")
+ @Templates(value = { "richPopupPanel" })
+ public void testShowTooltipInPopupPanel() {
+ testShowTooltip();
+ }
+
@Test
public void testStep() {
selenium.click(pjq("input[type=radio][name$=showArrowsInput][value=true]"));
@@ -617,7 +704,7 @@
}
@Test
- @IssueTracking("https://issues.jboss.org/browse/RF-10980")
+ @Templates(exclude = { "richPopupPanel" })
public void testTabindex() {
selenium.type(pjq("input[id$=tabindexInput]"), "55");
selenium.waitForPageToLoad(TIMEOUT);
@@ -631,6 +718,13 @@
assertEquals(selenium.getAttribute(attr), "55", "Attribute
tabindex of input.");
}
+ @Test(groups = { "4.Future" })
+ @IssueTracking("https://issues.jboss.org/browse/RF-10980")
+ @Templates(value = { "richPopupPanel" })
+ public void testTabindexInPopupPanel() {
+ testTabindex();
+ }
+
@Test
public void testTooltipClass() {
selenium.click(pjq("input[type=radio][name$=showTooltipInput][value=true]"));
@@ -676,15 +770,19 @@
/**
* Clicks on slider's arrow.
- * @param arrow slider's left or right arrow locator
- * @param clicks how many times should it be clicked
+ *
+ * @param arrow
+ * slider's left or right arrow locator
+ * @param clicks
+ * how many times should it be clicked
*/
private void clickArrow(ElementLocator<?> arrow, int clicks) {
String reqTime = null;
for (int i = 0; i < clicks; i++) {
reqTime = selenium.getText(time);
- guardXhr(selenium).runScript(new JavaScript("jQuery(\"" +
arrow.getRawLocator() + "\").mousedown().mouseup()"));
+ guardXhr(selenium).runScript(
+ new JavaScript("jQuery(\"" + arrow.getRawLocator() +
"\").mousedown().mouseup()"));
waitGui.failWith("Page was not updated").waitForChange(reqTime,
retrieveText.locator(time));
}
@@ -692,8 +790,11 @@
/**
* Clicks on slider's arrow and verifies delay.
- * @param arrow slider's left or right arrow locator
- * @param delay awaited delay between ajax requests
+ *
+ * @param arrow
+ * slider's left or right arrow locator
+ * @param delay
+ * awaited delay between ajax requests
*/
private void verifyDelay(JQueryLocator arrow, int delay) throws ParseException {
SimpleDateFormat sdf = new SimpleDateFormat("hh:mm:ss.SSS");
@@ -718,7 +819,8 @@
delta = (long) (delay * 0.5);
long average = countAverage(timesArray);
- assertTrue(Math.abs(average - delay) < delta, "Average delay " +
average + " is too far from set value (" + delay + ")");
+ assertTrue(Math.abs(average - delay) < delta, "Average delay " +
average + " is too far from set value ("
+ + delay + ")");
}
private long countAverage(Date[] times) {
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-10-12
12:20:01 UTC (rev 22787)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSlider/TestRichSliderWithJSR303.java 2011-10-12
13:41:54 UTC (rev 22788)
@@ -29,47 +29,47 @@
import org.jboss.test.selenium.waiting.TextContainsCondition;
import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
+import org.richfaces.tests.metamer.ftest.annotations.Templates;
import org.testng.Assert;
import org.testng.annotations.Test;
/**
* Test for faces/components/richInputNumberSpinner/jsr303.xhtml page
- *
+ *
* @author <a href="mailto:jjamrich@redhat.com">Jan Jamrich</a>
* @version $Revision$
*/
public class TestRichSliderWithJSR303 extends AbstractMetamerTest {
-
+
/** Wrong value for input validated to min value */
public static final String WRONG_MIN_VAL = "1";
/** Wrong value for input validated to max value */
public static final String WRONG_MAX_VAL = "5";
/** Wrong value for input validated to custom value */
public static final String WRONG_CUSTOM_VAL = "-1";
-
+
/** Wrong value for input validated to min value */
public static final String CORRECT_MIN_VAL = "3";
/** Wrong value for input validated to max value */
public static final String CORRECT_MAX_VAL = "1";
/** Wrong value for input validated to custom value */
public static final String CORRECT_CUSTOM_VAL = "5";
-
-
+
/** validation message for input validated to min value */
public static final String MSG_MIN = "must be greater than or equal to 2";
/** validation message for input validated to max value */
public static final String MSG_MAX = "must be less than or equal to 2";
/** validation message for input validated to custom value */
public static final String MSG_CUSTOM = "must be a positive number";
-
+
private JQueryLocator inputFormat = pjq("span[id$=:slider{0}]
span.rf-insl-inp-cntr > input");
private JQueryLocator msgFormat = pjq("span.rf-msg[id$=:inputMsg{0}]
span.rf-msg-det");
private JQueryLocator outputFormat = pjq("span[id$=:output{0}]");
private JQueryLocator sliderFormat = pjq("span[id$=:slider{0}]
span.rf-insl-trc");
-
+
private JQueryLocator hCommandBtn = pjq("input[id$=:hButton]");
private JQueryLocator a4jCommandBtn = pjq("input[id$=:a4jButton]");
-
+
/** Codes for inputs */
private enum ID {
/** input validated to min val */
@@ -78,33 +78,35 @@
MAX(2),
/** input validated to custom (positive) val */
CUSTOM(3);
-
+
private int id;
+
private ID(int i) {
this.id = i;
}
+
public int val() {
return id;
}
}
-
- /** Position coordinates for slider.
- * Width is 200px, positions are relative to this
+
+ /**
+ * Position coordinates for slider. Width is 200px, positions are relative to this
*/
private enum POSITION {
- LESS_THAN_ZERO(10),
- ZERO(100),
- MORE_THAN_TWO(150);
-
+ LESS_THAN_ZERO(10), ZERO(100), MORE_THAN_TWO(150);
+
private int position;
+
private POSITION(int position) {
this.position = position;
}
- public int val(){
+
+ public int val() {
return position;
}
}
-
+
private void setAllCorrect() {
selenium.type(inputFormat.format(ID.MIN.val()), CORRECT_MIN_VAL);
selenium.fireEvent(inputFormat.format(ID.MIN.val()), Event.BLUR);
@@ -113,7 +115,7 @@
selenium.type(inputFormat.format(ID.CUSTOM.val()), CORRECT_CUSTOM_VAL);
selenium.fireEvent(inputFormat.format(ID.CUSTOM.val()), Event.BLUR);
}
-
+
private void setAllWrong() {
selenium.type(inputFormat.format(ID.MIN.val()), WRONG_MIN_VAL);
selenium.fireEvent(inputFormat.format(ID.MIN.val()), Event.BLUR);
@@ -121,91 +123,106 @@
selenium.fireEvent(inputFormat.format(ID.MAX.val()), Event.BLUR);
selenium.type(inputFormat.format(ID.CUSTOM.val()), WRONG_CUSTOM_VAL);
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(TextContainsCondition.getInstance().text(MSG_CUSTOM).locator(msgFormat.format(ID.CUSTOM.val())));
}
-
+
@Override
public URL getTestUrl() {
return URLUtils.buildUrl(contextPath,
"faces/components/richInputNumberSlider/jsr303.xhtml");
}
-
+
@Test
public void testMin() {
selenium.type(inputFormat.format(ID.MIN.val()), WRONG_MIN_VAL);
selenium.fireEvent(inputFormat.format(ID.MIN.val()), Event.BLUR);
waitGui.until(TextContainsCondition.getInstance().locator(msgFormat.format(ID.MIN.val())).text(MSG_MIN));
}
-
+
@Test
- public void testSlideToMin() {
+ @Templates(exclude = { "richPopupPanel" })
+ public void testSlideToMin() {
setAllCorrect();
-
+
selenium.mouseDownAt(sliderFormat.format(ID.MIN.val()), new
Point(POSITION.ZERO.val(), 0));
-
waitGui.until(TextContainsCondition.getInstance().locator(msgFormat.format(ID.MIN.val())).text(MSG_MIN));
+
waitGui.until(TextContainsCondition.getInstance().locator(msgFormat.format(ID.MIN.val())).text(MSG_MIN));
}
-
+
+ @Test(groups = { "4.Future" })
+ @Templates(value = { "richPopupPanel" })
+ public void testSlideToMinInPopupPanel() {
+ testSlideToMin();
+ }
+
@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(TextContainsCondition.getInstance().locator(msgFormat.format(ID.MAX.val())).text(MSG_MAX));
}
-
+
@Test
- public void testSlideToMax() {
+ @Templates(exclude = { "richPopupPanel" })
+ public void testSlideToMax() {
setAllCorrect();
-
+
selenium.mouseDownAt(sliderFormat.format(ID.MAX.val()), new
Point(POSITION.MORE_THAN_TWO.val(), 0));
waitGui.until(TextContainsCondition.getInstance().locator(msgFormat.format(ID.MAX.val())).text(MSG_MAX));
}
-
+
+ @Test(groups = { "4.Future" })
+ @Templates(value = { "richPopupPanel" })
+ public void testSlideToMaxInPopupPanel() {
+ testSlideToMax();
+ }
+
@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(TextContainsCondition.getInstance().text(MSG_CUSTOM).locator(msgFormat.format(ID.CUSTOM.val())));
}
-
+
@Test
public void testSlideToNegative() {
setAllCorrect();
-
+
selenium.mouseDownAt(sliderFormat.format(ID.CUSTOM.val()), new
Point(POSITION.LESS_THAN_ZERO.val(), 0));
waitGui.until(TextContainsCondition.getInstance().locator(msgFormat.format(ID.CUSTOM.val())).text(MSG_CUSTOM));
}
-
- @Test
+
+ @Test
+ @Templates(exclude = { "a4jRegion" })
public void testAllCorrect() {
-
+
setAllCorrect();
-
- waitGui.until(textEquals.text(CORRECT_MIN_VAL)
- .locator(outputFormat.format(ID.MIN.val())));
+
+
waitGui.until(textEquals.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")
+ @Templates(exclude = { "a4jRegion" })
public void testAllWrong() {
-
+
setAllCorrect();
setAllWrong();
-
+
selenium.click(hCommandBtn);
-
+
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);
-
+
setAllCorrect();
setAllWrong();
-
+
selenium.click(a4jCommandBtn);
-
+
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);