Author: andrei_exadel
Date: 2008-05-29 09:46:49 -0400 (Thu, 29 May 2008)
New Revision: 8824
Modified:
trunk/test-applications/seleniumTest/src/main/webapp/pages/progressBar/progressBarTest.xhtml
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ProgressBarTest.java
Log:
progressBar test refactoring
Modified:
trunk/test-applications/seleniumTest/src/main/webapp/pages/progressBar/progressBarTest.xhtml
===================================================================
---
trunk/test-applications/seleniumTest/src/main/webapp/pages/progressBar/progressBarTest.xhtml 2008-05-29
13:43:45 UTC (rev 8823)
+++
trunk/test-applications/seleniumTest/src/main/webapp/pages/progressBar/progressBarTest.xhtml 2008-05-29
13:46:49 UTC (rev 8824)
@@ -31,6 +31,8 @@
<a4j:commandButton id="_reset"
actionListener="#{progressBarBean.reset}" value="Reset
value"></a4j:commandButton><br/>
<a4j:commandButton id="_complete" reRender="progressBar1"
actionListener="#{progressBarBean.complete}"
value="Complete"></a4j:commandButton>
</h:form>
+ <input type="button" value="enable"
onclick="$(getParentId() +
'_form:progressBar1').component.enable()"/>
+ <input type="button" value="disable"
onclick="$(getParentId() +
'_form:progressBar1').component.disable()"/>
</ui:define>
<ui:define name="description">
<ui:include src="progressBarDescription.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-05-29
13:43:45 UTC (rev 8823)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ProgressBarTest.java 2008-05-29
13:46:49 UTC (rev 8824)
@@ -42,16 +42,16 @@
private void _testProgressBarComponent(Templates template) {
- renderPage(getTestUrl(), template);
+ renderPage(template);
String parentId = getParentId() + "_form:";
String progressBarId = parentId + "progressBar1";
int value = getProgressBarValue(progressBarId);
- Assert.assertTrue(value < 0);
+ 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"));
+ Assert.assertTrue(text.startsWith("Process not started"), "Initial facet
does not appear");
writeStatus("Enable polling");
enableProgressBar(progressBarId, true);
@@ -63,18 +63,18 @@
writeStatus("Check label");
text = getTextById(progressBarId + ":remain");
- Assert.assertTrue(text.endsWith("%"));
+ Assert.assertTrue(text.endsWith("%"), "Percent label doesnot
appear");
writeStatus("Check value");
value = getProgressBarValue(progressBarId);
- Assert.assertTrue(value > 0);
+ 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));
+ Assert.assertTrue((getProgressBarValue(progressBarId).intValue() != value),
"Progress has been terminated abnormal");
writeStatus("Disable polling");
enableProgressBar(progressBarId, false);
@@ -82,13 +82,13 @@
value = getProgressBarValue(progressBarId);
pause(1500, progressBarId);
writeStatus("Check value");
- Assert.assertTrue(getProgressBarValue(progressBarId) == 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"));
+ Assert.assertTrue(text.startsWith("Process completed"),"Comlete facet
does not appear");
// - Test client mode
@@ -96,21 +96,21 @@
writeStatus("Check value");
progressBarId = parentId + "progressBar2";
value = getProgressBarValue(progressBarId);
- Assert.assertTrue(value == -5);
+ 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"));
+ 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);
+ Assert.assertTrue(value == 20, "Progress value should be 20 ");
setProgressBarValue(progressBarId, 60);
value = getProgressBarValue(progressBarId);
writeStatus("Check value");
- Assert.assertTrue(value == 60);
+ Assert.assertTrue(value == 60,"Progress value should be 60");
clickById(parentId + "_reset");
waitForAjaxCompletion();
Show replies by date