Author: dsvyatobatsko
Date: 2008-06-04 10:07:49 -0400 (Wed, 04 Jun 2008)
New Revision: 8900
Added:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/template/TestConstants.java
Removed:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/Templates.java
Modified:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/TemplateBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/template/Template.java
trunk/test-applications/seleniumTest/src/main/webapp/layout/controlLayout.xhtml
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/RichSeleniumTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SeleniumTestBase.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxCommandButtonTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxCommandLinkTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxPollTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxRegionTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxStatusTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/CalendarTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ComboBoxTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ContextMenuTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/DataTableTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/DropDownMenuTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InplaceSelectTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InputNumberSliderTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InputNumberSpinnerTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/JSFunctionTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/KeepAliveTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/LoadScriptTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/LoadStyleTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/OrderingListTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/PanelBarTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/PanelMenuTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/PickListTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ProgressBarTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/SimpleTogglePanelTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/SpacerTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/TabPanelTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/TogglePanelTest.java
Log:
refactoring
Modified:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/TemplateBean.java
===================================================================
---
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/TemplateBean.java 2008-06-04
10:32:10 UTC (rev 8899)
+++
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/TemplateBean.java 2008-06-04
14:07:49 UTC (rev 8900)
@@ -21,53 +21,60 @@
package org.ajax4jsf.bean;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.faces.model.SelectItem;
+
import org.ajax4jsf.template.Template;
-
public class TemplateBean {
- public static final String PARAM_NAME = "t";
-
- private String template = "simple";
+ public static final String PARAM_NAME = "t";
- /*public void initTemplate (ActionEvent event) {
- Map<String, String> reqMap =
FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
- String template = reqMap.get(PARAM_NAME);
- this.template = template != null ? template : "simple";
- }*/
-
- public String getTemplateId() {
- return template;
- }
-
- public void setTemplateId(String template) {
- if (this.template != null && !this.template.equals(template)) {
- this.template = template;
- }
- }
-
-
- public String getParentId () {
- if ("dataTable".equals(template)) {
- return Template.COMPONENT_PREFIX_INSIDE_TABLE;
- }
- return Template.COMPONENT_PREFIX_SIMPLE;
- }
+ private Template template = Template.SIMPLE;
+ /*
+ * public void initTemplate (ActionEvent event) { Map<String, String>
+ * reqMap =
+ * FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
+ * String template = reqMap.get(PARAM_NAME); this.template = template !=
+ * null ? template : "simple"; }
+ */
- /**
- * @return the template
- */
- public String getTemplate() {
- return "../../template/" + template + ".xhtml";
- }
+ public String getTemplateId() {
+ return template.toString();
+ }
+ public void setTemplateId(String template) {
+ this.template = Template.valueOf(template);
+ }
- /**
- * @param template the template to set
- */
- public void setTemplate(String template) {
- this.template = template;
- }
-
-
+ public String getParentId() {
+ return template.getPrefix();
+ }
+
+ /**
+ * @return the template
+ */
+ public String getTemplate() {
+ return "../../template/" + template.getName() + ".xhtml";
+ }
+
+ /**
+ * @param template
+ * the template to set
+ */
+ public void setTemplate(Template template) {
+ this.template = template;
+ }
+
+ public List<SelectItem> getAvailableTemplates() {
+ List<SelectItem> retVal = new ArrayList<SelectItem>();
+ for (Template template : Template.values()) {
+ retVal.add(new SelectItem(template.toString(), template.getDesc()));
+ }
+
+ return retVal;
+ }
+
}
\ No newline at end of file
Modified:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/template/Template.java
===================================================================
---
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/template/Template.java 2008-06-04
10:32:10 UTC (rev 8899)
+++
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/template/Template.java 2008-06-04
14:07:49 UTC (rev 8900)
@@ -1,9 +1,55 @@
package org.ajax4jsf.template;
-public interface Template {
+/**
+ * Kids of templates that can be put in harness.
+ * @author carcasser
+ *
+ */
+public enum Template implements TestConstants {
+ SIMPLE (SIMPLE_TEMPLATE_NAME, COMPONENT_PREFIX_SIMPLE, SIMPLE_TEMPLATE_DESC),
+ DATA_TABLE (DATA_TABLE_TEMPLATE_NAME, COMPONENT_PREFIX_INSIDE_TABLE,
DATA_TABLE_TEMPLATE_DESC),
+ MODAL_PANEL (MODAL_PANEL_TEMPLATE_NAME, COMPONENT_PREFIX_SIMPLE,
MODAL_PANEL_TEMPLATE_DESC);
- public static final String COMPONENT_PREFIX_INSIDE_TABLE =
"_Selenium_Test_DataTable:0:";
+ private String name;
- public static final String COMPONENT_PREFIX_SIMPLE = "";
-
+ private String prefix;
+
+ private String desc;
+
+ /**
+ * Private constructor.
+ *
+ * @param name
+ * @param prefix
+ */
+ private Template(String name, String prefix, String desc) {
+ this.name = name;
+ this.prefix = prefix;
+ this.desc = desc;
+ }
+
+ /**
+ * Gets value of name field.
+ * @return value of name field
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Gets value of prefix field.
+ * @return value of prefix field
+ */
+ public String getPrefix() {
+ return prefix;
+ }
+
+ /**
+ * Gets value of desc field.
+ * @return value of desc field
+ */
+ public String getDesc() {
+ return desc;
+ }
+
}
Added:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/template/TestConstants.java
===================================================================
---
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/template/TestConstants.java
(rev 0)
+++
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/template/TestConstants.java 2008-06-04
14:07:49 UTC (rev 8900)
@@ -0,0 +1,19 @@
+package org.ajax4jsf.template;
+
+public interface TestConstants {
+
+ /* Constants of component prefixes */
+ public static final String COMPONENT_PREFIX_INSIDE_TABLE =
"_Selenium_Test_DataTable:0:";
+ public static final String COMPONENT_PREFIX_SIMPLE = "";
+
+ /* Constants of template names */
+ public static final String SIMPLE_TEMPLATE_NAME = "simple";
+ public static final String DATA_TABLE_TEMPLATE_NAME = "dataTable";
+ public static final String MODAL_PANEL_TEMPLATE_NAME = "modalPanel";
+
+ /* Constants of template descriptions */
+ public static final String SIMPLE_TEMPLATE_DESC = "Simple";
+ public static final String DATA_TABLE_TEMPLATE_DESC = "DataTable";
+ public static final String MODAL_PANEL_TEMPLATE_DESC = "Modal Panel";
+
+}
Property changes on:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/template/TestConstants.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified: trunk/test-applications/seleniumTest/src/main/webapp/layout/controlLayout.xhtml
===================================================================
---
trunk/test-applications/seleniumTest/src/main/webapp/layout/controlLayout.xhtml 2008-06-04
10:32:10 UTC (rev 8899)
+++
trunk/test-applications/seleniumTest/src/main/webapp/layout/controlLayout.xhtml 2008-06-04
14:07:49 UTC (rev 8900)
@@ -12,9 +12,7 @@
</td>
<td>
<h:selectOneMenu value="#{templateBean.templateId}"
id="_Selenium_Test_Template_id">
- <f:selectItem itemValue="simple" itemLabel="Simple"/>
- <f:selectItem itemValue="dataTable" itemLabel="DataTable"/>
- <f:selectItem itemValue="modalPanel" itemLabel="Modal
Panel"/>
+ <f:selectItems value="#{templateBean.availableTemplates}" />
</h:selectOneMenu>
</td>
<td>
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/RichSeleniumTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/RichSeleniumTest.java 2008-06-04
10:32:10 UTC (rev 8899)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/RichSeleniumTest.java 2008-06-04
14:07:49 UTC (rev 8900)
@@ -1,11 +1,11 @@
package org.richfaces;
public interface RichSeleniumTest {
-
- public void startSelenium (String browser);
-
- public void stopSelenium();
-
- public String getTestUrl();
-
+
+ public void startSelenium(String browser);
+
+ public void stopSelenium();
+
+ public String getTestUrl();
+
}
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SeleniumTestBase.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SeleniumTestBase.java 2008-06-04
10:32:10 UTC (rev 8899)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SeleniumTestBase.java 2008-06-04
14:07:49 UTC (rev 8900)
@@ -22,6 +22,7 @@
package org.richfaces;
import org.ajax4jsf.javascript.ScriptUtils;
+import org.ajax4jsf.template.Template;
import org.testng.Assert;
import com.thoughtworks.selenium.DefaultSelenium;
@@ -91,55 +92,59 @@
selenium.start();
}
- /**
- * Renders page
- */
- @Deprecated
- protected void renderPage(String homePage) {
- selenium.open(protocol + "://" + host + ":" + port +
"/" + APPLICATION_NAME + homePage);
- selenium.waitForPageToLoad(String.valueOf(pageRenderTime));
+// /**
+// * Renders page
+// */
+// @Deprecated
+// protected void renderPage(String homePage) {
+// selenium.open(protocol + "://" + host + ":" + port +
"/" + APPLICATION_NAME + homePage);
+// selenium.waitForPageToLoad(String.valueOf(pageRenderTime));
+//
+// checkPageRendering(); // At the first we check if page has been
+// // rendered
+// checkJSError(); // At the second we check if JS errors occurred
+//
+// // reRenderForm(); // ReRender component
+//
+// // checkPageRendering(); // Check all again
+// // checkJSError();
+//
+// }
- checkPageRendering(); // At the first we check if page has been
- // rendered
- checkJSError(); // At the second we check if JS errors occurred
-
- // reRenderForm(); // ReRender component
-
- // checkPageRendering(); // Check all again
- // checkJSError();
-
- }
-
- /**
- * Renders page
- */
- @Deprecated
- protected void renderPage(String homePage, Templates template) {
- selenium.open(protocol + "://" + host + ":" + port +
"/" + APPLICATION_NAME + homePage);
- selenium.waitForPageToLoad(String.valueOf(pageRenderTime));
-
- template.loadTemplate(this);
-
- checkPageRendering(); // At the first we check if page has been
- // rendered
- checkJSError(); // At the second we check if JS errors occurred
-
- reRenderForm(); // ReRender component
-
- checkPageRendering(); // Check all again
- checkJSError();
-
- }
+// /**
+// * Renders page
+// */
+// @Deprecated
+// protected void renderPage(String homePage, Template template) {
+// selenium.open(protocol + "://" + host + ":" + port +
"/" + APPLICATION_NAME + homePage);
+// selenium.waitForPageToLoad(String.valueOf(pageRenderTime));
+//
+// setParentId(template.getPrefix());
+// runScript("loadTemplate('" + template.getName() +
"');", false);
+// waitForPageToLoad();
+//
+// checkPageRendering(); // At the first we check if page has been
+// // rendered
+// checkJSError(); // At the second we check if JS errors occurred
+//
+// reRenderForm(); // ReRender component
+//
+// checkPageRendering(); // Check all again
+// checkJSError();
+//
+// }
/**
* Renders page
*/
- protected void renderPage(Templates template) {
+ protected void renderPage(Template template) {
selenium.open(protocol + "://" + host + ":" + port +
"/" + APPLICATION_NAME + getTestUrl());
selenium.waitForPageToLoad(String.valueOf(pageRenderTime));
-
- template.loadTemplate(this);
+ setParentId(template.getPrefix());
+ runScript("loadTemplate('" + template + "');",
false);
+ waitForPageToLoad();
+
checkPageRendering(); // At the first we check if page has been
// rendered
checkJSError(); // At the second we check if JS errors occurred
Deleted: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/Templates.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/Templates.java 2008-06-04
10:32:10 UTC (rev 8899)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/Templates.java 2008-06-04
14:07:49 UTC (rev 8900)
@@ -1,48 +0,0 @@
-package org.richfaces;
-
-import org.ajax4jsf.template.Template;
-
-
-
-public class Templates implements Template {
-
- private String template = null;
-
- public Templates(String name) {
- template = name;
- }
-
- public static Templates SIMPLE = new Templates("simple");
-
- public static Templates DATATABLE = new Templates("dataTable");
-
- public static Templates MODALPANEL = new Templates("modalPanel");
-
- private void setParentId(SeleniumTestBase test) {
- if ("dataTable".equals(template)) {
- test.setParentId(COMPONENT_PREFIX_INSIDE_TABLE);
- } else {
- test.setParentId(COMPONENT_PREFIX_SIMPLE);
- }
- }
-
- public void loadTemplate(SeleniumTestBase test) {
- setParentId(test);
- test.runScript("loadTemplate('" + template + "');",
false);
- test.waitForPageToLoad();
- }
-
- public boolean equals(Object obj) {
- if (obj == null || !(obj instanceof Templates)) {
- return false;
- }
- Templates template = (Templates) obj;
- if (template.template.equals(this.template)) {
- return true;
- }
- return false;
- }
-
-
-
-}
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxCommandButtonTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxCommandButtonTest.java 2008-06-04
10:32:10 UTC (rev 8899)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxCommandButtonTest.java 2008-06-04
14:07:49 UTC (rev 8900)
@@ -1,8 +1,8 @@
package org.richfaces.testng;
+import org.ajax4jsf.template.Template;
import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.richfaces.Templates;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
@@ -35,12 +35,12 @@
@Test
public void testAjaxCommandButtonComponent() throws Exception {
- _testAjaxCommandButtonComponent(Templates.SIMPLE);
- _testAjaxCommandButtonComponent(Templates.DATATABLE);
- _testAjaxCommandButtonComponent(Templates.MODALPANEL);
+ _testAjaxCommandButtonComponent(Template.SIMPLE);
+ _testAjaxCommandButtonComponent(Template.DATA_TABLE);
+ _testAjaxCommandButtonComponent(Template.MODAL_PANEL);
}
- private void _testAjaxCommandButtonComponent(Templates template) {
+ private void _testAjaxCommandButtonComponent(Template template) {
renderPage(template);
String parentId = getParentId() + "_form:";
@@ -84,8 +84,6 @@
waitForAjaxCompletion();
waitForOnCompleteHndler();
checkButton(buttonId, true, ajaxSingle, immediate, true, true, true, false);
-
-
}
private void setValidation(boolean success) {
@@ -122,8 +120,8 @@
}
- public String getTestUrl() {
- return "/faces/pages/ajaxCommandButton/ajaxButtonTest.xhtml";
- }
+ public String getTestUrl() {
+ return "/faces/pages/ajaxCommandButton/ajaxButtonTest.xhtml";
+ }
}
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxCommandLinkTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxCommandLinkTest.java 2008-06-04
10:32:10 UTC (rev 8899)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxCommandLinkTest.java 2008-06-04
14:07:49 UTC (rev 8900)
@@ -1,8 +1,8 @@
package org.richfaces.testng;
+import org.ajax4jsf.template.Template;
import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.richfaces.Templates;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
@@ -15,7 +15,7 @@
public AjaxCommandLinkTest() {
super("http", "localhost", serverPort);
}
-
+
/**
* This method are invoking before selenium tests started
*/
@@ -35,16 +35,16 @@
@Test
public void testAjaxCommandLinkComponent() throws Exception {
- _testAjaxCommandLinkComponent(Templates.SIMPLE);
- _testAjaxCommandLinkComponent(Templates.DATATABLE);
- _testAjaxCommandLinkComponent(Templates.MODALPANEL);
+ _testAjaxCommandLinkComponent(Template.SIMPLE);
+ _testAjaxCommandLinkComponent(Template.DATA_TABLE);
+ _testAjaxCommandLinkComponent(Template.MODAL_PANEL);
}
- private void _testAjaxCommandLinkComponent(Templates template) {
+ private void _testAjaxCommandLinkComponent(Template template) {
renderPage(template);
-
+
String parentId = getParentId() + "_form:";
-
+
String linkId = parentId + "l1";
boolean ajaxSingle = false;
boolean immediate = false;
@@ -122,8 +122,8 @@
}
- public String getTestUrl() {
- return "/faces/pages/ajaxCommandLink/ajaxLinkTest.xhtml";
- }
+ public String getTestUrl() {
+ return "/faces/pages/ajaxCommandLink/ajaxLinkTest.xhtml";
+ }
}
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxPollTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxPollTest.java 2008-06-04
10:32:10 UTC (rev 8899)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxPollTest.java 2008-06-04
14:07:49 UTC (rev 8900)
@@ -3,9 +3,9 @@
*/
package org.richfaces.testng;
+import org.ajax4jsf.template.Template;
import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.richfaces.Templates;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
@@ -18,74 +18,76 @@
*/
public class AjaxPollTest extends SeleniumTestBase implements RichSeleniumTest {
- public AjaxPollTest() {
- super("http", "localhost", serverPort);
- }
+ public AjaxPollTest() {
+ super("http", "localhost", serverPort);
+ }
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeTest
- @Parameters( { "browser" })
- public void startSelenium(String browser) {
- super.startSelenium(browser);
- }
+ /**
+ * This method are invoking before selenium tests started
+ */
+ @BeforeTest
+ @Parameters( { "browser" })
+ public void startSelenium(String browser) {
+ super.startSelenium(browser);
+ }
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterTest
- public void stopSelenium() {
- super.stopSelenium();
- }
-
- @Test
- public void testAjaxPollComponent() {
- _testAjaxPollComponent(Templates.SIMPLE);
- _testAjaxPollComponent(Templates.DATATABLE);
- _testAjaxPollComponent(Templates.MODALPANEL);
- }
-
- private void _testAjaxPollComponent(Templates template) {
- renderPage(template);
- String parentId = getParentId() + "_form:";
- String pollId = parentId + "poll";
- String inputId = parentId + "_value";
-
- enablePoll(parentId + "_enabled");
- AssertValueEquals(inputId, "1");
-
- writeStatus("Polling in progress...");
- pause(1500, pollId);
- AssertValueNotEquals(inputId, "1", "Polling does not fire after
component was enabled. Or 'ReRender' attribute does not work");
+ /**
+ * This method are invoking after selenium tests completed
+ */
+ @AfterTest
+ public void stopSelenium() {
+ super.stopSelenium();
+ }
- waiteForCondition("document.getElementById('"+inputId+"').value
== 8", 7000);
-
- pause(1500, pollId);
- writeStatus("Polling should be stopped...");
-
- AssertValueEquals(inputId, "8", "Polling should be stopped. It continues
to poll after component was disabled.");
- AssertTextEquals(parentId + "_text", "Polling", "Polling
terminated abnormal or invalid count of ajax requests has been submitted");
+ @Test
+ public void testAjaxPollComponent() {
+ _testAjaxPollComponent(Template.SIMPLE);
+ _testAjaxPollComponent(Template.DATA_TABLE);
+ _testAjaxPollComponent(Template.MODAL_PANEL);
+ }
- }
-
- private void enablePoll(String id) {
- writeStatus("Enable polling...");
- try {
- clickById(id);
- waitForAjaxCompletion();
- }catch (Exception e) {
- Assert.fail("Poll component failed after attempt to enable polling. Caused by
" + e);
- }
- }
+ private void _testAjaxPollComponent(Template template) {
+ renderPage(template);
+ String parentId = getParentId() + "_form:";
+ String pollId = parentId + "poll";
+ String inputId = parentId + "_value";
- /*
- * (non-Javadoc)
- *
- * @see org.ajax4jsf.test.base.RichSeleniumTest#getTestUrl()
- */
- public String getTestUrl() {
- return "/faces/pages/ajaxPoll/ajaxPollTest.xhtml";
- }
+ enablePoll(parentId + "_enabled");
+ AssertValueEquals(inputId, "1");
+ writeStatus("Polling in progress...");
+ pause(1500, pollId);
+ AssertValueNotEquals(inputId, "1",
+ "Polling does not fire after component was enabled. Or
'ReRender' attribute does not work");
+
+ waiteForCondition("document.getElementById('" + inputId +
"').value == 8", 7000);
+
+ pause(1500, pollId);
+ writeStatus("Polling should be stopped...");
+
+ AssertValueEquals(inputId, "8", "Polling should be stopped. It
continues to poll after component was disabled.");
+ AssertTextEquals(parentId + "_text", "Polling",
+ "Polling terminated abnormal or invalid count of ajax requests has
been submitted");
+
+ }
+
+ private void enablePoll(String id) {
+ writeStatus("Enable polling...");
+ try {
+ clickById(id);
+ waitForAjaxCompletion();
+ } catch (Exception e) {
+ Assert.fail("Poll component failed after attempt to enable polling.
Caused by " + e);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.ajax4jsf.test.base.RichSeleniumTest#getTestUrl()
+ */
+ public String getTestUrl() {
+ return "/faces/pages/ajaxPoll/ajaxPollTest.xhtml";
+ }
+
}
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxRegionTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxRegionTest.java 2008-06-04
10:32:10 UTC (rev 8899)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxRegionTest.java 2008-06-04
14:07:49 UTC (rev 8900)
@@ -1,8 +1,8 @@
package org.richfaces.testng;
+import org.ajax4jsf.template.Template;
import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.richfaces.Templates;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Parameters;
@@ -33,13 +33,13 @@
@Test
public void testAjaxRegionComponent() throws Exception {
- _testAjaxRegionComponent(Templates.SIMPLE);
- _testAjaxRegionComponent(Templates.DATATABLE);
- _testAjaxRegionComponent(Templates.MODALPANEL);
+ _testAjaxRegionComponent(Template.SIMPLE);
+ _testAjaxRegionComponent(Template.DATA_TABLE);
+ _testAjaxRegionComponent(Template.MODAL_PANEL);
}
- private void _testAjaxRegionComponent(Templates template) {
- renderPage(getTestUrl(), template);
+ private void _testAjaxRegionComponent(Template template) {
+ renderPage(template);
String parentId = getParentId() + "_form:";
@@ -96,8 +96,8 @@
AssertValueEquals(renderElemId, "11");
}
- public String getTestUrl() {
- return "/faces/pages/ajaxRegion/ajaxRegionTest.xhtml";
- }
+ public String getTestUrl() {
+ return "/faces/pages/ajaxRegion/ajaxRegionTest.xhtml";
+ }
}
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxStatusTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxStatusTest.java 2008-06-04
10:32:10 UTC (rev 8899)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxStatusTest.java 2008-06-04
14:07:49 UTC (rev 8900)
@@ -1,8 +1,8 @@
package org.richfaces.testng;
+import org.ajax4jsf.template.Template;
import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.richfaces.Templates;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
@@ -34,13 +34,13 @@
@Test
public void testAjaxStatusComponent() throws Exception {
- _testAjaxStatusComponent(Templates.SIMPLE);
- _testAjaxStatusComponent(Templates.DATATABLE);
- _testAjaxStatusComponent(Templates.MODALPANEL);
+ _testAjaxStatusComponent(Template.SIMPLE);
+ _testAjaxStatusComponent(Template.DATA_TABLE);
+ _testAjaxStatusComponent(Template.MODAL_PANEL);
}
- private void _testAjaxStatusComponent(Templates template) {
- renderPage(getTestUrl(), template);
+ private void _testAjaxStatusComponent(Template template) {
+ renderPage(template);
String parentId = getParentId() + "_form:";
String btn1 = parentId + "button1";
@@ -85,7 +85,7 @@
}
- public String getTestUrl() {
- return "/faces/pages/ajaxStatus/ajaxStatusTest.xhtml";
- }
+ public String getTestUrl() {
+ return "/faces/pages/ajaxStatus/ajaxStatusTest.xhtml";
+ }
}
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/CalendarTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/CalendarTest.java 2008-06-04
10:32:10 UTC (rev 8899)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/CalendarTest.java 2008-06-04
14:07:49 UTC (rev 8900)
@@ -25,9 +25,9 @@
import java.util.Date;
import org.ajax4jsf.bean.CalendarTestBean;
+import org.ajax4jsf.template.Template;
import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.richfaces.Templates;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
@@ -63,14 +63,14 @@
@Test
public void testContextMenuComponent() throws Exception {
- _testSelectDateComponent(Templates.SIMPLE);
- _testCalendarComponent(Templates.DATATABLE);
- _testCalendarComponent(Templates.MODALPANEL);
+ _testSelectDateComponent(Template.SIMPLE);
+ _testCalendarComponent(Template.DATA_TABLE);
+ _testCalendarComponent(Template.MODAL_PANEL);
}
-
- private void _testCalendarComponent(Templates template) {
- renderPage(getTestUrl(), template);
-
+
+ private void _testCalendarComponent(Template template) {
+ renderPage(template);
+
String containerId = getParentId() + "_form:";
String calendarOpenedId = containerId + "calendar";
String calendarCollapsedId = calendarOpenedId + "Popup";
@@ -96,8 +96,8 @@
Assert.assertTrue(isVisibleById(calendarOpenedId), "Calendar window should be
visible on the component!");
}
- private void _testSelectDateComponent(Templates template) {
- renderPage(getTestUrl(), template);
+ private void _testSelectDateComponent(Template template) {
+ renderPage(template);
Date newSelectedDate = CalendarTestBean.getDayInMay(15);
@@ -137,9 +137,7 @@
}
Assert.assertEquals(readDate, newSelectedDate, "Date representation after selecting
15.May.2008 is wrong!");
- Assert.assertFalse(isVisibleById(calendarOpenedId), "Calendar window should NOT be
visible on the component!");
-
-
+ Assert.assertFalse(isVisibleById(calendarOpenedId), "Calendar window should NOT be
visible on the component!");
}
public String getTestUrl() {
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ComboBoxTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ComboBoxTest.java 2008-06-04
10:32:10 UTC (rev 8899)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ComboBoxTest.java 2008-06-04
14:07:49 UTC (rev 8900)
@@ -1,8 +1,8 @@
package org.richfaces.testng;
+import org.ajax4jsf.template.Template;
import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.richfaces.Templates;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
@@ -34,13 +34,13 @@
@Test
public void testComboBoxComponent() throws Exception {
- _testComboBoxComponent(Templates.SIMPLE);
- _testComboBoxComponent(Templates.DATATABLE);
- _testComboBoxComponent(Templates.MODALPANEL);
+ _testComboBoxComponent(Template.SIMPLE);
+ _testComboBoxComponent(Template.DATA_TABLE);
+ _testComboBoxComponent(Template.MODAL_PANEL);
}
- private void _testComboBoxComponent(Templates template) {
- renderPage(getTestUrl(), template);
+ private void _testComboBoxComponent(Template template) {
+ renderPage(template);
String parentId = getParentId() + "_form:";
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ContextMenuTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ContextMenuTest.java 2008-06-04
10:32:10 UTC (rev 8899)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ContextMenuTest.java 2008-06-04
14:07:49 UTC (rev 8900)
@@ -21,9 +21,9 @@
package org.richfaces.testng;
+import org.ajax4jsf.template.Template;
import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.richfaces.Templates;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
@@ -31,94 +31,93 @@
import org.testng.annotations.Test;
public class ContextMenuTest extends SeleniumTestBase implements RichSeleniumTest {
-
- public ContextMenuTest() {
- super("http", "localhost", serverPort);
- }
- /**
+ public ContextMenuTest() {
+ super("http", "localhost", serverPort);
+ }
+
+ /**
* This method are invoking before selenium tests started
*/
@BeforeTest
@Parameters( { "browser" })
public void startSelenium(String browser) {
- super.startSelenium(browser);
+ super.startSelenium(browser);
}
-
+
/**
* This method are invoking after selenium tests completed
*/
@AfterTest
public void stopSelenium() {
- super.stopSelenium();
+ super.stopSelenium();
}
-
+
@Test
public void testContextMenuComponent() throws Exception {
- _testContextMenuComponent(Templates.SIMPLE);
- _testContextMenuComponent(Templates.DATATABLE);
- _testContextMenuComponent(Templates.MODALPANEL);
+ _testContextMenuComponent(Template.SIMPLE);
+ _testContextMenuComponent(Template.DATA_TABLE);
+ _testContextMenuComponent(Template.MODAL_PANEL);
}
- private void _testContextMenuComponent(Templates template) {
- renderPage(getTestUrl(), template);
-
- String parentId = getParentId() + "_form:";
- String inputId = parentId + "input";
- String input2Id = parentId + "input2";
- String outputId = parentId + "_value2";
- String menuId = parentId + "menu_input_menu";
- String menu2Id = parentId + "menu_input2_menu";
-
- String menu1_item_ajax = parentId + "menu1_item1";
- String menu1_item_server = parentId + "menu1_item2";
- String menu2_item_ajax = parentId + "menu2_item1";
- String menu2_item_server = parentId + "menu2_item2";
-
- writeStatus("Click on first input");
- clickById(inputId);
- Assert.assertTrue(isVisibleById(menuId));
-
- writeStatus("Click on second input");
- clickById(input2Id);
- Assert.assertFalse(isVisibleById(menuId));
- Assert.assertTrue(isVisibleById(menu2Id));
-
- writeStatus("Click on first input again");
- clickById(inputId);
- Assert.assertTrue(isVisibleById(menuId));
- Assert.assertFalse(isVisibleById(menu2Id));
-
- writeStatus("Click on ajax item in first menu");
- clickById(menu1_item_ajax);
+ private void _testContextMenuComponent(Template template) {
+ renderPage(template);
+
+ String parentId = getParentId() + "_form:";
+ String inputId = parentId + "input";
+ String input2Id = parentId + "input2";
+ String outputId = parentId + "_value2";
+ String menuId = parentId + "menu_input_menu";
+ String menu2Id = parentId + "menu_input2_menu";
+
+ String menu1_item_ajax = parentId + "menu1_item1";
+ String menu1_item_server = parentId + "menu1_item2";
+ String menu2_item_ajax = parentId + "menu2_item1";
+ String menu2_item_server = parentId + "menu2_item2";
+
+ writeStatus("Click on first input");
+ clickById(inputId);
+ Assert.assertTrue(isVisibleById(menuId));
+
+ writeStatus("Click on second input");
+ clickById(input2Id);
+ Assert.assertFalse(isVisibleById(menuId));
+ Assert.assertTrue(isVisibleById(menu2Id));
+
+ writeStatus("Click on first input again");
+ clickById(inputId);
+ Assert.assertTrue(isVisibleById(menuId));
+ Assert.assertFalse(isVisibleById(menu2Id));
+
+ writeStatus("Click on ajax item in first menu");
+ clickById(menu1_item_ajax);
waitForAjaxCompletion();
AssertValueEquals(inputId, "menu1_item1");
AssertTextEquals(outputId, "1");
-
+
writeStatus("Click on server item in first menu");
clickCommandAndWait(menu1_item_server);
AssertValueEquals(inputId, "menu1_item2");
AssertTextEquals(outputId, "2");
-
+
writeStatus("Click on second input again");
- clickById(input2Id);
- Assert.assertTrue(isVisibleById(menu2Id));
-
- writeStatus("Click on ajax item in first menu");
- clickById(menu2_item_ajax);
+ clickById(input2Id);
+ Assert.assertTrue(isVisibleById(menu2Id));
+
+ writeStatus("Click on ajax item in first menu");
+ clickById(menu2_item_ajax);
waitForAjaxCompletion();
AssertValueEquals(inputId, "menu2_item1");
AssertTextEquals(outputId, "3");
-
+
writeStatus("Click on server item in second menu");
clickCommandAndWait(menu2_item_server);
AssertValueEquals(inputId, "menu2_item2");
AssertTextEquals(outputId, "4");
- }
-
- public String getTestUrl() {
- return "/faces/pages/contextMenu/contextMenu.xhtml";
- }
+ }
-}
+ public String getTestUrl() {
+ return "/faces/pages/contextMenu/contextMenu.xhtml";
+ }
+}
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/DataTableTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/DataTableTest.java 2008-06-04
10:32:10 UTC (rev 8899)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/DataTableTest.java 2008-06-04
14:07:49 UTC (rev 8900)
@@ -1,8 +1,8 @@
package org.richfaces.testng;
+import org.ajax4jsf.template.Template;
import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.richfaces.Templates;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
@@ -10,226 +10,220 @@
import org.testng.annotations.Test;
public class DataTableTest extends SeleniumTestBase implements RichSeleniumTest {
-
- public DataTableTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeTest
- @Parameters( { "browser" })
- public void startSelenium(String browser) {
- super.startSelenium(browser);
- }
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterTest
- public void stopSelenium() {
- super.stopSelenium();
- }
-
- public String getTestUrl() {
- return "/faces/pages/dataTable/dataTableTest.xhtml";
- }
-
- @Test
- public void testDataTable() {
- _testDataTable(Templates.SIMPLE);
- }
-
- private void _testDataTable(Templates template) {
- renderPage(getTestUrl(), template);
-
- String parentId = getParentId() + "_form:";
- String dataTableId = parentId + "table";
-
- writeStatus("Check columns count equals to 3 ");
- assertColumnsCount(3, dataTableId);
- writeStatus("Check rows count equals to 22 ");
- assertRowsCount(22, dataTableId);
+ public DataTableTest() {
+ super("http", "localhost", serverPort);
+ }
- String columnsId = getColumnId(dataTableId, 0);
-
- writeStatus("Check inputs' values ");
- assertInputValue(dataTableId, 0, columnsId, "0");
- assertInputValue(dataTableId, 5, columnsId, "5");
- assertInputValue(dataTableId, 19, columnsId, "19");
-
- columnsId = getColumnId(dataTableId, 1);
-
- assertInputValue(dataTableId, 0, columnsId, "1");
- assertInputValue(dataTableId, 7, columnsId, "8");
- assertInputValue(dataTableId, 19, columnsId, "20");
-
- columnsId = getColumnId(dataTableId, 2);
-
- assertInputValue(dataTableId, 0, columnsId, "2");
- assertInputValue(dataTableId, 11, columnsId, "13");
- assertInputValue(dataTableId, 19, columnsId, "21");
-
- writeStatus("Insert some values ");
- insertInputValue(dataTableId, 0, getColumnId(dataTableId, 0), "000");
- insertInputValue(dataTableId, 19, getColumnId(dataTableId, 2), "777");
-
- writeStatus("Rerender table");
- clickById("_form:submit");
- waitForAjaxCompletion();
-
- writeStatus("Check values entered ");
- assertInputValue(dataTableId, 0, getColumnId(dataTableId, 0), "000");
- assertInputValue(dataTableId, 19, getColumnId(dataTableId, 2), "777");
-
- columnsId = getColumnId(dataTableId, 0);
-
- writeStatus("Sort ASC by 1'st column ");
- sortColumn(dataTableId, columnsId);
- writeStatus("Check ordering");
- assertInputValue(dataTableId, 0, columnsId, "000");
- assertInputValue(dataTableId, 1, columnsId, "1");
- assertInputValue(dataTableId, 18, columnsId, "8");
- assertInputValue(dataTableId, 19, columnsId, "9");
-
- writeStatus("Sort DESC by 1'st column ");
- sortColumn(dataTableId, columnsId);
- writeStatus("Check ordering");
- assertInputValue(dataTableId, 0, columnsId, "9");
- assertInputValue(dataTableId, 1, columnsId, "8");
- assertInputValue(dataTableId, 18, columnsId, "1");
- assertInputValue(dataTableId, 19, columnsId, "000");
-
- columnsId = getColumnId(dataTableId, 2);
-
- writeStatus("Sort ASC by 3'st column ");
- sortColumn(dataTableId, columnsId);
- writeStatus("Check ordering");
- assertInputValue(dataTableId, 0, columnsId, "10");
- assertInputValue(dataTableId, 1, columnsId, "11");
- assertInputValue(dataTableId, 18, columnsId, "8");
- assertInputValue(dataTableId, 19, columnsId, "9");
-
- writeStatus("Set columns count == 5, rows count == 10");
- changeColumnCount(10, 5, 0 ,100);
-
-
- writeStatus("Check columns count equals to 5 ");
- assertColumnsCount(5, dataTableId);
- writeStatus("Check rows count equals to 12 ");
- assertRowsCount(12, dataTableId);
-
- columnsId = getColumnId(dataTableId, 0);
-
- writeStatus("Check inputs' values ");
- assertInputValue(dataTableId, 0, columnsId, "0");
- assertInputValue(dataTableId, 5, columnsId, "5");
- assertInputValue(dataTableId, 9, columnsId, "9");
-
- columnsId = getColumnId(dataTableId, 1);
-
- assertInputValue(dataTableId, 0, columnsId, "1");
- assertInputValue(dataTableId, 7, columnsId, "8");
- assertInputValue(dataTableId, 9, columnsId, "10");
-
- columnsId = getColumnId(dataTableId, 4);
-
- assertInputValue(dataTableId, 0, columnsId, "4");
- assertInputValue(dataTableId, 2, columnsId, "6");
- assertInputValue(dataTableId, 9, columnsId, "13");
-
- writeStatus("Sort ASC by the last column ");
- sortColumn(dataTableId, columnsId);
- writeStatus("Check ordering");
- assertInputValue(dataTableId, 0, columnsId, "10");
- assertInputValue(dataTableId, 2, columnsId, "12");
- assertInputValue(dataTableId, 9, columnsId, "9");
-
- writeStatus("Sort DESC by the last column ");
- sortColumn(dataTableId, columnsId);
- writeStatus("Check ordering");
- assertInputValue(dataTableId, 0, columnsId, "9");
- assertInputValue(dataTableId, 2, columnsId, "7");
- assertInputValue(dataTableId, 9, columnsId, "10");
-
- columnsId = getColumnId(dataTableId, 2);
- writeStatus("Sort ASC by the 3d column ");
- sortColumn(dataTableId, columnsId);
-
- writeStatus("Check ordering");
- assertInputValue(dataTableId, 0, columnsId, "10");
- assertInputValue(dataTableId, 2, columnsId, "2");
- assertInputValue(dataTableId, 9, columnsId, "9");
-
- changeColumnCount(2, 5, 2 ,2);
- assertColumnsCount(1, dataTableId);
- assertRowsCount(4, dataTableId);
-
- changeColumnCount(10, 5, 10 ,0);
- assertRowsCount(0, dataTableId);
-
-
-
- }
-
- private String getColumnId (String tableId, int i) {
- String script =
"$('"+tableId+"').rows[0].cells["+String.valueOf(i)+"].id";
- String id = runScript(script);
- id = id.replace(tableId + ":", "");
- id = id.replace("header", "");
- return id;
- }
-
- private void changeColumnCount(int rows, int columns, int begin, int end) {
- String script = "$('_controls:rows').value='" +
String.valueOf(rows) + "';";
- runScript(script);
- script = "$('_controls:column').value='" +
String.valueOf(columns) + "';";
- runScript(script);
- script = "$('_controls:begin').value='" + String.valueOf(begin) +
"';";
- runScript(script);
- script = "$('_controls:end').value='" + String.valueOf(end) +
"';";
- runScript(script);
- clickById("_controls:apply");
- waitForAjaxCompletion();
- }
-
- private void sortColumn(String tableId, String columnId) {
- clickById(tableId + ":" + columnId + "header");
- waitForAjaxCompletion();
- }
-
-
- private void insertInputValue(String tableId, int row, String inputId, String value) {
- String id = tableId + ":"+row+":"+inputId;
- String script = ("$('" + id + "').firstChild.value='" +
value + "';");
- runScript(script);
- }
+ /**
+ * This method are invoking before selenium tests started
+ */
+ @BeforeTest
+ @Parameters( { "browser" })
+ public void startSelenium(String browser) {
+ super.startSelenium(browser);
+ }
-
- private void assertInputValue(String tableId, int row, String inputId, String value) {
- String id = tableId + ":"+row+":"+inputId;
- String script = "$('" + id + "').firstChild.value";
- Assert.assertEquals(runScript(script), value);
- }
-
-
- private void assertColumnsCount(int i, String tableId) {
- StringBuffer script = new StringBuffer("$('");
- script.append(tableId);
- script.append("').rows[0].cells.length");
-
- String count = runScript(script.toString());
- Assert.assertEquals(count, String.valueOf(i));
- }
-
- private void assertRowsCount(int i, String tableId) {
- StringBuffer script = new StringBuffer("$('");
- script.append(tableId);
- script.append("').rows.length");
-
- String count = runScript(script.toString());
- Assert.assertEquals(count, String.valueOf(i));
- }
+ /**
+ * This method are invoking after selenium tests completed
+ */
+ @AfterTest
+ public void stopSelenium() {
+ super.stopSelenium();
+ }
+ public String getTestUrl() {
+ return "/faces/pages/dataTable/dataTableTest.xhtml";
+ }
+
+ @Test
+ public void testDataTable() {
+ _testDataTable(Template.SIMPLE);
+ }
+
+ private void _testDataTable(Template template) {
+ renderPage(template);
+
+ String parentId = getParentId() + "_form:";
+ String dataTableId = parentId + "table";
+
+ writeStatus("Check columns count equals to 3 ");
+ assertColumnsCount(3, dataTableId);
+ writeStatus("Check rows count equals to 22 ");
+ assertRowsCount(22, dataTableId);
+
+ String columnsId = getColumnId(dataTableId, 0);
+
+ writeStatus("Check inputs' values ");
+ assertInputValue(dataTableId, 0, columnsId, "0");
+ assertInputValue(dataTableId, 5, columnsId, "5");
+ assertInputValue(dataTableId, 19, columnsId, "19");
+
+ columnsId = getColumnId(dataTableId, 1);
+
+ assertInputValue(dataTableId, 0, columnsId, "1");
+ assertInputValue(dataTableId, 7, columnsId, "8");
+ assertInputValue(dataTableId, 19, columnsId, "20");
+
+ columnsId = getColumnId(dataTableId, 2);
+
+ assertInputValue(dataTableId, 0, columnsId, "2");
+ assertInputValue(dataTableId, 11, columnsId, "13");
+ assertInputValue(dataTableId, 19, columnsId, "21");
+
+ writeStatus("Insert some values ");
+ insertInputValue(dataTableId, 0, getColumnId(dataTableId, 0), "000");
+ insertInputValue(dataTableId, 19, getColumnId(dataTableId, 2), "777");
+
+ writeStatus("Rerender table");
+ clickById("_form:submit");
+ waitForAjaxCompletion();
+
+ writeStatus("Check values entered ");
+ assertInputValue(dataTableId, 0, getColumnId(dataTableId, 0), "000");
+ assertInputValue(dataTableId, 19, getColumnId(dataTableId, 2), "777");
+
+ columnsId = getColumnId(dataTableId, 0);
+
+ writeStatus("Sort ASC by 1'st column ");
+ sortColumn(dataTableId, columnsId);
+ writeStatus("Check ordering");
+ assertInputValue(dataTableId, 0, columnsId, "000");
+ assertInputValue(dataTableId, 1, columnsId, "1");
+ assertInputValue(dataTableId, 18, columnsId, "8");
+ assertInputValue(dataTableId, 19, columnsId, "9");
+
+ writeStatus("Sort DESC by 1'st column ");
+ sortColumn(dataTableId, columnsId);
+ writeStatus("Check ordering");
+ assertInputValue(dataTableId, 0, columnsId, "9");
+ assertInputValue(dataTableId, 1, columnsId, "8");
+ assertInputValue(dataTableId, 18, columnsId, "1");
+ assertInputValue(dataTableId, 19, columnsId, "000");
+
+ columnsId = getColumnId(dataTableId, 2);
+
+ writeStatus("Sort ASC by 3'st column ");
+ sortColumn(dataTableId, columnsId);
+ writeStatus("Check ordering");
+ assertInputValue(dataTableId, 0, columnsId, "10");
+ assertInputValue(dataTableId, 1, columnsId, "11");
+ assertInputValue(dataTableId, 18, columnsId, "8");
+ assertInputValue(dataTableId, 19, columnsId, "9");
+
+ writeStatus("Set columns count == 5, rows count == 10");
+ changeColumnCount(10, 5, 0, 100);
+
+ writeStatus("Check columns count equals to 5 ");
+ assertColumnsCount(5, dataTableId);
+ writeStatus("Check rows count equals to 12 ");
+ assertRowsCount(12, dataTableId);
+
+ columnsId = getColumnId(dataTableId, 0);
+
+ writeStatus("Check inputs' values ");
+ assertInputValue(dataTableId, 0, columnsId, "0");
+ assertInputValue(dataTableId, 5, columnsId, "5");
+ assertInputValue(dataTableId, 9, columnsId, "9");
+
+ columnsId = getColumnId(dataTableId, 1);
+
+ assertInputValue(dataTableId, 0, columnsId, "1");
+ assertInputValue(dataTableId, 7, columnsId, "8");
+ assertInputValue(dataTableId, 9, columnsId, "10");
+
+ columnsId = getColumnId(dataTableId, 4);
+
+ assertInputValue(dataTableId, 0, columnsId, "4");
+ assertInputValue(dataTableId, 2, columnsId, "6");
+ assertInputValue(dataTableId, 9, columnsId, "13");
+
+ writeStatus("Sort ASC by the last column ");
+ sortColumn(dataTableId, columnsId);
+ writeStatus("Check ordering");
+ assertInputValue(dataTableId, 0, columnsId, "10");
+ assertInputValue(dataTableId, 2, columnsId, "12");
+ assertInputValue(dataTableId, 9, columnsId, "9");
+
+ writeStatus("Sort DESC by the last column ");
+ sortColumn(dataTableId, columnsId);
+ writeStatus("Check ordering");
+ assertInputValue(dataTableId, 0, columnsId, "9");
+ assertInputValue(dataTableId, 2, columnsId, "7");
+ assertInputValue(dataTableId, 9, columnsId, "10");
+
+ columnsId = getColumnId(dataTableId, 2);
+ writeStatus("Sort ASC by the 3d column ");
+ sortColumn(dataTableId, columnsId);
+
+ writeStatus("Check ordering");
+ assertInputValue(dataTableId, 0, columnsId, "10");
+ assertInputValue(dataTableId, 2, columnsId, "2");
+ assertInputValue(dataTableId, 9, columnsId, "9");
+
+ changeColumnCount(2, 5, 2, 2);
+ assertColumnsCount(1, dataTableId);
+ assertRowsCount(4, dataTableId);
+
+ changeColumnCount(10, 5, 10, 0);
+ assertRowsCount(0, dataTableId);
+
+ }
+
+ private String getColumnId(String tableId, int i) {
+ String script = "$('" + tableId + "').rows[0].cells["
+ String.valueOf(i) + "].id";
+ String id = runScript(script);
+ id = id.replace(tableId + ":", "");
+ id = id.replace("header", "");
+ return id;
+ }
+
+ private void changeColumnCount(int rows, int columns, int begin, int end) {
+ String script = "$('_controls:rows').value='" +
String.valueOf(rows) + "';";
+ runScript(script);
+ script = "$('_controls:column').value='" +
String.valueOf(columns) + "';";
+ runScript(script);
+ script = "$('_controls:begin').value='" +
String.valueOf(begin) + "';";
+ runScript(script);
+ script = "$('_controls:end').value='" + String.valueOf(end)
+ "';";
+ runScript(script);
+ clickById("_controls:apply");
+ waitForAjaxCompletion();
+ }
+
+ private void sortColumn(String tableId, String columnId) {
+ clickById(tableId + ":" + columnId + "header");
+ waitForAjaxCompletion();
+ }
+
+ private void insertInputValue(String tableId, int row, String inputId, String value)
{
+ String id = tableId + ":" + row + ":" + inputId;
+ String script = ("$('" + id +
"').firstChild.value='" + value + "';");
+ runScript(script);
+ }
+
+ private void assertInputValue(String tableId, int row, String inputId, String value)
{
+ String id = tableId + ":" + row + ":" + inputId;
+ String script = "$('" + id + "').firstChild.value";
+ Assert.assertEquals(runScript(script), value);
+ }
+
+ private void assertColumnsCount(int i, String tableId) {
+ StringBuffer script = new StringBuffer("$('");
+ script.append(tableId);
+ script.append("').rows[0].cells.length");
+
+ String count = runScript(script.toString());
+ Assert.assertEquals(count, String.valueOf(i));
+ }
+
+ private void assertRowsCount(int i, String tableId) {
+ StringBuffer script = new StringBuffer("$('");
+ script.append(tableId);
+ script.append("').rows.length");
+
+ String count = runScript(script.toString());
+ Assert.assertEquals(count, String.valueOf(i));
+ }
+
}
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/DropDownMenuTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/DropDownMenuTest.java 2008-06-04
10:32:10 UTC (rev 8899)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/DropDownMenuTest.java 2008-06-04
14:07:49 UTC (rev 8900)
@@ -1,8 +1,8 @@
package org.richfaces.testng;
+import org.ajax4jsf.template.Template;
import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.richfaces.Templates;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Parameters;
@@ -33,13 +33,13 @@
@Test
public void testDropDownMenuComponent() throws Exception {
- _testDropDownMenuComponent(Templates.SIMPLE);
- _testDropDownMenuComponent(Templates.DATATABLE);
- _testDropDownMenuComponent(Templates.MODALPANEL);
+ _testDropDownMenuComponent(Template.SIMPLE);
+ _testDropDownMenuComponent(Template.DATA_TABLE);
+ _testDropDownMenuComponent(Template.MODAL_PANEL);
}
- private void _testDropDownMenuComponent(Templates template) {
- renderPage(getTestUrl(), template);
+ private void _testDropDownMenuComponent(Template template) {
+ renderPage(template);
String parentId = getParentId() + "_form:";
String file = parentId + "file";
@@ -88,7 +88,8 @@
}
- public String getTestUrl() {
- return "/faces/pages/dropDownMenu/dropDownMenuTest.xhtml";
- }
+ public String getTestUrl() {
+ return "/faces/pages/dropDownMenu/dropDownMenuTest.xhtml";
+ }
+
}
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InplaceSelectTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InplaceSelectTest.java 2008-06-04
10:32:10 UTC (rev 8899)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InplaceSelectTest.java 2008-06-04
14:07:49 UTC (rev 8900)
@@ -1,8 +1,8 @@
package org.richfaces.testng;
+import org.ajax4jsf.template.Template;
import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.richfaces.Templates;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
@@ -34,12 +34,12 @@
@Test
public void testInplaceSelectComponent() throws Exception {
- _testInplaceSelectComponent(Templates.SIMPLE);
- _testInplaceSelectComponent(Templates.DATATABLE);
- _testInplaceSelectComponent(Templates.MODALPANEL);
+ _testInplaceSelectComponent(Template.SIMPLE);
+ _testInplaceSelectComponent(Template.DATA_TABLE);
+ _testInplaceSelectComponent(Template.MODAL_PANEL);
}
- private void _testInplaceSelectComponent(Templates template) {
+ private void _testInplaceSelectComponent(Template template) {
renderPage(template);
String parentId = getParentId() + "_form:";
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InputNumberSliderTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InputNumberSliderTest.java 2008-06-04
10:32:10 UTC (rev 8899)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InputNumberSliderTest.java 2008-06-04
14:07:49 UTC (rev 8900)
@@ -20,9 +20,9 @@
package org.richfaces.testng;
+import org.ajax4jsf.template.Template;
import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.richfaces.Templates;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
@@ -30,113 +30,115 @@
import org.testng.annotations.Test;
public class InputNumberSliderTest extends SeleniumTestBase implements RichSeleniumTest
{
- private static final int BAR_SCALE = 10;
+ private static final int BAR_SCALE = 10;
- public InputNumberSliderTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeTest
- @Parameters( { "browser" })
- public void startSelenium(String browser) {
- super.startSelenium(browser);
- }
+ public InputNumberSliderTest() {
+ super("http", "localhost", serverPort);
+ }
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterTest
- public void stopSelenium() {
- super.stopSelenium();
- }
-
- @Test
- public void testInputNumberSliderComponent() throws Exception {
- _testInputNumberSlider(Templates.SIMPLE);
- _testInputNumberSlider(Templates.DATATABLE);
- //_testInputNumberSlider(Templates.MODALPANEL);
- }
-
- private void _testInputNumberSlider(Templates template) {
- renderPage(template);
-
- String parentId = getParentId() + "_form:";
- String slider = parentId + "slider";
-
- String input = slider + "Input";
- String tip = slider + "Tip";
- String track = slider + "Track";
-
- String ajax = parentId + "ajax";
- String server = parentId + "server";
- String output = parentId + "output";
-
- writeStatus("Checking initial rendering");
- Assert.assertFalse(isVisibleById(tip));
- checkSliderVisualState(slider, 40);
- AssertTextEquals(output, "40");
-
- writeStatus("Checking if tip is visible during click");
- selenium.mouseDownAt("id=" + track, "800,1");
- Assert.assertTrue(isVisibleById(tip));
- selenium.mouseUpAt("id=" + track, "800,1");
- Assert.assertFalse(isVisibleById(tip));
-
- writeStatus("Checking if value is changed with previous click");
- checkSliderVisualState(slider, 80);
-
- writeStatus("Checking if value is changed with input field");
- selenium.runScript("var input = $('" + input + "');
input.focus(); input.value = 22; input.blur();");
- checkSliderVisualState(slider, 22);
-
- writeStatus("Checking if slider is properly re-rendered and submitted with
ajax");
- clickById(ajax);
- waitForAjaxCompletion();
- checkSliderVisualState(slider, 32);
- AssertTextEquals(output, "32");
-
- writeStatus("Checking if slider is properly submitted");
- clickCommandAndWait(server);
- checkSliderVisualState(slider, 42);
- AssertTextEquals(output, "42");
-
- writeStatus("Checking validation");
- selenium.mouseDownAt("id=" + track, "950,1");
- selenium.mouseUpAt("id=" + track, "950,1");
- clickById(ajax);
- waitForAjaxCompletion();
- checkSliderVisualState(slider, 95);
- AssertTextEquals(output, "42");
-
- selenium.mouseDownAt("id=" + track, "300,1");
- selenium.mouseUpAt("id=" + track, "300,1");
- clickById(ajax);
- waitForAjaxCompletion();
- checkSliderVisualState(slider, 40);
- AssertTextEquals(output, "40");
- }
-
- private void checkSliderVisualState(String id, int value) {
- writeStatus("Checking value in input field");
- AssertValueEquals(id + "Input", new Integer(value).toString());
- AssertTextEquals(id + "Tip", new Integer(value).toString());
-
- writeStatus("Checking tip and tracker position");
- String actualHandle = selenium.getEval(WINDOW_JS_RESOLVER +
"document.getElementById('" + id + "Handle').style.left");
- String actualTip = selenium.getEval(WINDOW_JS_RESOLVER +
"document.getElementById('" + id + "Tip').style.left");
-
- Assert.assertEquals(actualHandle, actualTip);
- Assert.assertTrue(actualTip.endsWith("px"));
-
- int actual = new Integer(actualTip.replace("px", "")).intValue();
- int expected = BAR_SCALE*value;
- Assert.assertTrue(Math.abs(actual - expected) <= BAR_SCALE, "Handle position is
not syncronized with slider value!");
- }
+ /**
+ * This method are invoking before selenium tests started
+ */
+ @BeforeTest
+ @Parameters( { "browser" })
+ public void startSelenium(String browser) {
+ super.startSelenium(browser);
+ }
- public String getTestUrl() {
- return "/faces/pages/inputNumberSlider/inputNumberSliderTest.xhtml";
- }
+ /**
+ * This method are invoking after selenium tests completed
+ */
+ @AfterTest
+ public void stopSelenium() {
+ super.stopSelenium();
+ }
+
+ @Test
+ public void testInputNumberSliderComponent() throws Exception {
+ _testInputNumberSlider(Template.SIMPLE);
+ _testInputNumberSlider(Template.DATA_TABLE);
+ // _testInputNumberSlider(Templates.MODAL_PANEL);
+ }
+
+ private void _testInputNumberSlider(Template template) {
+ renderPage(template);
+
+ String parentId = getParentId() + "_form:";
+ String slider = parentId + "slider";
+
+ String input = slider + "Input";
+ String tip = slider + "Tip";
+ String track = slider + "Track";
+
+ String ajax = parentId + "ajax";
+ String server = parentId + "server";
+ String output = parentId + "output";
+
+ writeStatus("Checking initial rendering");
+ Assert.assertFalse(isVisibleById(tip));
+ checkSliderVisualState(slider, 40);
+ AssertTextEquals(output, "40");
+
+ writeStatus("Checking if tip is visible during click");
+ selenium.mouseDownAt("id=" + track, "800,1");
+ Assert.assertTrue(isVisibleById(tip));
+ selenium.mouseUpAt("id=" + track, "800,1");
+ Assert.assertFalse(isVisibleById(tip));
+
+ writeStatus("Checking if value is changed with previous click");
+ checkSliderVisualState(slider, 80);
+
+ writeStatus("Checking if value is changed with input field");
+ selenium.runScript("var input = $('" + input + "');
input.focus(); input.value = 22; input.blur();");
+ checkSliderVisualState(slider, 22);
+
+ writeStatus("Checking if slider is properly re-rendered and submitted with
ajax");
+ clickById(ajax);
+ waitForAjaxCompletion();
+ checkSliderVisualState(slider, 32);
+ AssertTextEquals(output, "32");
+
+ writeStatus("Checking if slider is properly submitted");
+ clickCommandAndWait(server);
+ checkSliderVisualState(slider, 42);
+ AssertTextEquals(output, "42");
+
+ writeStatus("Checking validation");
+ selenium.mouseDownAt("id=" + track, "950,1");
+ selenium.mouseUpAt("id=" + track, "950,1");
+ clickById(ajax);
+ waitForAjaxCompletion();
+ checkSliderVisualState(slider, 95);
+ AssertTextEquals(output, "42");
+
+ selenium.mouseDownAt("id=" + track, "300,1");
+ selenium.mouseUpAt("id=" + track, "300,1");
+ clickById(ajax);
+ waitForAjaxCompletion();
+ checkSliderVisualState(slider, 40);
+ AssertTextEquals(output, "40");
+ }
+
+ private void checkSliderVisualState(String id, int value) {
+ writeStatus("Checking value in input field");
+ AssertValueEquals(id + "Input", new Integer(value).toString());
+ AssertTextEquals(id + "Tip", new Integer(value).toString());
+
+ writeStatus("Checking tip and tracker position");
+ String actualHandle = selenium.getEval(WINDOW_JS_RESOLVER +
"document.getElementById('" + id
+ + "Handle').style.left");
+ String actualTip = selenium.getEval(WINDOW_JS_RESOLVER +
"document.getElementById('" + id + "Tip').style.left");
+
+ Assert.assertEquals(actualHandle, actualTip);
+ Assert.assertTrue(actualTip.endsWith("px"));
+
+ int actual = new Integer(actualTip.replace("px",
"")).intValue();
+ int expected = BAR_SCALE * value;
+ Assert.assertTrue(Math.abs(actual - expected) <= BAR_SCALE,
+ "Handle position is not syncronized with slider value!");
+ }
+
+ public String getTestUrl() {
+ return "/faces/pages/inputNumberSlider/inputNumberSliderTest.xhtml";
+ }
}
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InputNumberSpinnerTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InputNumberSpinnerTest.java 2008-06-04
10:32:10 UTC (rev 8899)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/InputNumberSpinnerTest.java 2008-06-04
14:07:49 UTC (rev 8900)
@@ -1,8 +1,8 @@
package org.richfaces.testng;
+import org.ajax4jsf.template.Template;
import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.richfaces.Templates;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
@@ -35,13 +35,13 @@
@Test
public void testInputNumberSpinnerComponent() throws Exception {
- _testInputNumberSpinnerComponent(Templates.SIMPLE);
+ _testInputNumberSpinnerComponent(Template.SIMPLE);
//it looks as if the spinner does not work inside rich:dataTable
- _testInputNumberSpinnerComponent(Templates.DATATABLE);
- _testInputNumberSpinnerComponent(Templates.MODALPANEL);
+ _testInputNumberSpinnerComponent(Template.DATA_TABLE);
+ _testInputNumberSpinnerComponent(Template.MODAL_PANEL);
}
- private void _testInputNumberSpinnerComponent(Templates template) {
+ private void _testInputNumberSpinnerComponent(Template template) {
renderPage(template);
writeStatus("check whether the spinner is invariant with respect to pair of
sequential opposite operations");
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/JSFunctionTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/JSFunctionTest.java 2008-06-04
10:32:10 UTC (rev 8899)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/JSFunctionTest.java 2008-06-04
14:07:49 UTC (rev 8900)
@@ -3,9 +3,9 @@
import static org.testng.Assert.assertEquals;
+import org.ajax4jsf.template.Template;
import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.richfaces.Templates;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Parameters;
@@ -36,13 +36,13 @@
@Test
public void testJSFunctionComponent() throws Exception {
- _testJSFunctionComponent(Templates.SIMPLE);
- _testJSFunctionComponent(Templates.DATATABLE);
- _testJSFunctionComponent(Templates.MODALPANEL);
+ _testJSFunctionComponent(Template.SIMPLE);
+ _testJSFunctionComponent(Template.DATA_TABLE);
+ _testJSFunctionComponent(Template.MODAL_PANEL);
}
- private void _testJSFunctionComponent(Templates template) {
- renderPage(getTestUrl(), template);
+ private void _testJSFunctionComponent(Template template) {
+ renderPage(template);
String showNameElemId = getParentId() + "showname";
selenium.mouseOver("alex");
@@ -58,8 +58,8 @@
assertEquals(getTextById(showNameElemId), "Roger");
}
- public String getTestUrl() {
- return "/faces/pages/jsFunction/jsFunctionTest.xhtml";
- }
+ public String getTestUrl() {
+ return "/faces/pages/jsFunction/jsFunctionTest.xhtml";
+ }
}
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/KeepAliveTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/KeepAliveTest.java 2008-06-04
10:32:10 UTC (rev 8899)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/KeepAliveTest.java 2008-06-04
14:07:49 UTC (rev 8900)
@@ -1,8 +1,8 @@
package org.richfaces.testng;
+import org.ajax4jsf.template.Template;
import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.richfaces.Templates;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Parameters;
@@ -33,13 +33,13 @@
@Test
public void testKeepAliveComponent() throws Exception {
- _testKeepAliveComponent(Templates.SIMPLE);
- _testKeepAliveComponent(Templates.DATATABLE);
- _testKeepAliveComponent(Templates.MODALPANEL);
+ _testKeepAliveComponent(Template.SIMPLE);
+ _testKeepAliveComponent(Template.DATA_TABLE);
+ _testKeepAliveComponent(Template.MODAL_PANEL);
}
- private void _testKeepAliveComponent(Templates template) {
- renderPage(getTestUrl(), template);
+ private void _testKeepAliveComponent(Template template) {
+ renderPage(template);
String parentId = getParentId();
@@ -84,7 +84,8 @@
// AssertValueEquals(sumAjaxOnlyElemId, "10");
}
- public String getTestUrl() {
- return "/faces/pages/keepAlive/keepAliveTest.xhtml";
- }
+ public String getTestUrl() {
+ return "/faces/pages/keepAlive/keepAliveTest.xhtml";
+ }
+
}
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/LoadScriptTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/LoadScriptTest.java 2008-06-04
10:32:10 UTC (rev 8899)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/LoadScriptTest.java 2008-06-04
14:07:49 UTC (rev 8900)
@@ -2,9 +2,9 @@
import static org.testng.Assert.assertEquals;
+import org.ajax4jsf.template.Template;
import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.richfaces.Templates;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Parameters;
@@ -35,13 +35,13 @@
@Test
public void testLoadScriptComponent() throws Exception {
- _testLoadScriptComponent(Templates.SIMPLE);
- _testLoadScriptComponent(Templates.DATATABLE);
- _testLoadScriptComponent(Templates.MODALPANEL);
+ _testLoadScriptComponent(Template.SIMPLE);
+ _testLoadScriptComponent(Template.DATA_TABLE);
+ _testLoadScriptComponent(Template.MODAL_PANEL);
}
- private void _testLoadScriptComponent(Templates template) {
- renderPage(getTestUrl(), template);
+ private void _testLoadScriptComponent(Template template) {
+ renderPage(template);
String jsCall = "summarize(%1$s, %2$s);";
int opr1 = 1;
int opr2 = 2;
@@ -49,7 +49,8 @@
assertEquals(Integer.parseInt(result), opr1 + opr2);
}
- public String getTestUrl() {
- return "/faces/pages/loadScript/loadScriptTest.xhtml";
- }
+ public String getTestUrl() {
+ return "/faces/pages/loadScript/loadScriptTest.xhtml";
+ }
+
}
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/LoadStyleTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/LoadStyleTest.java 2008-06-04
10:32:10 UTC (rev 8899)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/LoadStyleTest.java 2008-06-04
14:07:49 UTC (rev 8900)
@@ -3,9 +3,9 @@
import static org.testng.Assert.assertEquals;
+import org.ajax4jsf.template.Template;
import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.richfaces.Templates;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Parameters;
@@ -36,19 +36,20 @@
@Test
public void testLoadStyleComponent() throws Exception {
- _testLoadStyleComponent(Templates.SIMPLE);
- _testLoadStyleComponent(Templates.DATATABLE);
- _testLoadStyleComponent(Templates.MODALPANEL);
+ _testLoadStyleComponent(Template.SIMPLE);
+ _testLoadStyleComponent(Template.DATA_TABLE);
+ _testLoadStyleComponent(Template.MODAL_PANEL);
}
- private void _testLoadStyleComponent(Templates template) {
- renderPage(getTestUrl(), template);
+ private void _testLoadStyleComponent(Template template) {
+ renderPage(template);
String divId = getParentId() + "rectangle";
assertEquals(50, getWidthById(divId));
assertEquals(100, getHeightById(divId));
}
- public String getTestUrl() {
- return "/faces/pages/loadStyle/loadStyleTest.xhtml";
- }
+ public String getTestUrl() {
+ return "/faces/pages/loadStyle/loadStyleTest.xhtml";
+ }
+
}
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/OrderingListTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/OrderingListTest.java 2008-06-04
10:32:10 UTC (rev 8899)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/OrderingListTest.java 2008-06-04
14:07:49 UTC (rev 8900)
@@ -21,210 +21,220 @@
package org.richfaces.testng;
+import org.ajax4jsf.template.Template;
import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.richfaces.Templates;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class OrderingListTest extends SeleniumTestBase implements RichSeleniumTest {
- private String firstButton;
- private String firstButtonDisabled;
-
- private String upButton;
- private String upButtonDisabled;
-
- private String downButton;
- private String downButtonDisabled;
-
- private String lastButton;
- private String lastButtonDisabled;
-
- private String firstRow;
-
- private String actionResultText;
- private String ajax;
- private String server;
- private String thirdRow;
- private String selectionText;
- private String activeItemText;
-
- public OrderingListTest() {
- super("http", "localhost", serverPort);
- }
-
- public OrderingListTest(String protocol, String host, String port) {
- super(protocol, host, port);
- }
-
- /**
+public class OrderingListTest extends SeleniumTestBase implements RichSeleniumTest {
+ private String firstButton;
+
+ private String firstButtonDisabled;
+
+ private String upButton;
+
+ private String upButtonDisabled;
+
+ private String downButton;
+
+ private String downButtonDisabled;
+
+ private String lastButton;
+
+ private String lastButtonDisabled;
+
+ private String firstRow;
+
+ private String actionResultText;
+
+ private String ajax;
+
+ private String server;
+
+ private String thirdRow;
+
+ private String selectionText;
+
+ private String activeItemText;
+
+ public OrderingListTest() {
+ super("http", "localhost", serverPort);
+ }
+
+ public OrderingListTest(String protocol, String host, String port) {
+ super(protocol, host, port);
+ }
+
+ /**
* This method are invoking before selenium tests started
*/
@BeforeTest
@Parameters( { "browser" })
public void startSelenium(String browser) {
- super.startSelenium(browser);
+ super.startSelenium(browser);
}
-
+
/**
* This method are invoking after selenium tests completed
*/
@AfterTest
public void stopSelenium() {
- super.stopSelenium();
+ super.stopSelenium();
}
-
+
@Test
public void testOrderingListComponent() throws Exception {
- _testOrderingListComponent(Templates.SIMPLE);
- _testOrderingListComponent(Templates.DATATABLE);
- _testOrderingListComponent(Templates.MODALPANEL);
+ _testOrderingListComponent(Template.SIMPLE);
+ _testOrderingListComponent(Template.DATA_TABLE);
+ _testOrderingListComponent(Template.MODAL_PANEL);
}
- private void _testOrderingListComponent(Templates template) {
- renderPage(getTestUrl(), template);
- initFields();
-
- _testButtons();
- _testActions();
- _testJSFunctions();
- }
-
- public String getTestUrl() {
- return "/faces/pages/orderingList/orderingListTest.xhtml";
- }
-
- private void _testButtons() {
- writeStatus("Check if all buttons are disabled first time");
- checkButtons(true, true, true, true);
-
- writeStatus("Click on first row");
- clickById(firstRow);
- checkButtons(true, true, false, false);
-
- writeStatus("Click on down button");
- Assert.assertEquals(selenium.getElementIndex("id=" + firstRow), 0);
- clickById(downButton);
- checkButtons(false, false, false, false);
- Assert.assertEquals(selenium.getElementIndex("id=" + firstRow), 1);
-
- writeStatus("Click on last button");
- clickById(lastButton);
- checkButtons(false, false, true, true);
- Assert.assertEquals(selenium.getElementIndex("id=" + firstRow), 3);
-
- writeStatus("Click on first button");
- clickById(firstButton);
- checkButtons(true, true, false, false);
- Assert.assertEquals(selenium.getElementIndex("id=" + firstRow), 0);
- }
-
- private void _testActions() {
- writeStatus("Select two rows");
- clickById(firstRow);
- selenium.controlKeyDown();
- clickById(thirdRow);
- selenium.controlKeyUp();
- checkButtons(true, true, false, false);
-
- writeStatus("Click on ajax button");
+ private void _testOrderingListComponent(Template template) {
+ renderPage(template);
+ initFields();
+
+ _testButtons();
+ _testActions();
+ _testJSFunctions();
+ }
+
+ private void _testButtons() {
+ writeStatus("Check if all buttons are disabled first time");
+ checkButtons(true, true, true, true);
+
+ writeStatus("Click on first row");
+ clickById(firstRow);
+ checkButtons(true, true, false, false);
+
+ writeStatus("Click on down button");
+ Assert.assertEquals(selenium.getElementIndex("id=" + firstRow), 0);
+ clickById(downButton);
+ checkButtons(false, false, false, false);
+ Assert.assertEquals(selenium.getElementIndex("id=" + firstRow), 1);
+
+ writeStatus("Click on last button");
+ clickById(lastButton);
+ checkButtons(false, false, true, true);
+ Assert.assertEquals(selenium.getElementIndex("id=" + firstRow), 3);
+
+ writeStatus("Click on first button");
+ clickById(firstButton);
+ checkButtons(true, true, false, false);
+ Assert.assertEquals(selenium.getElementIndex("id=" + firstRow), 0);
+ }
+
+ private void _testActions() {
+ writeStatus("Select two rows");
+ clickById(firstRow);
+ selenium.controlKeyDown();
+ clickById(thirdRow);
+ selenium.controlKeyUp();
+ checkButtons(true, true, false, false);
+
+ writeStatus("Click on ajax button");
clickById(ajax);
waitForAjaxCompletion();
AssertTextEquals(actionResultText, "item0");
AssertTextEquals(selectionText, "item0,item2");
AssertTextEquals(activeItemText, "Item [item2]");
-
+
writeStatus("Select one row");
- clickById(firstRow);
-
+ clickById(firstRow);
+
writeStatus("Click on server link");
clickCommandAndWait(server);
AssertTextEquals(actionResultText, "item1");
AssertTextEquals(selectionText, "item0");
AssertTextEquals(activeItemText, "Item [item0]");
checkButtons(true, true, false, false);
- }
-
- private void _testJSFunctions() {
- writeStatus("Select one row");
- clickById(thirdRow);
-
- writeStatus("Check if 'onupclick' event works");
- clickById(upButton);
- Assert.assertEquals(selenium.getEval("window.status"), "up
orderchanged");
-
- writeStatus("Check if 'ondownclick' event works");
- clickById(downButton);
- Assert.assertEquals(selenium.getEval("window.status"), "down
orderchanged");
-
- writeStatus("Check if 'ontopclick' event works");
- clickById(firstButton);
- Assert.assertEquals(selenium.getEval("window.status"), "top
orderchanged");
-
- writeStatus("Check if 'onbottomclick' event works");
- clickById(lastButton);
- Assert.assertEquals(selenium.getEval("window.status"), "bottom
orderchanged");
- }
-
- private void checkButtons(boolean firstDisabled, boolean upDisabled, boolean
downDisabled, boolean lastDisabled) {
- if (firstDisabled) {
- Assert.assertTrue(isVisibleById(firstButtonDisabled));
- Assert.assertFalse(isVisibleById(firstButton));
- } else {
- Assert.assertFalse(isVisibleById(firstButtonDisabled));
- Assert.assertTrue(isVisibleById(firstButton));
- }
-
- if (upDisabled) {
- Assert.assertTrue(isVisibleById(upButtonDisabled));
- Assert.assertFalse(isVisibleById(upButton));
- } else {
- Assert.assertFalse(isVisibleById(upButtonDisabled));
- Assert.assertTrue(isVisibleById(upButton));
- }
-
- if (downDisabled) {
- Assert.assertTrue(isVisibleById(downButtonDisabled));
- Assert.assertFalse(isVisibleById(downButton));
- } else {
- Assert.assertFalse(isVisibleById(downButtonDisabled));
- Assert.assertTrue(isVisibleById(downButton));
- }
-
- if (lastDisabled) {
- Assert.assertTrue(isVisibleById(lastButtonDisabled));
- Assert.assertFalse(isVisibleById(lastButton));
- } else {
- Assert.assertFalse(isVisibleById(lastButtonDisabled));
- Assert.assertTrue(isVisibleById(lastButton));
- }
- }
-
- private void initFields() {
- String parentId = getParentId() + "_form:orderingList";
-
- firstButton = parentId + "first";
- firstButtonDisabled = parentId + "disfirst";
-
- upButton = parentId + "up";
- upButtonDisabled = parentId + "disup";
-
- downButton = parentId + "down";
- downButtonDisabled = parentId + "disdown";
-
- lastButton = parentId + "last";
- lastButtonDisabled = parentId + "dislast";
-
- firstRow = parentId + ":0";
- thirdRow = parentId + ":2";
-
- actionResultText = getParentId() + "_form:actionResult";
- selectionText = getParentId() + "_form:selection";
- activeItemText = getParentId() + "_form:activeItem";
- ajax = firstRow + ":_ajax";
- server = parentId + ":1:_server";
- }
+ }
+
+ private void _testJSFunctions() {
+ writeStatus("Select one row");
+ clickById(thirdRow);
+
+ writeStatus("Check if 'onupclick' event works");
+ clickById(upButton);
+ Assert.assertEquals(selenium.getEval("window.status"), "up
orderchanged");
+
+ writeStatus("Check if 'ondownclick' event works");
+ clickById(downButton);
+ Assert.assertEquals(selenium.getEval("window.status"), "down
orderchanged");
+
+ writeStatus("Check if 'ontopclick' event works");
+ clickById(firstButton);
+ Assert.assertEquals(selenium.getEval("window.status"), "top
orderchanged");
+
+ writeStatus("Check if 'onbottomclick' event works");
+ clickById(lastButton);
+ Assert.assertEquals(selenium.getEval("window.status"), "bottom
orderchanged");
+ }
+
+ private void checkButtons(boolean firstDisabled, boolean upDisabled, boolean
downDisabled, boolean lastDisabled) {
+ if (firstDisabled) {
+ Assert.assertTrue(isVisibleById(firstButtonDisabled));
+ Assert.assertFalse(isVisibleById(firstButton));
+ } else {
+ Assert.assertFalse(isVisibleById(firstButtonDisabled));
+ Assert.assertTrue(isVisibleById(firstButton));
+ }
+
+ if (upDisabled) {
+ Assert.assertTrue(isVisibleById(upButtonDisabled));
+ Assert.assertFalse(isVisibleById(upButton));
+ } else {
+ Assert.assertFalse(isVisibleById(upButtonDisabled));
+ Assert.assertTrue(isVisibleById(upButton));
+ }
+
+ if (downDisabled) {
+ Assert.assertTrue(isVisibleById(downButtonDisabled));
+ Assert.assertFalse(isVisibleById(downButton));
+ } else {
+ Assert.assertFalse(isVisibleById(downButtonDisabled));
+ Assert.assertTrue(isVisibleById(downButton));
+ }
+
+ if (lastDisabled) {
+ Assert.assertTrue(isVisibleById(lastButtonDisabled));
+ Assert.assertFalse(isVisibleById(lastButton));
+ } else {
+ Assert.assertFalse(isVisibleById(lastButtonDisabled));
+ Assert.assertTrue(isVisibleById(lastButton));
+ }
+ }
+
+ private void initFields() {
+ String parentId = getParentId() + "_form:orderingList";
+
+ firstButton = parentId + "first";
+ firstButtonDisabled = parentId + "disfirst";
+
+ upButton = parentId + "up";
+ upButtonDisabled = parentId + "disup";
+
+ downButton = parentId + "down";
+ downButtonDisabled = parentId + "disdown";
+
+ lastButton = parentId + "last";
+ lastButtonDisabled = parentId + "dislast";
+
+ firstRow = parentId + ":0";
+ thirdRow = parentId + ":2";
+
+ actionResultText = getParentId() + "_form:actionResult";
+ selectionText = getParentId() + "_form:selection";
+ activeItemText = getParentId() + "_form:activeItem";
+ ajax = firstRow + ":_ajax";
+ server = parentId + ":1:_server";
+ }
+
+ public String getTestUrl() {
+ return "/faces/pages/orderingList/orderingListTest.xhtml";
+ }
+
}
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/PanelBarTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/PanelBarTest.java 2008-06-04
10:32:10 UTC (rev 8899)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/PanelBarTest.java 2008-06-04
14:07:49 UTC (rev 8900)
@@ -21,89 +21,87 @@
package org.richfaces.testng;
+import org.ajax4jsf.template.Template;
import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.richfaces.Templates;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class PanelBarTest extends SeleniumTestBase implements RichSeleniumTest {
-
-
- public PanelBarTest() {
- super("http", "localhost", serverPort);
- }
-
+public class PanelBarTest extends SeleniumTestBase implements RichSeleniumTest {
- /**
+ public PanelBarTest() {
+ super("http", "localhost", serverPort);
+ }
+
+ /**
* This method are invoking before selenium tests started
*/
- @BeforeTest
+ @BeforeTest
@Parameters( { "browser" })
public void startSelenium(String browser) {
- super.startSelenium(browser);
+ super.startSelenium(browser);
}
-
+
/**
* This method are invoking after selenium tests completed
*/
- @AfterTest
+ @AfterTest
public void stopSelenium() {
- super.stopSelenium();
+ super.stopSelenium();
}
-
- @Test
+
+ @Test
public void testPanelBarComponent() throws Exception {
- _testPanelBarComponent(Templates.SIMPLE);
- _testPanelBarComponent(Templates.DATATABLE);
- _testPanelBarComponent(Templates.MODALPANEL);
+ _testPanelBarComponent(Template.SIMPLE);
+ _testPanelBarComponent(Template.DATA_TABLE);
+ _testPanelBarComponent(Template.MODAL_PANEL);
}
-
- private void _testPanelBarComponent(Templates template) {
- renderPage(getTestUrl(), template);
- String parentId = getParentId() + "_form:";
-
- String label2 = parentId + "label2";
- String label3 = parentId + "label3";
-
- String output1 = parentId + "output1";
- String output2 = parentId + "output2";
- String output3 = parentId + "output3";
-
- String ajaxButton = parentId + "button_ajax";
- String simpleButton = parentId + "button_simple";
-
- writeStatus("Click on label two. It should be opened.");
- clickById(label2);
+
+ private void _testPanelBarComponent(Template template) {
+ renderPage(template);
+ String parentId = getParentId() + "_form:";
+
+ String label2 = parentId + "label2";
+ String label3 = parentId + "label3";
+
+ String output1 = parentId + "output1";
+ String output2 = parentId + "output2";
+ String output3 = parentId + "output3";
+
+ String ajaxButton = parentId + "button_ajax";
+ String simpleButton = parentId + "button_simple";
+
+ writeStatus("Click on label two. It should be opened.");
+ clickById(label2);
Assert.assertFalse(isVisibleById(output1));
Assert.assertTrue(isVisibleById(output2));
Assert.assertFalse(isVisibleById(output3));
-
+
writeStatus("Click on simple commandButton. Opened states should not change
after page reloaded.");
clickCommandAndWait(simpleButton);
- Assert.assertFalse(isVisibleById(output1));
+ Assert.assertFalse(isVisibleById(output1));
Assert.assertTrue(isVisibleById(output2));
Assert.assertFalse(isVisibleById(output3));
-
+
writeStatus("Click on label three. It should be opened.");
clickById(label3);
Assert.assertFalse(isVisibleById(output1));
Assert.assertFalse(isVisibleById(output2));
Assert.assertTrue(isVisibleById(output3));
-
+
writeStatus("Click on ajax commandButton. Opened states should not
change.");
clickById(ajaxButton);
- waitForAjaxCompletion();
- Assert.assertFalse(isVisibleById(output1));
+ waitForAjaxCompletion();
+ Assert.assertFalse(isVisibleById(output1));
Assert.assertFalse(isVisibleById(output2));
Assert.assertTrue(isVisibleById(output3));
}
-
+
public String getTestUrl() {
- return "/faces/pages/panelBar/panelBarTest.xhtml";
- }
+ return "/faces/pages/panelBar/panelBarTest.xhtml";
+ }
}
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/PanelMenuTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/PanelMenuTest.java 2008-06-04
10:32:10 UTC (rev 8899)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/PanelMenuTest.java 2008-06-04
14:07:49 UTC (rev 8900)
@@ -1,286 +1,286 @@
package org.richfaces.testng;
+import org.ajax4jsf.template.Template;
import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.richfaces.Templates;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class PanelMenuTest extends SeleniumTestBase implements RichSeleniumTest {
-
- public PanelMenuTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
+public class PanelMenuTest extends SeleniumTestBase implements RichSeleniumTest {
+
+ public PanelMenuTest() {
+ super("http", "localhost", serverPort);
+ }
+
+ /**
* This method are invoking before selenium tests started
*/
- @BeforeTest
+ @BeforeTest
@Parameters( { "browser" })
public void startSelenium(String browser) {
- super.startSelenium(browser);
+ super.startSelenium(browser);
}
-
+
/**
* This method are invoking after selenium tests completed
*/
- @AfterTest
+ @AfterTest
public void stopSelenium() {
- super.stopSelenium();
+ super.stopSelenium();
}
-
- @Test
+
+ @Test
public void testPanelMenuComponent() throws Exception {
-
- _testPanelMenuComponent(Templates.SIMPLE);
- _testPanelMenuComponent(Templates.DATATABLE);
- _testPanelMenuComponent(Templates.MODALPANEL);
-
- _testPanelMenuComponentSingleMode(Templates.SIMPLE);
- _testPanelMenuComponentSingleMode(Templates.DATATABLE);
- _testPanelMenuComponentSingleMode(Templates.MODALPANEL);
- _testPanelMenuItemAction(Templates.SIMPLE);
- _testPanelMenuItemAction(Templates.DATATABLE);
- _testPanelMenuItemAction(Templates.MODALPANEL);
-
- _testPanelMenuClientAPI(Templates.SIMPLE);
- _testPanelMenuClientAPI(Templates.DATATABLE);
- _testPanelMenuClientAPI(Templates.MODALPANEL);
+ _testPanelMenuComponent(Template.SIMPLE);
+ _testPanelMenuComponent(Template.DATA_TABLE);
+ _testPanelMenuComponent(Template.MODAL_PANEL);
+
+ _testPanelMenuComponentSingleMode(Template.SIMPLE);
+ _testPanelMenuComponentSingleMode(Template.DATA_TABLE);
+ _testPanelMenuComponentSingleMode(Template.MODAL_PANEL);
+
+ _testPanelMenuItemAction(Template.SIMPLE);
+ _testPanelMenuItemAction(Template.DATA_TABLE);
+ _testPanelMenuItemAction(Template.MODAL_PANEL);
+
+ _testPanelMenuClientAPI(Template.SIMPLE);
+ _testPanelMenuClientAPI(Template.DATA_TABLE);
+ _testPanelMenuClientAPI(Template.MODAL_PANEL);
}
-
- private void _testPanelMenuClientAPI(Templates template) {
- renderPage(template);
-
- String form1 = getParentId() + "_form1:";
- String form2 = getParentId() + "_form2:";
-
- String group = form1 + "pGroup3";
- String sigleGroup = form2 + "pGroup3_single";
-
- String ajaxItem = "tablehide" + form1 + "pItem1";
- String serverItem = "tablehide" + form1 + "pItem2";
- String clientItem = "tablehide" + form1 + "pItem3";
-
- writeStatus("Test expand JS API method for ajax multiple panel menu.");
- selenium.runScript("$('" + group +
"').component.expand()");
- Assert.assertFalse(isVisibleById(ajaxItem));
+
+ private void _testPanelMenuClientAPI(Template template) {
+ renderPage(template);
+
+ String form1 = getParentId() + "_form1:";
+ String form2 = getParentId() + "_form2:";
+
+ String group = form1 + "pGroup3";
+ String sigleGroup = form2 + "pGroup3_single";
+
+ String ajaxItem = "tablehide" + form1 + "pItem1";
+ String serverItem = "tablehide" + form1 + "pItem2";
+ String clientItem = "tablehide" + form1 + "pItem3";
+
+ writeStatus("Test expand JS API method for ajax multiple panel
menu.");
+ selenium.runScript("$('" + group +
"').component.expand()");
+ Assert.assertFalse(isVisibleById(ajaxItem));
Assert.assertFalse(isVisibleById(serverItem));
Assert.assertTrue(isVisibleById(clientItem));
-
+
writeStatus("Test collapse JS API method for ajax multiple panel
menu.");
selenium.runScript("$('" + group +
"').component.collapse()");
- Assert.assertFalse(isVisibleById(ajaxItem));
+ Assert.assertFalse(isVisibleById(ajaxItem));
Assert.assertFalse(isVisibleById(serverItem));
Assert.assertFalse(isVisibleById(clientItem));
-
- ajaxItem = "tablehide" + form2 + "pItem1_single";
- serverItem = "tablehide" + form2 + "pItem2_single";
- clientItem = "tablehide" + form2 + "pItem3_single";
-
- writeStatus("Test expand JS API method for ajax single panel menu.");
- selenium.runScript("$('" + sigleGroup +
"').component.expand()");
- Assert.assertFalse(isVisibleById(ajaxItem));
+
+ ajaxItem = "tablehide" + form2 + "pItem1_single";
+ serverItem = "tablehide" + form2 + "pItem2_single";
+ clientItem = "tablehide" + form2 + "pItem3_single";
+
+ writeStatus("Test expand JS API method for ajax single panel menu.");
+ selenium.runScript("$('" + sigleGroup +
"').component.expand()");
+ Assert.assertFalse(isVisibleById(ajaxItem));
Assert.assertFalse(isVisibleById(serverItem));
Assert.assertTrue(isVisibleById(clientItem));
-
+
writeStatus("Test collapse JS API method for ajax single panel
menu.");
selenium.runScript("$('" + sigleGroup +
"').component.collapse()");
- Assert.assertFalse(isVisibleById(ajaxItem));
+ Assert.assertFalse(isVisibleById(ajaxItem));
Assert.assertFalse(isVisibleById(serverItem));
Assert.assertFalse(isVisibleById(clientItem));
-
- tearDown();
- }
-
- private void _testPanelMenuComponent(Templates template) {
- renderPage(template);
- String parentId = getParentId() + "_form1:";
-
- String value1Id = getParentId() + "_value";
+
+ tearDown();
+ }
+
+ private void _testPanelMenuComponent(Template template) {
+ renderPage(template);
+ String parentId = getParentId() + "_form1:";
+
+ String value1Id = getParentId() + "_value";
String value2Id = getParentId() + "_value2";
-
+
String ajaxGroup = "tablehide" + parentId + "pGroup1";
String serverGroup = "tablehide" + parentId + "pGroup2";
String clientGroup = "tablehide" + parentId + "pGroup3";
String disabledGroup = "tablehide" + parentId + "pGroup4";
-
+
String ajaxItem = "tablehide" + parentId + "pItem1";
String serverItem = "tablehide" + parentId + "pItem2";
String clientItem = "tablehide" + parentId + "pItem3";
String disabledItem = "tablehide" + parentId + "pItem4";
-
+
writeStatus("Click on ajax group");
clickById(ajaxGroup);
- waitForAjaxCompletion();
- AssertTextEquals(value1Id, "pGroup1");
+ waitForAjaxCompletion();
+ AssertTextEquals(value1Id, "pGroup1");
AssertTextEquals(value2Id, "1");
Assert.assertTrue(isVisibleById(ajaxItem));
Assert.assertFalse(isVisibleById(serverItem));
Assert.assertFalse(isVisibleById(clientItem));
-
+
writeStatus("Click on server group");
- clickCommandAndWait(serverGroup);
- AssertTextEquals(value1Id, "pGroup2");
+ clickCommandAndWait(serverGroup);
+ AssertTextEquals(value1Id, "pGroup2");
AssertTextEquals(value2Id, "2");
Assert.assertTrue(isVisibleById(ajaxItem));
Assert.assertTrue(isVisibleById(serverItem));
Assert.assertFalse(isVisibleById(clientItem));
-
+
writeStatus("Click on ajax group");
clickById(ajaxGroup);
- waitForAjaxCompletion();
- AssertTextEquals(value1Id, "pGroup1");
+ waitForAjaxCompletion();
+ AssertTextEquals(value1Id, "pGroup1");
AssertTextEquals(value2Id, "3");
Assert.assertFalse(isVisibleById(ajaxItem));
Assert.assertTrue(isVisibleById(serverItem));
Assert.assertFalse(isVisibleById(clientItem));
-
+
writeStatus("Click on server group");
clickCommandAndWait(serverGroup);
-
- AssertTextEquals(value1Id, "pGroup2");
+
+ AssertTextEquals(value1Id, "pGroup2");
AssertTextEquals(value2Id, "4");
Assert.assertFalse(isVisibleById(ajaxItem));
Assert.assertFalse(isVisibleById(serverItem));
Assert.assertFalse(isVisibleById(clientItem));
-
+
writeStatus("Click on client group");
clickById(clientGroup);
Assert.assertFalse(isVisibleById(ajaxItem));
Assert.assertFalse(isVisibleById(serverItem));
Assert.assertTrue(isVisibleById(clientItem));
-
+
writeStatus("Click on client group");
clickById(clientGroup);
Assert.assertFalse(isVisibleById(ajaxItem));
Assert.assertFalse(isVisibleById(serverItem));
Assert.assertFalse(isVisibleById(clientItem));
-
+
writeStatus("Click on disabled client group");
clickById(disabledGroup);
Assert.assertFalse(isVisibleById(disabledItem));
-
+
tearDown();
- }
-
- private void _testPanelMenuComponentSingleMode(Templates template) {
- renderPage(template);
- String parentId = getParentId() + "_form2:";
-
- String value1Id = getParentId() + "_value";
+ }
+
+ private void _testPanelMenuComponentSingleMode(Template template) {
+ renderPage(template);
+ String parentId = getParentId() + "_form2:";
+
+ String value1Id = getParentId() + "_value";
String value2Id = getParentId() + "_value2";
-
+
String ajaxGroup = "tablehide" + parentId +
"pGroup1_single";
String serverGroup = "tablehide" + parentId +
"pGroup2_single";
String clientGroup = "tablehide" + parentId +
"pGroup3_single";
String disabledGroup = "tablehide" + parentId +
"pGroup4_single";
-
+
String ajaxItem = "tablehide" + parentId + "pItem1_single";
String serverItem = "tablehide" + parentId +
"pItem2_single";
String clientItem = "tablehide" + parentId +
"pItem3_single";
String disabledItem = "tablehide" + parentId +
"pItem4_single";
-
+
writeStatus("Click on ajax group");
clickById(ajaxGroup);
- waitForAjaxCompletion();
- AssertTextEquals(value1Id, "pGroup1_single");
+ waitForAjaxCompletion();
+ AssertTextEquals(value1Id, "pGroup1_single");
AssertTextEquals(value2Id, "1");
Assert.assertTrue(isVisibleById(ajaxItem));
Assert.assertFalse(isVisibleById(serverItem));
Assert.assertFalse(isVisibleById(clientItem));
-
+
writeStatus("Click on server group");
clickCommandAndWait(serverGroup);
- AssertTextEquals(value1Id, "pGroup2_single");
+ AssertTextEquals(value1Id, "pGroup2_single");
AssertTextEquals(value2Id, "2");
Assert.assertFalse(isVisibleById(ajaxItem));
Assert.assertTrue(isVisibleById(serverItem));
Assert.assertFalse(isVisibleById(clientItem));
-
+
writeStatus("Click on ajax group");
clickById(ajaxGroup);
- waitForAjaxCompletion();
- AssertTextEquals(value1Id, "pGroup1_single");
+ waitForAjaxCompletion();
+ AssertTextEquals(value1Id, "pGroup1_single");
AssertTextEquals(value2Id, "3");
Assert.assertTrue(isVisibleById(ajaxItem));
Assert.assertFalse(isVisibleById(serverItem));
Assert.assertFalse(isVisibleById(clientItem));
-
+
writeStatus("Click on server group");
clickCommandAndWait(serverGroup);
- AssertTextEquals(value1Id, "pGroup2_single");
+ AssertTextEquals(value1Id, "pGroup2_single");
AssertTextEquals(value2Id, "4");
Assert.assertFalse(isVisibleById(ajaxItem));
Assert.assertTrue(isVisibleById(serverItem));
Assert.assertFalse(isVisibleById(clientItem));
-
+
writeStatus("Click on client group");
clickById(clientGroup);
Assert.assertFalse(isVisibleById(ajaxItem));
Assert.assertFalse(isVisibleById(serverItem));
Assert.assertTrue(isVisibleById(clientItem));
-
+
writeStatus("Click on client group");
clickById(clientGroup);
Assert.assertFalse(isVisibleById(ajaxItem));
Assert.assertFalse(isVisibleById(serverItem));
Assert.assertFalse(isVisibleById(clientItem));
-
+
writeStatus("Click on disabled client group");
clickById(disabledGroup);
Assert.assertFalse(isVisibleById(disabledItem));
-
+
tearDown();
- }
-
- private void _testPanelMenuItemAction(Templates template) {
- renderPage(template);
- String parentId = getParentId() + "_form";
-
- String value1Id = getParentId() + "_value";
+ }
+
+ private void _testPanelMenuItemAction(Template template) {
+ renderPage(template);
+ String parentId = getParentId() + "_form";
+
+ String value1Id = getParentId() + "_value";
String value2Id = getParentId() + "_value2";
-
- String group = "tablehide" + parentId + "1:pGroup1";
- String groupSingle = "tablehide" + parentId + "2:pGroup1_single";
-
- String item = "tablehide" + parentId + "1:pItem1";
+
+ String group = "tablehide" + parentId + "1:pGroup1";
+ String groupSingle = "tablehide" + parentId +
"2:pGroup1_single";
+
+ String item = "tablehide" + parentId + "1:pItem1";
String itemSingle = "tablehide" + parentId +
"2:pItem1_single";
-
+
writeStatus("Click on ajax group");
clickById(group);
- waitForAjaxCompletion();
- AssertTextEquals(value1Id, "pGroup1");
-
- writeStatus("Click on ajax group");
+ waitForAjaxCompletion();
+ AssertTextEquals(value1Id, "pGroup1");
+
+ writeStatus("Click on ajax group");
clickById(groupSingle);
- waitForAjaxCompletion();
- AssertTextEquals(value1Id, "pGroup1_single");
-
- writeStatus("Click on server group");
- clickCommandAndWait(item);
- AssertTextEquals(value1Id, "pItem1");
+ waitForAjaxCompletion();
+ AssertTextEquals(value1Id, "pGroup1_single");
+
+ writeStatus("Click on server group");
+ clickCommandAndWait(item);
+ AssertTextEquals(value1Id, "pItem1");
AssertTextEquals(value2Id, "1");
-
+
writeStatus("Click on server group");
clickCommandAndWait(itemSingle);
- AssertTextEquals(value1Id, "pItem1_single");
+ AssertTextEquals(value1Id, "pItem1_single");
AssertTextEquals(value2Id, "2");
-
+
tearDown();
- }
-
+ }
+
public String getTestUrl() {
- return "/faces/pages/panelMenu/panelMenuTest.xhtml";
- }
-
+ return "/faces/pages/panelMenu/panelMenuTest.xhtml";
+ }
+
private void tearDown() {
- writeStatus("Clean bean values");
- clickById(getParentId() + "_form2:clean");
- waitForAjaxCompletion();
+ writeStatus("Clean bean values");
+ clickById(getParentId() + "_form2:clean");
+ waitForAjaxCompletion();
}
}
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/PickListTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/PickListTest.java 2008-06-04
10:32:10 UTC (rev 8899)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/PickListTest.java 2008-06-04
14:07:49 UTC (rev 8900)
@@ -1,8 +1,8 @@
package org.richfaces.testng;
+import org.ajax4jsf.template.Template;
import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.richfaces.Templates;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
@@ -34,13 +34,13 @@
@Test
public void testPickListComponent() throws Exception {
- _testPickListComponent(Templates.SIMPLE);
- _testPickListComponent(Templates.DATATABLE);
- _testPickListComponent(Templates.MODALPANEL);
+ _testPickListComponent(Template.SIMPLE);
+ _testPickListComponent(Template.DATA_TABLE);
+ _testPickListComponent(Template.MODAL_PANEL);
}
- private void _testPickListComponent(Templates template) {
- renderPage(getTestUrl(), template);
+ private void _testPickListComponent(Template template) {
+ renderPage(template);
String parentId = getParentId() + "_form:";
String pickListId = "pickList";
@@ -96,8 +96,8 @@
return retVal;
}
- public String getTestUrl() {
- return "/faces/pages/pickList/pickListTest.xhtml";
- }
+ public String getTestUrl() {
+ return "/faces/pages/pickList/pickListTest.xhtml";
+ }
}
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ProgressBarTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ProgressBarTest.java 2008-06-04
10:32:10 UTC (rev 8899)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ProgressBarTest.java 2008-06-04
14:07:49 UTC (rev 8900)
@@ -1,139 +1,138 @@
package org.richfaces.testng;
+import org.ajax4jsf.template.Template;
import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.richfaces.Templates;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class ProgressBarTest extends SeleniumTestBase implements
- RichSeleniumTest {
+public class ProgressBarTest extends SeleniumTestBase implements RichSeleniumTest {
- public ProgressBarTest() {
- super("http", "localhost", serverPort);
- }
+ public ProgressBarTest() {
+ super("http", "localhost", serverPort);
+ }
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeTest
- @Parameters( { "browser" })
- public void startSelenium(String browser) {
- super.startSelenium(browser);
- }
+ /**
+ * This method are invoking before selenium tests started
+ */
+ @BeforeTest
+ @Parameters( { "browser" })
+ public void startSelenium(String browser) {
+ super.startSelenium(browser);
+ }
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterTest
- public void stopSelenium() {
- super.stopSelenium();
- }
+ /**
+ * This method are invoking after selenium tests completed
+ */
+ @AfterTest
+ public void stopSelenium() {
+ super.stopSelenium();
+ }
- @Test
- public void testProgressBarComponent() {
- _testProgressBarComponent(Templates.SIMPLE);
- _testProgressBarComponent(Templates.DATATABLE);
- _testProgressBarComponent(Templates.MODALPANEL);
- }
+ @Test
+ public void testProgressBarComponent() {
+ _testProgressBarComponent(Template.SIMPLE);
+ _testProgressBarComponent(Template.DATA_TABLE);
+ _testProgressBarComponent(Template.MODAL_PANEL);
+ }
- private void _testProgressBarComponent(Templates template) {
-
- renderPage(template);
-
- String parentId = getParentId() + "_form:";
-
- String progressBarId = parentId + "progressBar1";
- int value = getProgressBarValue(progressBarId);
- Assert.assertTrue(value < 0, "Progress value should be negative");
- String text = getTextById(progressBarId);
- writeStatus("Check if process not started");
- Assert.assertTrue(text.startsWith("Process not started"), "Initial facet
does not appear");
-
- writeStatus("Enable polling");
- enableProgressBar(progressBarId, true);
-
- pause(5000, progressBarId);
-
- writeStatus("Disable polling");
- enableProgressBar(progressBarId, false);
-
- writeStatus("Check label");
- text = getTextById(progressBarId + ":remain");
- Assert.assertTrue(text.endsWith("%"), "Percent label doesnot
appear");
-
- writeStatus("Check value");
- value = getProgressBarValue(progressBarId);
- Assert.assertTrue(value > 0, "Progress value should be positive");
-
- writeStatus("Enable polling");
- enableProgressBar(progressBarId, true);
-
- pause(5000, progressBarId);
- writeStatus("Check value");
- Assert.assertTrue((getProgressBarValue(progressBarId).intValue() != value),
"Progress has been terminated abnormal");
-
- writeStatus("Disable polling");
- enableProgressBar(progressBarId, false);
-
- value = getProgressBarValue(progressBarId);
- pause(1500, progressBarId);
- writeStatus("Check value");
- Assert.assertTrue(getProgressBarValue(progressBarId) == value, "Progress didnt
stop after progressBar disabling");
-
- clickById(parentId + "_complete");
- waitForAjaxCompletion();
- writeStatus("Check if process completed");
- text = getTextById(progressBarId);
- Assert.assertTrue(text.startsWith("Process completed"),"Comlete facet
does not appear");
-
-
- // - Test client mode
-
- writeStatus("Check value");
- progressBarId = parentId + "progressBar2";
- value = getProgressBarValue(progressBarId);
- Assert.assertTrue(value == -5, "Progress value should be -5 ");
-
- text = getTextById(progressBarId);
- writeStatus("Check if process not started");
- Assert.assertTrue(text.startsWith("Process not started"), "Initial facet
does not appear");
-
- setProgressBarValue(progressBarId, 20);
- value = getProgressBarValue(progressBarId);
- writeStatus("Check value");
- Assert.assertTrue(value == 20, "Progress value should be 20 ");
-
- setProgressBarValue(progressBarId, 60);
- value = getProgressBarValue(progressBarId);
- writeStatus("Check value");
- Assert.assertTrue(value == 60,"Progress value should be 60");
-
- clickById(parentId + "_reset");
- waitForAjaxCompletion();
-
- }
+ private void _testProgressBarComponent(Template template) {
- private void enableProgressBar(String id, boolean enable) {
- invokeFromComponent(id, (enable ? "enable" : "disable"), null);
- }
+ renderPage(template);
- private void setProgressBarValue(String id, Object value) {
- invokeFromComponent(id, "setValue", value);
- }
+ String parentId = getParentId() + "_form:";
- private Integer getProgressBarValue(String id) {
- String value = invokeFromComponent(id, "getValue", null);
//runScript(script.toString());
- Integer v = Integer.parseInt(value);
- return v;
- }
-
- public String getTestUrl() {
- return "/faces/pages/progressBar/progressBarTest.xhtml";
- }
+ String progressBarId = parentId + "progressBar1";
+ int value = getProgressBarValue(progressBarId);
+ Assert.assertTrue(value < 0, "Progress value should be negative");
+ String text = getTextById(progressBarId);
+ writeStatus("Check if process not started");
+ Assert.assertTrue(text.startsWith("Process not started"), "Initial
facet does not appear");
+ writeStatus("Enable polling");
+ enableProgressBar(progressBarId, true);
+ pause(5000, progressBarId);
+
+ writeStatus("Disable polling");
+ enableProgressBar(progressBarId, false);
+
+ writeStatus("Check label");
+ text = getTextById(progressBarId + ":remain");
+ Assert.assertTrue(text.endsWith("%"), "Percent label doesnot
appear");
+
+ writeStatus("Check value");
+ value = getProgressBarValue(progressBarId);
+ Assert.assertTrue(value > 0, "Progress value should be positive");
+
+ writeStatus("Enable polling");
+ enableProgressBar(progressBarId, true);
+
+ pause(5000, progressBarId);
+ writeStatus("Check value");
+ Assert.assertTrue((getProgressBarValue(progressBarId).intValue() != value),
+ "Progress has been terminated abnormal");
+
+ writeStatus("Disable polling");
+ enableProgressBar(progressBarId, false);
+
+ value = getProgressBarValue(progressBarId);
+ pause(1500, progressBarId);
+ writeStatus("Check value");
+ Assert.assertTrue(getProgressBarValue(progressBarId) == value,
+ "Progress didnt stop after progressBar disabling");
+
+ clickById(parentId + "_complete");
+ waitForAjaxCompletion();
+ writeStatus("Check if process completed");
+ text = getTextById(progressBarId);
+ Assert.assertTrue(text.startsWith("Process completed"), "Comlete
facet does not appear");
+
+ // - Test client mode
+
+ writeStatus("Check value");
+ progressBarId = parentId + "progressBar2";
+ value = getProgressBarValue(progressBarId);
+ Assert.assertTrue(value == -5, "Progress value should be -5 ");
+
+ text = getTextById(progressBarId);
+ writeStatus("Check if process not started");
+ Assert.assertTrue(text.startsWith("Process not started"), "Initial
facet does not appear");
+
+ setProgressBarValue(progressBarId, 20);
+ value = getProgressBarValue(progressBarId);
+ writeStatus("Check value");
+ Assert.assertTrue(value == 20, "Progress value should be 20 ");
+
+ setProgressBarValue(progressBarId, 60);
+ value = getProgressBarValue(progressBarId);
+ writeStatus("Check value");
+ Assert.assertTrue(value == 60, "Progress value should be 60");
+
+ clickById(parentId + "_reset");
+ waitForAjaxCompletion();
+
+ }
+
+ private void enableProgressBar(String id, boolean enable) {
+ invokeFromComponent(id, (enable ? "enable" : "disable"),
null);
+ }
+
+ private void setProgressBarValue(String id, Object value) {
+ invokeFromComponent(id, "setValue", value);
+ }
+
+ private Integer getProgressBarValue(String id) {
+ String value = invokeFromComponent(id, "getValue", null); //
runScript(script.toString());
+ Integer v = Integer.parseInt(value);
+ return v;
+ }
+
+ public String getTestUrl() {
+ return "/faces/pages/progressBar/progressBarTest.xhtml";
+ }
+
}
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/SimpleTogglePanelTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/SimpleTogglePanelTest.java 2008-06-04
10:32:10 UTC (rev 8899)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/SimpleTogglePanelTest.java 2008-06-04
14:07:49 UTC (rev 8900)
@@ -21,96 +21,95 @@
package org.richfaces.testng;
+import org.ajax4jsf.template.Template;
import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.richfaces.Templates;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class SimpleTogglePanelTest extends SeleniumTestBase implements RichSeleniumTest
{
-
- public SimpleTogglePanelTest() {
- super("http", "localhost", serverPort);
- }
+public class SimpleTogglePanelTest extends SeleniumTestBase implements RichSeleniumTest
{
- /**
+ public SimpleTogglePanelTest() {
+ super("http", "localhost", serverPort);
+ }
+
+ /**
* This method are invoking before selenium tests started
*/
@BeforeTest
@Parameters( { "browser" })
public void startSelenium(String browser) {
- super.startSelenium(browser);
+ super.startSelenium(browser);
}
-
+
/**
* This method are invoking after selenium tests completed
*/
@AfterTest
public void stopSelenium() {
- super.stopSelenium();
+ super.stopSelenium();
}
-
+
@Test
public void testSimpleTogglePanelComponent() throws Exception {
- _testSimpleTogglePanelComponent(Templates.SIMPLE);
- _testSimpleTogglePanelComponent(Templates.DATATABLE);
- _testSimpleTogglePanelComponent(Templates.MODALPANEL);
+ _testSimpleTogglePanelComponent(Template.SIMPLE);
+ _testSimpleTogglePanelComponent(Template.DATA_TABLE);
+ _testSimpleTogglePanelComponent(Template.MODAL_PANEL);
}
-
- private void _testSimpleTogglePanelComponent(Templates template) {
- renderPage(getTestUrl(), template);
- String parentId = getParentId() + "_form:";
- String inputId = parentId + "_value";
+
+ private void _testSimpleTogglePanelComponent(Template template) {
+ renderPage(template);
+ String parentId = getParentId() + "_form:";
+ String inputId = parentId + "_value";
String outputId = parentId + "_value2";
-
- String ajaxHeader = parentId + "panel1_header";
- String serverHeader = parentId + "panel2_header";
- String clientHeader = parentId + "panel3_header";
-
- String ajaxBody = parentId + "panel1_body";
- String serverBody = parentId + "panel2_body";
- String clientBody = parentId + "panel3_body";
-
- writeStatus("Click on client simple toggle panel. It should be opened.");
+
+ String ajaxHeader = parentId + "panel1_header";
+ String serverHeader = parentId + "panel2_header";
+ String clientHeader = parentId + "panel3_header";
+
+ String ajaxBody = parentId + "panel1_body";
+ String serverBody = parentId + "panel2_body";
+ String clientBody = parentId + "panel3_body";
+
+ writeStatus("Click on client simple toggle panel. It should be
opened.");
clickById(clientHeader);
Assert.assertTrue(isVisibleById(clientBody));
writeStatus("Click on client simple toggle panel again. It should be
closed.");
clickById(clientHeader);
Assert.assertFalse(isVisibleById(clientBody));
-
+
writeStatus("Click on ajax simple toggle panel. It should be
opened.");
clickById(ajaxHeader);
waitForAjaxCompletion();
AssertValueEquals(inputId, "panel1");
AssertTextEquals(outputId, "1");
Assert.assertTrue(isVisibleById(ajaxBody));
-
+
writeStatus("Click on ajax simple toggle panel again. It should be
closed.");
clickById(ajaxHeader);
waitForAjaxCompletion();
AssertValueEquals(inputId, "panel1");
AssertTextEquals(outputId, "2");
Assert.assertFalse(isVisibleById(ajaxBody));
-
+
writeStatus("Click on server simple toggle panel. It should be
opened.");
clickCommandAndWait(serverHeader);
AssertValueEquals(inputId, "panel2");
AssertTextEquals(outputId, "3");
Assert.assertTrue(isVisibleById(serverBody));
-
+
writeStatus("Click on server simple toggle panel. It should be
closed.");
clickCommandAndWait(serverHeader);
AssertValueEquals(inputId, "panel2");
AssertTextEquals(outputId, "4");
Assert.assertFalse(isVisibleById(serverBody));
}
-
+
public String getTestUrl() {
- return "/faces/pages/simpleTogglePanel/simpleTogglePanel.xhtml";
- }
+ return "/faces/pages/simpleTogglePanel/simpleTogglePanel.xhtml";
+ }
-
}
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/SpacerTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/SpacerTest.java 2008-06-04
10:32:10 UTC (rev 8899)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/SpacerTest.java 2008-06-04
14:07:49 UTC (rev 8900)
@@ -21,103 +21,105 @@
package org.richfaces.testng;
+import org.ajax4jsf.template.Template;
import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.richfaces.Templates;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class SpacerTest extends SeleniumTestBase implements RichSeleniumTest {
-
- public SpacerTest() {
- super("http", "localhost", serverPort);
- }
+public class SpacerTest extends SeleniumTestBase implements RichSeleniumTest {
- /**
+ public SpacerTest() {
+ super("http", "localhost", serverPort);
+ }
+
+ /**
* This method are invoking before selenium tests started
*/
@BeforeTest
@Parameters( { "browser" })
public void startSelenium(String browser) {
- super.startSelenium(browser);
+ super.startSelenium(browser);
}
-
+
/**
* This method are invoking after selenium tests completed
*/
@AfterTest
public void stopSelenium() {
- super.stopSelenium();
+ super.stopSelenium();
}
-
+
@Test
public void testSimpleTogglePanelComponent() throws Exception {
- _testSimpleTogglePanelComponent(Templates.SIMPLE);
- _testSimpleTogglePanelComponent(Templates.DATATABLE);
- _testSimpleTogglePanelComponent(Templates.MODALPANEL);
+ _testSimpleTogglePanelComponent(Template.SIMPLE);
+ _testSimpleTogglePanelComponent(Template.DATA_TABLE);
+ _testSimpleTogglePanelComponent(Template.MODAL_PANEL);
}
-
- private void _testSimpleTogglePanelComponent(Templates template) {
- renderPage(getTestUrl(), template);
- String parentId = getParentId();
- String spacerId = parentId + "sp";
-
- writeStatus("Check width ");
- assertWidth(1 + 2, spacerId);
- writeStatus("Check height ");
- assertHeight(5 + 2, spacerId);
-
- writeStatus("Check styleClass ");
- assertStyleClass("sp", spacerId);
-
- writeStatus("Check style ");
- assertStyleClass("border: solid 1px green;", spacerId);
- }
-
+ private void _testSimpleTogglePanelComponent(Template template) {
+ renderPage(template);
+ String parentId = getParentId();
+ String spacerId = parentId + "sp";
+
+ writeStatus("Check width ");
+ assertWidth(1 + 2, spacerId);
+
+ writeStatus("Check height ");
+ assertHeight(5 + 2, spacerId);
+
+ writeStatus("Check styleClass ");
+ assertStyleClass("sp", spacerId);
+
+ writeStatus("Check style ");
+ assertStyleClass("border: solid 1px green;", spacerId);
+ }
+
+ private void assertWidth(int width, String spacerId) {
+ StringBuffer script = new StringBuffer("
document.getElementById('");
+ script.append(spacerId);
+ script.append("').offsetWidth");
+
+ String w = runScript(script.toString());
+ Assert.assertEquals(w, String.valueOf(width));
+ }
+
+ private void assertHeight(int height, String spacerId) {
+ StringBuffer script = new StringBuffer("
document.getElementById('");
+ script.append(spacerId);
+ script.append("').offsetHeight");
+
+ String h = runScript(script.toString());
+ Assert.assertEquals(h, String.valueOf(height));
+ }
+
+ private void assertStyleClass(String styleClass, String spacerId) {
+ StringBuffer script = new StringBuffer("
document.getElementById('");
+ script.append(spacerId);
+ script.append("').className");
+
+ String sc = runScript(script.toString());
+ if (sc != null) {
+ Assert.assertTrue(sc.endsWith("sp"));
+ } else {
+ Assert.fail("ClassName is null");
+ }
+ }
+
+ private void assertStyle(String style, String spacerId) {
+ StringBuffer script = new StringBuffer("
document.getElementById('");
+ script.append(spacerId);
+ script.append("').style");
+
+ String s = runScript(script.toString());
+ Assert.assertEquals(s, style);
+ }
+
public String getTestUrl() {
- return "/faces/pages/spacer/spacerTest.xhtml";
- }
+ return "/faces/pages/spacer/spacerTest.xhtml";
+ }
- private void assertWidth(int width, String spacerId) {
- StringBuffer script = new StringBuffer(" document.getElementById('");
- script.append(spacerId);
- script.append("').offsetWidth");
-
- String w = runScript(script.toString());
- Assert.assertEquals(w, String.valueOf(width));
- }
-
- private void assertHeight(int height, String spacerId) {
- StringBuffer script = new StringBuffer(" document.getElementById('");
- script.append(spacerId);
- script.append("').offsetHeight");
-
- String h = runScript(script.toString());
- Assert.assertEquals(h, String.valueOf(height));
- }
-
- private void assertStyleClass(String styleClass, String spacerId) {
- StringBuffer script = new StringBuffer(" document.getElementById('");
- script.append(spacerId);
- script.append("').className");
-
- String sc = runScript(script.toString());
- if (sc != null) {
- Assert.assertTrue(sc.endsWith("sp"));
- } else {
- Assert.fail("ClassName is null");
- }
- }
- private void assertStyle(String style, String spacerId) {
- StringBuffer script = new StringBuffer(" document.getElementById('");
- script.append(spacerId);
- script.append("').style");
-
- String s = runScript(script.toString());
- Assert.assertEquals(s, style);
- }
}
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/TabPanelTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/TabPanelTest.java 2008-06-04
10:32:10 UTC (rev 8899)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/TabPanelTest.java 2008-06-04
14:07:49 UTC (rev 8900)
@@ -21,9 +21,9 @@
package org.richfaces.testng;
+import org.ajax4jsf.template.Template;
import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.richfaces.Templates;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
@@ -34,44 +34,44 @@
public class TabPanelTest extends SeleniumTestBase implements RichSeleniumTest {
- public TabPanelTest() {
- super("http", "localhost", serverPort);
- }
-
- /**
+ public TabPanelTest() {
+ super("http", "localhost", serverPort);
+ }
+
+ /**
* This method are invoking before selenium tests started
*/
@BeforeTest
@Parameters( { "browser" })
public void startSelenium(String browser) {
- super.startSelenium(browser);
+ super.startSelenium(browser);
}
-
+
/**
* This method are invoking after selenium tests completed
*/
@AfterTest
public void stopSelenium() {
- super.stopSelenium();
+ super.stopSelenium();
}
-
+
@Test
public void testTabPanelComponent() throws Exception {
- _testRichTabPanelComponent(Templates.SIMPLE);
- _testRichTabPanelComponent(Templates.DATATABLE);
- _testRichTabPanelComponent(Templates.MODALPANEL);
+ _testRichTabPanelComponent(Template.SIMPLE);
+ _testRichTabPanelComponent(Template.DATA_TABLE);
+ _testRichTabPanelComponent(Template.MODAL_PANEL);
}
-
- private void _testRichTabPanelComponent(Templates template) {
- renderPage(getTestUrl(), template);
- String parentId = getParentId() + "_form:";
- String linkId = parentId + "tab2_lbl";
- String tabId1 = parentId + "tab1";
- String tabId2 = parentId + "tab2";
- String tabId4 = parentId + "tab4";
+
+ private void _testRichTabPanelComponent(Template template) {
+ renderPage(template);
+ String parentId = getParentId() + "_form:";
+ String linkId = parentId + "tab2_lbl";
+ String tabId1 = parentId + "tab1";
+ String tabId2 = parentId + "tab2";
+ String tabId4 = parentId + "tab4";
String inputId = parentId + "_value";
String outputId = parentId + "_value2";
-
+
writeStatus("Click on tab1");
clickById(linkId);
waitForAjaxCompletion();
@@ -80,12 +80,12 @@
Assert.assertTrue(isVisibleById(tabId2));
Assert.assertFalse(isVisibleById(tabId4));
try {
- getTextById(tabId1);
- Assert.fail("Both of 'tab1' and 'tab2' tabs were rendered
for tab panel.");
+ getTextById(tabId1);
+ Assert.fail("Both of 'tab1' and 'tab2' tabs were
rendered for tab panel.");
} catch (SeleniumException se) {
-
+
}
-
+
writeStatus("Click on tab2");
linkId = parentId + "tab1_lbl";
clickCommandAndWait(linkId);
@@ -94,34 +94,33 @@
Assert.assertTrue(isVisibleById(tabId1));
Assert.assertFalse(isVisibleById(tabId4));
try {
- getTextById(tabId2);
- Assert.fail("Both of 'tab1' and 'tab2' tabs were rendered
for tab panel.");
+ getTextById(tabId2);
+ Assert.fail("Both of 'tab1' and 'tab2' tabs were
rendered for tab panel.");
} catch (SeleniumException se) {
-
+
}
-
+
writeStatus("Click on tab3");
linkId = parentId + "tab3_lbl";
clickById(linkId);
AssertValueEquals(inputId, "tab1");
Assert.assertTrue(isVisibleById(tabId1));
-
+
writeStatus("Click on tab4");
linkId = parentId + "tab4_lbl";
clickById(linkId);
Assert.assertTrue(isVisibleById(tabId4));
Assert.assertFalse(isVisibleById(tabId1));
try {
- getTextById(tabId2);
- Assert.fail("Both of 'tab1' and 'tab2' tabs were rendered
for tab panel.");
+ getTextById(tabId2);
+ Assert.fail("Both of 'tab1' and 'tab2' tabs were
rendered for tab panel.");
} catch (SeleniumException se) {
-
+
}
}
-
+
public String getTestUrl() {
- return "/faces/pages/tabPanel/tabPanelTest.xhtml";
- }
+ return "/faces/pages/tabPanel/tabPanelTest.xhtml";
+ }
-
}
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/TogglePanelTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/TogglePanelTest.java 2008-06-04
10:32:10 UTC (rev 8899)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/TogglePanelTest.java 2008-06-04
14:07:49 UTC (rev 8900)
@@ -21,9 +21,9 @@
package org.richfaces.testng;
+import org.ajax4jsf.template.Template;
import org.richfaces.RichSeleniumTest;
import org.richfaces.SeleniumTestBase;
-import org.richfaces.Templates;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
@@ -32,169 +32,162 @@
import com.thoughtworks.selenium.SeleniumException;
-public class TogglePanelTest extends SeleniumTestBase implements
- RichSeleniumTest {
-
- public TogglePanelTest() {
- super("http", "localhost", serverPort);
- }
+public class TogglePanelTest extends SeleniumTestBase implements RichSeleniumTest {
- /**
- * This method are invoking before selenium tests started
- */
- @BeforeTest
- @Parameters( { "browser" })
- public void startSelenium(String browser) {
- super.startSelenium(browser);
- }
+ public TogglePanelTest() {
+ super("http", "localhost", serverPort);
+ }
- /**
- * This method are invoking after selenium tests completed
- */
- @AfterTest
- public void stopSelenium() {
- super.stopSelenium();
- }
+ /**
+ * This method are invoking before selenium tests started
+ */
+ @BeforeTest
+ @Parameters( { "browser" })
+ public void startSelenium(String browser) {
+ super.startSelenium(browser);
+ }
- @Test
- public void testTogglePanelComponent() throws Exception {
- _testTogglePanelComponent(Templates.SIMPLE);
- _testTogglePanelComponent(Templates.DATATABLE);
- _testTogglePanelComponent(Templates.MODALPANEL);
- }
+ /**
+ * This method are invoking after selenium tests completed
+ */
+ @AfterTest
+ public void stopSelenium() {
+ super.stopSelenium();
+ }
- private void _testTogglePanelComponent(Templates template) {
- renderPage(getTestUrl(), template);
- String parentId = getParentId() + "_form:";
+ @Test
+ public void testTogglePanelComponent() throws Exception {
+ _testTogglePanelComponent(Template.SIMPLE);
+ _testTogglePanelComponent(Template.DATA_TABLE);
+ _testTogglePanelComponent(Template.MODAL_PANEL);
+ }
- String inputId = parentId + "_value";
- String outputId = parentId + "_value2";
+ private void _testTogglePanelComponent(Template template) {
+ renderPage(template);
+ String parentId = getParentId() + "_form:";
- String controlNext = parentId + "ajax_next";
- String controlOne = parentId + "ajax_one";
- String controlTwo = parentId + "ajax_two";
+ String inputId = parentId + "_value";
+ String outputId = parentId + "_value2";
- String oneFacet = parentId + "ajax_state_one";
- String twoFacet = parentId + "ajax_state_two";
-
- String cleanButton = parentId + "clean";
+ String controlNext = parentId + "ajax_next";
+ String controlOne = parentId + "ajax_one";
+ String controlTwo = parentId + "ajax_two";
- writeStatus("Click on ajax controlNext");
- clickById(controlNext);
- waitForAjaxCompletion();
- //pause(6000, "panel_ajax");
- AssertValueEquals(inputId, "ajax_next");
- AssertTextEquals(outputId, "1");
- Assert.assertTrue(isVisibleById(twoFacet));
- try {
- getTextById(oneFacet);
- Assert
- .fail("Both of 'one' and 'two' states were rendered for ajax
toggle panel.");
- } catch (SeleniumException se) {
+ String oneFacet = parentId + "ajax_state_one";
+ String twoFacet = parentId + "ajax_state_two";
- }
+ String cleanButton = parentId + "clean";
- writeStatus("Click on ajax controlOne");
- clickById(controlOne);
- waitForAjaxCompletion(5000);
- AssertValueEquals(inputId, "ajax_one");
- AssertTextEquals(outputId, "2");
- Assert.assertTrue(isVisibleById(oneFacet));
- try {
- getTextById(twoFacet);
- Assert
- .fail("Both of 'one' and 'two' states were rendered for ajax
toggle panel.");
- } catch (SeleniumException se) {
+ writeStatus("Click on ajax controlNext");
+ clickById(controlNext);
+ waitForAjaxCompletion();
+ // pause(6000, "panel_ajax");
+ AssertValueEquals(inputId, "ajax_next");
+ AssertTextEquals(outputId, "1");
+ Assert.assertTrue(isVisibleById(twoFacet));
+ try {
+ getTextById(oneFacet);
+ Assert.fail("Both of 'one' and 'two' states were
rendered for ajax toggle panel.");
+ } catch (SeleniumException se) {
- }
+ }
- writeStatus("Click on ajax controlTwo");
- clickById(controlTwo);
- waitForAjaxCompletion(5000);
- AssertValueEquals(inputId, "ajax_two");
- AssertTextEquals(outputId, "1");
- Assert.assertTrue(isVisibleById(twoFacet));
- try {
- getTextById(oneFacet);
- Assert
- .fail("Both of 'one' and 'two' states were rendered for ajax
toggle panel.");
- } catch (SeleniumException se) {
+ writeStatus("Click on ajax controlOne");
+ clickById(controlOne);
+ waitForAjaxCompletion(5000);
+ AssertValueEquals(inputId, "ajax_one");
+ AssertTextEquals(outputId, "2");
+ Assert.assertTrue(isVisibleById(oneFacet));
+ try {
+ getTextById(twoFacet);
+ Assert.fail("Both of 'one' and 'two' states were
rendered for ajax toggle panel.");
+ } catch (SeleniumException se) {
- }
+ }
- controlNext = parentId + "server_next";
- controlOne = parentId + "server_one";
- controlTwo = parentId + "server_two";
- oneFacet = parentId + "server_state_one";
- twoFacet = parentId + "server_state_two";
+ writeStatus("Click on ajax controlTwo");
+ clickById(controlTwo);
+ waitForAjaxCompletion(5000);
+ AssertValueEquals(inputId, "ajax_two");
+ AssertTextEquals(outputId, "1");
+ Assert.assertTrue(isVisibleById(twoFacet));
+ try {
+ getTextById(oneFacet);
+ Assert.fail("Both of 'one' and 'two' states were
rendered for ajax toggle panel.");
+ } catch (SeleniumException se) {
- writeStatus("Click on controlNext");
- clickCommandAndWait(controlNext);
- AssertValueEquals(inputId, "server_next");
- AssertTextEquals(outputId, "2");
- Assert.assertTrue(isVisibleById(twoFacet));
- try {
- getTextById(oneFacet);
- Assert
- .fail("Both of 'one' and 'two' states were rendered for server
toggle panel.");
- } catch (SeleniumException se) {
+ }
- }
+ controlNext = parentId + "server_next";
+ controlOne = parentId + "server_one";
+ controlTwo = parentId + "server_two";
+ oneFacet = parentId + "server_state_one";
+ twoFacet = parentId + "server_state_two";
- writeStatus("Click on server controlOne");
- clickCommandAndWait(controlOne);
- AssertValueEquals(inputId, "server_one");
- AssertTextEquals(outputId, "3");
- Assert.assertTrue(isVisibleById(oneFacet));
- try {
- getTextById(twoFacet);
- Assert
- .fail("Both of 'one' and 'two' states were rendered for server
toggle panel.");
- } catch (SeleniumException se) {
+ writeStatus("Click on controlNext");
+ clickCommandAndWait(controlNext);
+ AssertValueEquals(inputId, "server_next");
+ AssertTextEquals(outputId, "2");
+ Assert.assertTrue(isVisibleById(twoFacet));
+ try {
+ getTextById(oneFacet);
+ Assert.fail("Both of 'one' and 'two' states were
rendered for server toggle panel.");
+ } catch (SeleniumException se) {
- }
+ }
- writeStatus("Click on server controlTwo");
- clickCommandAndWait(controlTwo);
- AssertValueEquals(inputId, "server_two");
- AssertTextEquals(outputId, "4");
- Assert.assertTrue(isVisibleById(twoFacet));
- try {
- getTextById(oneFacet);
- Assert
- .fail("Both of 'one' and 'two' states were rendered for server
toggle panel.");
- } catch (SeleniumException se) {
+ writeStatus("Click on server controlOne");
+ clickCommandAndWait(controlOne);
+ AssertValueEquals(inputId, "server_one");
+ AssertTextEquals(outputId, "3");
+ Assert.assertTrue(isVisibleById(oneFacet));
+ try {
+ getTextById(twoFacet);
+ Assert.fail("Both of 'one' and 'two' states were
rendered for server toggle panel.");
+ } catch (SeleniumException se) {
- }
+ }
- controlNext = parentId + "client_next";
- controlOne = parentId + "client_one";
- controlTwo = parentId + "client_two";
- oneFacet = parentId + "client_state_one";
- twoFacet = parentId + "client_state_two";
+ writeStatus("Click on server controlTwo");
+ clickCommandAndWait(controlTwo);
+ AssertValueEquals(inputId, "server_two");
+ AssertTextEquals(outputId, "4");
+ Assert.assertTrue(isVisibleById(twoFacet));
+ try {
+ getTextById(oneFacet);
+ Assert.fail("Both of 'one' and 'two' states were
rendered for server toggle panel.");
+ } catch (SeleniumException se) {
- writeStatus("Click on client controlNext");
- clickById(controlNext);
- Assert.assertTrue(isVisibleById(twoFacet));
- Assert.assertFalse(isVisibleById(oneFacet));
+ }
- writeStatus("Click on client controlOne");
- clickById(controlOne);
- Assert.assertTrue(isVisibleById(oneFacet));
- Assert.assertFalse(isVisibleById(twoFacet));
+ controlNext = parentId + "client_next";
+ controlOne = parentId + "client_one";
+ controlTwo = parentId + "client_two";
+ oneFacet = parentId + "client_state_one";
+ twoFacet = parentId + "client_state_two";
- writeStatus("Click on client controlTwo");
- clickById(controlTwo);
- Assert.assertTrue(isVisibleById(twoFacet));
- Assert.assertFalse(isVisibleById(oneFacet));
-
- writeStatus("Clean bean values");
- clickById(cleanButton);
- waitForAjaxCompletion();
- }
+ writeStatus("Click on client controlNext");
+ clickById(controlNext);
+ Assert.assertTrue(isVisibleById(twoFacet));
+ Assert.assertFalse(isVisibleById(oneFacet));
- public String getTestUrl() {
- return "/faces/pages/togglePanel/togglePanelTest.xhtml";
- }
+ writeStatus("Click on client controlOne");
+ clickById(controlOne);
+ Assert.assertTrue(isVisibleById(oneFacet));
+ Assert.assertFalse(isVisibleById(twoFacet));
+ writeStatus("Click on client controlTwo");
+ clickById(controlTwo);
+ Assert.assertTrue(isVisibleById(twoFacet));
+ Assert.assertFalse(isVisibleById(oneFacet));
+
+ writeStatus("Clean bean values");
+ clickById(cleanButton);
+ waitForAjaxCompletion();
+ }
+
+ public String getTestUrl() {
+ return "/faces/pages/togglePanel/togglePanelTest.xhtml";
+ }
+
}