Author: dsvyatobatsko
Date: 2009-02-16 10:11:59 -0500 (Mon, 16 Feb 2009)
New Revision: 12669
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/SimpleTogglePanelTest.java
Log:
https://jira.jboss.org/jira/browse/RF-6086
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/SimpleTogglePanelTest.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/SimpleTogglePanelTest.java 2009-02-16
12:39:33 UTC (rev 12668)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/SimpleTogglePanelTest.java 2009-02-16
15:11:59 UTC (rev 12669)
@@ -26,7 +26,6 @@
import org.ajax4jsf.template.Template;
import org.richfaces.AutoTester;
import org.richfaces.SeleniumTestBase;
-import org.testng.Assert;
import org.testng.annotations.Test;
public class SimpleTogglePanelTest extends SeleniumTestBase {
@@ -58,38 +57,48 @@
String serverBody = parentId + "panel2_body";
String clientBody = parentId + "panel3_body";
+ String ajaxPanelContent = parentId + "content1";
+ String serverPanelContent = parentId + "content2";
+ String clientPanelContent = parentId + "content3";
+
writeStatus("Click on client simple toggle panel. It should be
opened.");
clickById(clientHeader);
- Assert.assertTrue(isVisibleById(clientBody));
+ AssertVisible(clientBody);
+ AssertPresent(clientPanelContent, "Content of client panel should always be
present");
writeStatus("Click on client simple toggle panel again. It should be
closed.");
clickById(clientHeader);
- Assert.assertFalse(isVisibleById(clientBody));
+ AssertNotVisible(clientBody);
+ AssertPresent(clientPanelContent, "Content of client panel should always be
present");
writeStatus("Click on ajax simple toggle panel. It should be
opened.");
clickById(ajaxHeader);
waitForAjaxCompletion();
AssertValueEquals(inputId, "panel1");
AssertTextEquals(outputId, "1");
- Assert.assertTrue(isVisibleById(ajaxBody));
+ AssertVisible(ajaxBody);
+ AssertPresent(ajaxPanelContent, "Content of open ajax panel should be
present");
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));
+ AssertNotVisible(ajaxBody);
+ AssertNotPresent(ajaxPanelContent, "Content of closed ajax panel should not
be present at all");
writeStatus("Click on server simple toggle panel. It should be
opened.");
clickCommandAndWait(serverHeader);
AssertValueEquals(inputId, "panel2");
AssertTextEquals(outputId, "3");
- Assert.assertTrue(isVisibleById(serverBody));
+ AssertVisible(serverBody);
+ AssertPresent(serverPanelContent, "Content of open server panel should be
present");
writeStatus("Click on server simple toggle panel. It should be
closed.");
clickCommandAndWait(serverHeader);
AssertValueEquals(inputId, "panel2");
AssertTextEquals(outputId, "4");
- Assert.assertFalse(isVisibleById(serverBody));
+ AssertNotVisible(serverBody);
+ AssertNotPresent(serverPanelContent, "Content of closed server panel should
not be present at all");
}
@Test
@@ -191,6 +200,14 @@
}
@Test
+ public void testWithExternalValidationFailure(Template template) {
+ AutoTester autoTester = getAutoTester(this);
+ autoTester.renderPage(template, null);
+ writeStatus("Check component in case of external validation failure:
listeners are not invoked, model is not updated");
+ autoTester.testExtrenalValidationFailure();
+ }
+
+ @Test
public void testChildProcessingServerCase(Template template) {
renderPage(CHILD_PROCESSING_TEST_URL, template,
"#{panelBean.reset2Server}");
writeStatus("Check children components processing for server mode");