Author: konstantin.mishin
Date: 2008-10-10 11:31:09 -0400 (Fri, 10 Oct 2008)
New Revision: 10721
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/ListShuttleBean.java
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/listShuttle/listShuttleTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ListShuttleTest.java
Log:
Check 'showButtonsLabel' attribute
Check 'switchByClick' attribute
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/ListShuttleBean.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/ListShuttleBean.java 2008-10-10
15:11:46 UTC (rev 10720)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/ListShuttleBean.java 2008-10-10
15:31:09 UTC (rev 10721)
@@ -15,6 +15,8 @@
private boolean sourceRequired;
private boolean targetRequired;
+ private boolean showButtonLabels;
+ private boolean switchByClick;
public ListShuttleBean() {
init();
@@ -23,6 +25,8 @@
public void init() {
sourceRequired = false;
targetRequired = false;
+ showButtonLabels = true;
+ switchByClick = false;
items = new ArrayList<ListShuttleItem>();
freeItems = new ArrayList<ListShuttleItem>();
for (int i = 0; i < 5; i++) {
@@ -84,4 +88,20 @@
public void setTargetRequired(boolean targetRequired) {
this.targetRequired = targetRequired;
}
+
+ public boolean isShowButtonLabels() {
+ return showButtonLabels;
+ }
+
+ public void setShowButtonLabels(boolean showButtonLabels) {
+ this.showButtonLabels = showButtonLabels;
+ }
+
+ public boolean isSwitchByClick() {
+ return switchByClick;
+ }
+
+ public void setSwitchByClick(boolean switchByClick) {
+ this.switchByClick = switchByClick;
+ }
}
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/listShuttle/listShuttleTest.xhtml
===================================================================
(Binary files differ)
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ListShuttleTest.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ListShuttleTest.java 2008-10-10
15:11:46 UTC (rev 10720)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ListShuttleTest.java 2008-10-10
15:31:09 UTC (rev 10721)
@@ -46,12 +46,16 @@
String msgId;
- String reqFormId;
+ String attrFormId;
String sourceRequiredId;
String targetRequiredId;
+ String showButtonLabelsId;
+
+ String switchByClickId;
+
private void init(Template template) {
renderPage(template, initMethod);
parentId = getParentId() + "_form:";
@@ -69,12 +73,62 @@
resetId = parentId + "reset";
hideId = parentId + "hide";
msgId = getParentId() + "msgId";
- reqFormId = getParentId() + "reqFormId";
- sourceRequiredId = reqFormId + ":sourceRequiredId";
- targetRequiredId = reqFormId + ":targetRequiredId";
+ attrFormId = getParentId() + "attrFormId";
+ sourceRequiredId = attrFormId + ":sourceRequiredId";
+ targetRequiredId = attrFormId + ":targetRequiredId";
+ showButtonLabelsId = attrFormId + ":showButtonLabelsId";
+ switchByClickId = attrFormId + ":switchByClickId";
}
+
+
/**
+ * Check 'switchByClick' attribute
+ */
+ @Test
+ public void testSwitchByClick(Template template) {
+ init(template);
+ _selectItem(parentId + "ls:0");
+ Assert.assertEquals(getTextById(targetListId), "", "Target list
must be empty.");
+
+ selenium.click(switchByClickId);
+ waitForAjaxCompletion();
+ clickAjaxCommandAndWait(submitId);
+
+ _selectItem(parentId + "ls:0");
+ Assert.assertEquals(getTextById(targetListId), "1Item1", "Target
list mustn't be empty.");
+ }
+
+ /**
+ * Check 'showButtonsLabel' attribute
+ */
+ @Test
+ public void testShowButtonsLabel(Template template) {
+ init(template);
+ Assert.assertEquals(getTextById(copyAllId), "Copy all", "The text
on the button must be visible.");
+ Assert.assertEquals(getTextById(copyId), "Copy", "The text on the
button must be visible.");
+ Assert.assertEquals(getTextById(removeId), "Remove", "The text on
the button must be visible.");
+ Assert.assertEquals(getTextById(removeAllId), "Remove All", "The
text on the button must be visible.");
+ Assert.assertEquals(getTextById(firstId), "First", "The text on
the button must be visible.");
+ Assert.assertEquals(getTextById(upId), "Up", "The text on the
button must be visible.");
+ Assert.assertEquals(getTextById(downId), "Down", "The text on the
button must be visible.");
+ Assert.assertEquals(getTextById(lastId), "Last", "The text on the
button must be visible.");
+
+ selenium.click(showButtonLabelsId);
+ waitForAjaxCompletion();
+ clickAjaxCommandAndWait(submitId);
+
+ Assert.assertEquals(getTextById(copyAllId), "", "The text on the
button mustn't be visible.");
+ Assert.assertEquals(getTextById(copyId), "", "The text on the
button mustn't be visible.");
+ Assert.assertEquals(getTextById(removeId), "", "The text on the
button mustn't be visible.");
+ Assert.assertEquals(getTextById(removeAllId), "", "The text on the
button mustn't be visible.");
+ Assert.assertEquals(getTextById(firstId), "", "The text on the
button mustn't be visible.");
+ Assert.assertEquals(getTextById(upId), "", "The text on the button
mustn't be visible.");
+ Assert.assertEquals(getTextById(downId), "", "The text on the
button mustn't be visible.");
+ Assert.assertEquals(getTextById(lastId), "", "The text on the
button mustn't be visible.");
+ }
+
+ /**
* 'sourceRequired' and 'targetRequired' attributes work
*/
@Test