]
Prabhat Jha updated RF-8177:
----------------------------
Fix Version/s: 3.3.3.CR1
Affects Version/s: 3.3.3.BETA1
rf-demo ftest - patch Wait.until() method to test conditions on the
start of the loop
-------------------------------------------------------------------------------------
Key: RF-8177
URL:
https://jira.jboss.org/jira/browse/RF-8177
Project: RichFaces
Issue Type: Task
Security Level: Public(Everyone can see)
Components: functional-tests, QA-environment
Affects Versions: 3.3.3.BETA1
Reporter: Lukas Fryc
Assignee: Lukas Fryc
Fix For: 3.3.3.CR1
Use following patch after solving related issues - some tests needs to be modifies
(mainly widely used abstractTestSource()):
Index: src/main/java/org/jboss/test/selenium/waiting/Wait.java
===================================================================
--- src/main/java/org/jboss/test/selenium/waiting/Wait.java (revision 16033)
+++ src/main/java/org/jboss/test/selenium/waiting/Wait.java (revision 16037)
@@ -373,8 +373,28 @@
}
/**
- * Stars loop waiting to satisfy condition.
+ * <p>Stars loop waiting to satisfy condition.</p>
*
+ * <p>The condition will be tested</p>
+ *
+ * <ul>
+ * <li>on the start,</li>
+ * <li>every time interval after last try</li>
+ * <li>and also once after timeout when finishes interval since last try before
timeout.</li>
+ * </ul>
+ *
+ * <p>Scheme:</p>
+ *
+ * <p><pre>S ..int.. T ..int.. T ..int1..timeout..int2..
L</pre></p>
+ *
+ * <p>
+ * <div>S - starting try</div>
+ * <div>T - try within intervals</div>
+ * <div>L - last try after timeout</div>
+ * <div>int - one interval</div>
+ * <div>int = int1 + int2</div>
+ * </p>
+ *
* @param condition
* what wait for to be satisfied
*/
@@ -382,13 +402,17 @@
long start = System.currentTimeMillis();
long end = start + timeout;
while (System.currentTimeMillis() < end) {
+ if (condition.isTrue())
+ return;
try {
Thread.sleep(interval);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
- if (condition.isTrue())
- return;
+ if (System.currentTimeMillis() >= end) {
+ if (condition.isTrue())
+ return;
+ }
}
fail();
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: