Author: andrei_exadel
Date: 2008-10-03 10:39:44 -0400 (Fri, 03 Oct 2008)
New Revision: 10663
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/ModalPanelTestBean.java
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/modalPanel/modalPanelTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ModalPanelTest.java
Log:
Modal Panel: test keepVisualState
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/ModalPanelTestBean.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/ModalPanelTestBean.java 2008-10-03
14:21:44 UTC (rev 10662)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/ModalPanelTestBean.java 2008-10-03
14:39:44 UTC (rev 10663)
@@ -18,6 +18,7 @@
private Boolean moveable = true;
private Boolean resizeable = true;
private Boolean autosized = false;
+ private Boolean keepVisualState = false;
private String input;
/**
* @return the rendered
@@ -87,6 +88,12 @@
return null;
}
+ public String changeKeepVisualState() {
+ keepVisualState = true;
+ showWhenRendered = false;
+ return null;
+ }
+
public String reset(){
rendered = true;
showWhenRendered = false;
@@ -94,6 +101,7 @@
resizeable = true;
input = null;
autosized = false;
+ keepVisualState = false;
return null;
}
@@ -121,5 +129,17 @@
public void setAutosized(Boolean autosized) {
this.autosized = autosized;
}
+ /**
+ * @return the keepVisualState
+ */
+ public Boolean getKeepVisualState() {
+ return keepVisualState;
+ }
+ /**
+ * @param keepVisualState the keepVisualState to set
+ */
+ public void setKeepVisualState(Boolean keepVisualState) {
+ this.keepVisualState = keepVisualState;
+ }
}
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/modalPanel/modalPanelTest.xhtml
===================================================================
(Binary files differ)
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ModalPanelTest.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ModalPanelTest.java 2008-10-03
14:21:44 UTC (rev 10662)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ModalPanelTest.java 2008-10-03
14:39:44 UTC (rev 10663)
@@ -25,6 +25,7 @@
private final static String CHANGE_RENDERED_ID="change_rendered";
private final static String CHANGE_ATTRIBUTES_ID="change_attributes";
private final static String CHANGE_AUTOSIZED_ID = "set_autosized";
+ private final static String CHANGE_VISUAL_STATE_ID = "keep_visual";
private final static String HIDE_ID="hide";
private final static String SHOW_ID="show";
private final static String PANEL_C_DIV_ID = PANEL_ID + "CDiv";
@@ -289,7 +290,40 @@
}
+ @Test
+ public void testKeepVisualState(Template template) {
+ renderPage(template, RESET_METHOD_NAME);
+ String message = "KeepVisualState attribute does not work";
+ clickChangeVisualState();
+
+
+ String headerId = getParentId() + PANEL_HEADER_ID;
+ String cIdvId = getParentId() + PANEL_C_DIV_ID;
+ String resizerId = getParentId() + PANEL_ID + "ResizerSEL";
+ String contentId = getParentId() + PANEL_CONTENT_DIV_ID;
+
+ selenium.dragAndDrop(headerId, "+10,+10");
+ selenium.dragAndDrop(resizerId, "+10,+10");
+
+ Integer left = (Integer)getLeftById(cIdvId);
+ Integer top = (Integer)getTopById(cIdvId);
+
+ String width = getWidth(contentId);
+ String height = getHeight(contentId);
+
+ String commandId = getParentId() + FORM2_ID + "submit";
+ clickCommandAndWait(commandId);
+
+ Assert.assertTrue(((Integer)getLeftById(cIdvId)).equals(left), message);
+ Assert.assertTrue(((Integer)getTopById(cIdvId)).equals(top), message);
+ Assert.assertTrue(getWidth(contentId).equals(width), message);
+ Assert.assertTrue(getHeight(contentId).equals(height), message);
+
+
+ }
+
+
private String getWidth(String id) {
String w = runScript("$('"+id+"').style.width", false);
return w;
@@ -323,6 +357,12 @@
writeStatus("Click change attributes button");
clickCommandAndWait(buttonId);
}
+
+ private void clickChangeVisualState() {
+ String buttonId = getParentId() + FORM_ID + CHANGE_VISUAL_STATE_ID;
+ writeStatus("Click change visual state button");
+ clickCommandAndWait(buttonId);
+ }
private void clickShow() {
String buttonId = getParentId() + FORM_ID + SHOW_ID;
Show replies by date