Author: andrei_exadel
Date: 2008-04-25 11:36:03 -0400 (Fri, 25 Apr 2008)
New Revision: 8184
Modified:
trunk/test-applications/seleniumTest/src/main/webapp/layout/layout.xhtml
trunk/test-applications/seleniumTest/src/main/webapp/pages/ajaxCommandButton/ajaxButtonTest.xhtml
trunk/test-applications/seleniumTest/src/main/webapp/pages/ajaxCommandLink/ajaxLinkTest.xhtml
trunk/test-applications/seleniumTest/src/main/webapp/pages/progressBar/progressBarTest.xhtml
trunk/test-applications/seleniumTest/src/test/java/org/ajax4jsf/test/base/RichSeleniumTest.java
trunk/test-applications/seleniumTest/src/test/java/org/ajax4jsf/test/base/SeleniumTestBase.java
trunk/test-applications/seleniumTest/src/test/java/org/ajax4jsf/test/base/Templates.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandButtonTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandLinkTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PanelBarTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PanelMenuTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ProgressBarTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SimpleTogglePanelTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/TabPanelTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/TogglePanelTest.java
Log:
change all tests
Modified: trunk/test-applications/seleniumTest/src/main/webapp/layout/layout.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/src/main/webapp/layout/layout.xhtml 2008-04-25
15:30:20 UTC (rev 8183)
+++ trunk/test-applications/seleniumTest/src/main/webapp/layout/layout.xhtml 2008-04-25
15:36:03 UTC (rev 8184)
@@ -6,6 +6,7 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets">
<head>
+ <a4j:loadScript
src="resource:///org/ajax4jsf/javascript/scripts/AJAX.js"></a4j:loadScript>
<script>
var errorMessage = null;
var pauseHolder = {};
@@ -47,7 +48,7 @@
<table border="0" cellpadding="5" cellspacing="0">
<tr>
<td colspan="2">
- <a4j:commandLink reRender="_Selenium_Test_Form" style="display:
none;" value="ReRenderAll" id="_reRender">
+ <a4j:commandLink reRender="_Selenium_Test_Common_Grid"
style="" value="ReRenderAll" id="_reRender">
</a4j:commandLink>
<h:commandLink value="setTemplate" style=""
id="_Selenium_Template_DataTable"
actionListener="#{templateBean.initTemplate}">
<f:param name="t" value="dataTable"/>
@@ -63,13 +64,11 @@
</table>
</h:form>
<div id="_Selenium_Test_ControlPoint1" style="display:
none;">Control1</div>
-<h:form id="_Selenium_Test_Form" >
- <div id="_Selenium_Test_Common_Div">
+<h:panelGrid id="_Selenium_Test_Common_Grid">
<ui:insert name="template"/>
- </div>
-</h:form>
+</h:panelGrid>
<script type="text/javascript">
- window.done=false;A4J.AJAX.AddListener(new
A4J.AJAX.Listener(function(){window.done=true}));
+ window.done=false; A4J.AJAX.AddListener(new
A4J.AJAX.Listener(function(){window.done=true;}));
</script>
<div id="_Selenium_Test_ControlPoint2" style="display:
none;">Control2</div>
Modified:
trunk/test-applications/seleniumTest/src/main/webapp/pages/ajaxCommandButton/ajaxButtonTest.xhtml
===================================================================
---
trunk/test-applications/seleniumTest/src/main/webapp/pages/ajaxCommandButton/ajaxButtonTest.xhtml 2008-04-25
15:30:20 UTC (rev 8183)
+++
trunk/test-applications/seleniumTest/src/main/webapp/pages/ajaxCommandButton/ajaxButtonTest.xhtml 2008-04-25
15:36:03 UTC (rev 8184)
@@ -6,8 +6,9 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets">
-<ui:composition template="../../layout/template.xhtml">
+<ui:composition template="#{templateBean.template}">
<ui:define name="component">
+ <h:form id="_form">
<a4j:commandButton
id="b1"
action="#{commandBean.action}"
@@ -54,6 +55,7 @@
<br/>
<h:inputText value="#{commandBean.value}"
id="_value"></h:inputText>
<br/>
+ </h:form>
</ui:define>
<ui:define name="description">
<ui:include src="ajaxButtonDescription.xhtml" />
Modified:
trunk/test-applications/seleniumTest/src/main/webapp/pages/ajaxCommandLink/ajaxLinkTest.xhtml
===================================================================
(Binary files differ)
Modified:
trunk/test-applications/seleniumTest/src/main/webapp/pages/progressBar/progressBarTest.xhtml
===================================================================
---
trunk/test-applications/seleniumTest/src/main/webapp/pages/progressBar/progressBarTest.xhtml 2008-04-25
15:30:20 UTC (rev 8183)
+++
trunk/test-applications/seleniumTest/src/main/webapp/pages/progressBar/progressBarTest.xhtml 2008-04-25
15:36:03 UTC (rev 8184)
@@ -8,6 +8,7 @@
<ui:composition template="#{templateBean.template}">
<ui:define name="component">
+ <h:form id="_form">
<rich:progressBar enabled="#{progressBarBean.enabled}"
id="progressBar1" value="#{progressBarBean.value}">
<f:facet name="initial">
<h:outputText value="Process not started"></h:outputText>
@@ -27,6 +28,7 @@
</f:facet>
<h:outputText value="{value}%"></h:outputText>
</rich:progressBar> <br/>
+ </h:form>
</ui:define>
<ui:define name="description">
<ui:include src="progressBarDescription.xhtml" />
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/ajax4jsf/test/base/RichSeleniumTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/ajax4jsf/test/base/RichSeleniumTest.java 2008-04-25
15:30:20 UTC (rev 8183)
+++
trunk/test-applications/seleniumTest/src/test/java/org/ajax4jsf/test/base/RichSeleniumTest.java 2008-04-25
15:36:03 UTC (rev 8184)
@@ -6,4 +6,6 @@
public void stopSelenium();
+ public String getTestUrl();
+
}
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/ajax4jsf/test/base/SeleniumTestBase.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/ajax4jsf/test/base/SeleniumTestBase.java 2008-04-25
15:30:20 UTC (rev 8183)
+++
trunk/test-applications/seleniumTest/src/test/java/org/ajax4jsf/test/base/SeleniumTestBase.java 2008-04-25
15:36:03 UTC (rev 8184)
@@ -95,6 +95,7 @@
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
@@ -106,7 +107,30 @@
//checkJSError();
}
+
+ /**
+ * Renders page
+ */
+ protected void renderPage(String homePage, Templates template) {
+ selenium.open(protocol + "://" + host + ":" + port +
"/" + APPLICATION_NAME + homePage);
+ selenium.waitForPageToLoad(String.valueOf(pageRenderTime));
+
+ if (!template.equals(Templates.SIMPLE)) {
+ 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();
+
+ }
+
+
// /**
// * Return component id inside Data table
// *
@@ -147,6 +171,19 @@
checkJSError();
return result;
}
+
+ /**
+ * Performs script defined in parameter
+ * @param script
+ * @return
+ */
+ public String runScript(String script, boolean checkEerror) {
+ String result = selenium.getEval(WINDOW_JS_RESOLVER + script);
+ if (checkEerror) {
+ checkJSError();
+ }
+ return result;
+ }
/**
* This method are invoking after selenium tests completed
@@ -189,6 +226,7 @@
*/
public void waitForAjaxCompletion(int miliseconds) {
selenium.waitForCondition(WINDOW_JS_RESOLVER + "done==true",
String.valueOf(miliseconds));
+ runScript("window.done=false");
}
/**
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/ajax4jsf/test/base/Templates.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/ajax4jsf/test/base/Templates.java 2008-04-25
15:30:20 UTC (rev 8183)
+++
trunk/test-applications/seleniumTest/src/test/java/org/ajax4jsf/test/base/Templates.java 2008-04-25
15:36:03 UTC (rev 8184)
@@ -3,9 +3,9 @@
public class Templates {
- public static final String COMPONENT_PREFIX_INSIDE_TABLE =
"_Selenium_Test_Form:_Selenium_Test_DataTable:0:";
+ public static final String COMPONENT_PREFIX_INSIDE_TABLE =
"_Selenium_Test_DataTable:0:";
- public static final String COMPONENT_PREFIX_SIMPLE = "_Selenium_Test_Form:";
+ public static final String COMPONENT_PREFIX_SIMPLE = "";
private String template = null;
@@ -29,8 +29,21 @@
public void loadTemplate(SeleniumTestBase test) {
setParentId(test);
- test.runScript("loadTemplate('" + template + "');");
+ 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/AjaxCommandButtonTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandButtonTest.java 2008-04-25
15:30:20 UTC (rev 8183)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandButtonTest.java 2008-04-25
15:36:03 UTC (rev 8184)
@@ -2,6 +2,7 @@
import org.ajax4jsf.test.base.RichSeleniumTest;
import org.ajax4jsf.test.base.SeleniumTestBase;
+import org.ajax4jsf.test.base.Templates;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Parameters;
@@ -33,14 +34,14 @@
@Test
public void testAjaxCommandButtonComponent() throws Exception {
- renderPage("/faces/pages/ajaxCommandButton/ajaxButtonTest.xhtml");
-
-// _testAjaxCommandButtonComponent(COMPONENT_PREFIX_INSIDE_TABLE);
-// _testAjaxCommandButtonComponent(COMPONENT_PREFIX_SIMPLE);
+ _testAjaxCommandButtonComponent(Templates.DATATABLE);
}
- private void _testAjaxCommandButtonComponent(String parentId) {
- // test inside DataTable
+ private void _testAjaxCommandButtonComponent(Templates template) {
+ renderPage(getTestUrl(), template);
+
+ String parentId = getParentId() + "_form:";
+
String buttonId = parentId + "b1";
String inputId = parentId + "_value";
@@ -89,4 +90,8 @@
AssertValueEquals(inputId, "5");
}
+ public String getTestUrl() {
+ return "/faces/pages/ajaxCommandButton/ajaxButtonTest.xhtml";
+ }
+
}
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandLinkTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandLinkTest.java 2008-04-25
15:30:20 UTC (rev 8183)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandLinkTest.java 2008-04-25
15:36:03 UTC (rev 8184)
@@ -2,6 +2,7 @@
import org.ajax4jsf.test.base.RichSeleniumTest;
import org.ajax4jsf.test.base.SeleniumTestBase;
+import org.ajax4jsf.test.base.Templates;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Parameters;
@@ -32,14 +33,14 @@
@Test
public void testAjaxCommandLinkComponent() throws Exception {
- renderPage("/faces/pages/ajaxCommandLink/ajaxLinkTest.xhtml");
-
-// _testAjaxCommandLinkComponent(COMPONENT_PREFIX_INSIDE_TABLE);
-// _testAjaxCommandLinkComponent(COMPONENT_PREFIX_SIMPLE);
+ _testAjaxCommandLinkComponent(Templates.DATATABLE);
}
- private void _testAjaxCommandLinkComponent(String parentId) {
- // test inside DataTable
+ private void _testAjaxCommandLinkComponent(Templates template) {
+ renderPage(getTestUrl(), template);
+
+ String parentId = getParentId() + "_form:";
+
String LinkId = parentId + "l1";
String inputId = parentId + "_value";
@@ -88,4 +89,8 @@
AssertValueEquals(inputId, "5");
}
+ public String getTestUrl() {
+ return null;
+ }
+
}
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PanelBarTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PanelBarTest.java 2008-04-25
15:30:20 UTC (rev 8183)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PanelBarTest.java 2008-04-25
15:36:03 UTC (rev 8184)
@@ -95,4 +95,9 @@
Assert.assertFalse(isVisibleById(output2));
Assert.assertTrue(isVisibleById(output3));
}
+
+ public String getTestUrl() {
+ return null;
+ }
+
}
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PanelMenuTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PanelMenuTest.java 2008-04-25
15:30:20 UTC (rev 8183)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PanelMenuTest.java 2008-04-25
15:36:03 UTC (rev 8184)
@@ -195,4 +195,9 @@
AssertValueEquals(inputId, "pItem1_single");
AssertTextEquals(outputId, "2");
}
+
+ public String getTestUrl() {
+ return null;
+ }
+
}
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ProgressBarTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ProgressBarTest.java 2008-04-25
15:30:20 UTC (rev 8183)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ProgressBarTest.java 2008-04-25
15:36:03 UTC (rev 8184)
@@ -2,6 +2,7 @@
import org.ajax4jsf.test.base.RichSeleniumTest;
import org.ajax4jsf.test.base.SeleniumTestBase;
+import org.ajax4jsf.test.base.Templates;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
@@ -34,16 +35,15 @@
@Test
public void testProgressBarComponent() {
- renderPage("/faces/pages/progressBar/progressBarTest.xhtml");
-
-// _testProgressBarComponent(COMPONENT_PREFIX_INSIDE_TABLE);
-// _testProgressBarComponent(COMPONENT_PREFIX_SIMPLE);
+ _testProgressBarComponent(Templates.DATATABLE);
}
- private void _testProgressBarComponent(String parentId) {
+ private void _testProgressBarComponent(Templates template) {
- //- Test ajax mode
-
+ renderPage(getTestUrl(), template);
+
+ String parentId = getParentId() + "_form:";
+
String progressBarId = parentId + "progressBar1";
int value = getProgressBarValue(progressBarId);
Assert.assertTrue(value < 0);
@@ -106,5 +106,10 @@
Integer v = Integer.parseInt(value);
return v;
}
+
+ public String getTestUrl() {
+ return null;
+ }
+
}
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SimpleTogglePanelTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SimpleTogglePanelTest.java 2008-04-25
15:30:20 UTC (rev 8183)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SimpleTogglePanelTest.java 2008-04-25
15:36:03 UTC (rev 8184)
@@ -101,5 +101,10 @@
AssertTextEquals(outputId, "4");
Assert.assertFalse(isVisibleById(serverBody));
}
+
+ public String getTestUrl() {
+ return null;
+ }
+
}
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/TabPanelTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/TabPanelTest.java 2008-04-25
15:30:20 UTC (rev 8183)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/TabPanelTest.java 2008-04-25
15:36:03 UTC (rev 8184)
@@ -119,5 +119,10 @@
}
}
+
+ public String getTestUrl() {
+ return null;
+ }
+
}
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/TogglePanelTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/TogglePanelTest.java 2008-04-25
15:30:20 UTC (rev 8183)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/TogglePanelTest.java 2008-04-25
15:36:03 UTC (rev 8184)
@@ -33,147 +33,159 @@
import com.thoughtworks.selenium.SeleniumException;
-public class TogglePanelTest extends SeleniumTestBase implements RichSeleniumTest {
+public class TogglePanelTest extends SeleniumTestBase implements
+ RichSeleniumTest {
private static final String PAGE =
"/faces/pages/togglePanel/togglePanelTest.xhtml";
-
+
public TogglePanelTest() {
super("http", "localhost", "8080");
}
-
+
/**
- * This method are invoking before selenium tests started
- */
+ * 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
- */
+ @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 void stopSelenium() {
+ super.stopSelenium();
+ }
+
@Test
- public void testTogglePanelComponent() throws Exception {
+ public void testTogglePanelComponent() throws Exception {
_testTogglePanelComponent(Templates.SIMPLE);
- _testTogglePanelComponent(Templates.DATATABLE);
- }
-
- private void _testTogglePanelComponent(Templates template) {
- template.loadTemplate(this);
-
- String parentId = getParentId();
- renderPage(PAGE + "?" + TemplateBean.PARAM_NAME + "=" +
template);
-
- String inputId = parentId + "_value";
- String outputId = parentId + "_value2";
-
- String controlNext = parentId + "ajax_next";
- String controlOne = parentId + "ajax_one";
- String controlTwo = parentId + "ajax_two";
-
- String oneFacet = parentId + "ajax_state_one";
- String twoFacet = parentId + "ajax_state_two";
-
- clickById(controlNext);
- waitForAjaxCompletion(5000);
- pause(60000, "");
- 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) {
-
- }
-
- 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) {
-
- }
-
- 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) {
-
- }
-
- controlNext = parentId + "server_next";
- controlOne = parentId + "server_one";
- controlTwo = parentId + "server_two";
- oneFacet = parentId + "server_state_one";
- twoFacet = parentId + "server_state_two";
-
- clickById(controlNext);
- waitForPageToLoad();
- 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) {
-
- }
-
- clickById(controlOne);
- waitForPageToLoad();
- 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) {
-
- }
-
- clickById(controlTwo);
- waitForPageToLoad();
- 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) {
-
- }
-
- controlNext = parentId + "client_next";
- controlOne = parentId + "client_one";
- controlTwo = parentId + "client_two";
- oneFacet = parentId + "client_state_one";
- twoFacet = parentId + "client_state_two";
-
- clickById(controlNext);
- Assert.assertTrue(isVisibleById(twoFacet));
- Assert.assertFalse(isVisibleById(oneFacet));
-
- clickById(controlOne);
- Assert.assertTrue(isVisibleById(oneFacet));
- Assert.assertFalse(isVisibleById(twoFacet));
-
- clickById(controlTwo);
- Assert.assertTrue(isVisibleById(twoFacet));
- Assert.assertFalse(isVisibleById(oneFacet));
- }
+ _testTogglePanelComponent(Templates.DATATABLE);
+ }
+
+ private void _testTogglePanelComponent(Templates template) {
+ template.loadTemplate(this);
+
+ String parentId = getParentId();
+ renderPage(PAGE + "?" + TemplateBean.PARAM_NAME + "=" + template);
+
+ String inputId = parentId + "_value";
+ String outputId = parentId + "_value2";
+
+ String controlNext = parentId + "ajax_next";
+ String controlOne = parentId + "ajax_one";
+ String controlTwo = parentId + "ajax_two";
+
+ String oneFacet = parentId + "ajax_state_one";
+ String twoFacet = parentId + "ajax_state_two";
+
+ clickById(controlNext);
+ waitForAjaxCompletion(5000);
+ pause(60000, "");
+ 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) {
+
+ }
+
+ 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) {
+
+ }
+
+ 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) {
+
+ }
+
+ controlNext = parentId + "server_next";
+ controlOne = parentId + "server_one";
+ controlTwo = parentId + "server_two";
+ oneFacet = parentId + "server_state_one";
+ twoFacet = parentId + "server_state_two";
+
+ clickById(controlNext);
+ waitForPageToLoad();
+ 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) {
+
+ }
+
+ clickById(controlOne);
+ waitForPageToLoad();
+ 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) {
+
+ }
+
+ clickById(controlTwo);
+ waitForPageToLoad();
+ 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) {
+
+ }
+
+ controlNext = parentId + "client_next";
+ controlOne = parentId + "client_one";
+ controlTwo = parentId + "client_two";
+ oneFacet = parentId + "client_state_one";
+ twoFacet = parentId + "client_state_two";
+
+ clickById(controlNext);
+ Assert.assertTrue(isVisibleById(twoFacet));
+ Assert.assertFalse(isVisibleById(oneFacet));
+
+ clickById(controlOne);
+ Assert.assertTrue(isVisibleById(oneFacet));
+ Assert.assertFalse(isVisibleById(twoFacet));
+
+ clickById(controlTwo);
+ Assert.assertTrue(isVisibleById(twoFacet));
+ Assert.assertFalse(isVisibleById(oneFacet));
+ }
+
+ public String getTestUrl() {
+ return null;
+ }
+
}