Confirmed users
1,759
edits
Line 123: | Line 123: | ||
=== Use waitForTest instead of sleep() === | === Use waitForTest instead of sleep() === | ||
If you cannot find an event to wait for and you are still tempted to sleep(), consider using waitForTest() instead. waitForTest() gives you a simple way to poll for a condition for a specified maximum amount of time, with short sleep()'s in between polls. This provides the advantage that the test can proceed as soon as the condition is met, reducing test time. | If you cannot find an event to wait for and you are still tempted to sleep(), consider using waitForTest() instead. waitForTest() gives you a simple way to poll for a condition for a specified maximum amount of time, with short sleep()'s in between polls. This provides the advantage that the test can proceed as soon as the condition is met, reducing test time. | ||
=== Logging === | === Logging === |