Author: alevkovsky
Date: 2009-02-11 06:11:18 -0500 (Wed, 11 Feb 2009)
New Revision: 12627
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/progressBar/progressBarRerenderOnCompleteTest.xhtml
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/ProgressBarTestBean.java
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/progressBar/progressBarTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ProgressBarTest.java
Log:
Progress bar selenium tests
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/ProgressBarTestBean.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/ProgressBarTestBean.java 2009-02-11
09:17:30 UTC (rev 12626)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/ProgressBarTestBean.java 2009-02-11
11:11:18 UTC (rev 12627)
@@ -31,6 +31,7 @@
private int content = 0;
private Long value = -5L;
+ private Long secondValue = -1L;
public String getDate() {
return String.valueOf(new Date().getTime());
@@ -40,8 +41,9 @@
return String.valueOf(new Date().getTime());
}
- public void reset(ActionEvent event) {
+ public void reset() {
this.value = -5L;
+ this.secondValue = -1L;
}
public void complete(ActionEvent event) {
@@ -95,6 +97,21 @@
this.content = 0;
}
}
+
+ /**
+ * @return the secondValue
+ */
+ public Long getSecondValue() {
+ secondValue++;
+ return secondValue;
+ }
+
+ /**
+ * @param secondValue the secondValue to set
+ */
+ public void setSecondValue(Long secondValue) {
+ this.secondValue = secondValue;
+ }
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/progressBar/progressBarRerenderOnCompleteTest.xhtml
===================================================================
(Binary files differ)
Property changes on:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/progressBar/progressBarRerenderOnCompleteTest.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/progressBar/progressBarTest.xhtml
===================================================================
(Binary files differ)
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ProgressBarTest.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ProgressBarTest.java 2009-02-11
09:17:30 UTC (rev 12626)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ProgressBarTest.java 2009-02-11
11:11:18 UTC (rev 12627)
@@ -33,19 +33,22 @@
private static Map<String, String> params = new HashMap<String,
String>();
+ private final static String RESET_METHOD = "#{progressBarBean.reset}";
static {
params.put("parameter1", "value1");
params.put("parameter2", "value2");
params.put("parameter3", "value3");
}
+
+ private final static String RERENDER_AFTER_COMPLETE_TEST_URL =
"pages/progressBar/progressBarRerenderOnCompleteTest.xhtml";
@Test
public void testProgressBarComponent(Template template) {
- renderPage(template);
+ renderPage(template, RESET_METHOD);
+
String parentId = getParentId() + "_form:";
-
String progressBarId = parentId + "progressBar1";
int value = getProgressBarValue(progressBarId);
Assert.assertTrue(value < 0, "Progress value should be negative");
@@ -93,7 +96,7 @@
Assert.assertTrue(text.startsWith("Process completed"), "Comlete
facet does not appear");
// - Test client mode
-
+
writeStatus("Check value");
progressBarId = parentId + "progressBar2";
value = getProgressBarValue(progressBarId);
@@ -113,9 +116,6 @@
writeStatus("Check value");
Assert.assertTrue(value == 60, "Progress value should be 60");
- clickById(parentId + "_reset");
- waitForAjaxCompletion();
-
}
@Test
@@ -128,6 +128,14 @@
}
@Test
+ public void testActionListenersWithExternalValidationFailure(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, null);
+ writeStatus("Test action listener attribute");
+ tester.testExtrenalValidationFailure();
+ }
+
+ @Test
public void testRenderedAttribute(Template template) {
AutoTester tester = getAutoTester(this);
tester.renderPage(template, null);
@@ -192,6 +200,30 @@
tester.testAjaxSingleWithInternalValidationFailed();
}
+ @Test
+ public void testAjaxSingleWithExternalProcessValidationFailed(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, null);
+ writeStatus("Test ajaxSingle attribute in case of external validation
failure");
+ tester.testAjaxSingleWithProcesExternalValidation(false);
+ }
+
+ @Test
+ public void testReRender(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, null);
+ writeStatus("Test reRender attribute");
+ tester.testReRender();
+ }
+
+ @Test
+ public void testReRenderAfterComplete(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(RERENDER_AFTER_COMPLETE_TEST_URL, template, RESET_METHOD);
+ writeStatus("Test reRenderAfterComplete attribute");
+ tester.testReRender();
+ }
+
private void enableProgressBar(String id, boolean enable) {
invokeFromComponent(id, (enable ? "enable" : "disable"),
null);
}
Show replies by date