Package com.smartgwt.client.docs

# Interface WaitingForAsyncActions

public interface WaitingForAsyncActions

### Waiting for asynchronous actions

In Smart GWT automated testing, certain actions may trigger asynchronous operations, such as DataSource requests, deferred UI updates, or queued redraws. Attempting to interact with application components before these operations complete can cause unstable or inconsistent test results.

The `AutoTest.waitForSystemDone()` API ensures that all pending asynchronous Smart GWT actions have completed before proceeding. This method relies on `AutoTest.isSystemDone()` to determine when the system is ready for further input.

Key considerations

- System readiness: Waiting for the framework to report that it is "system done" ensures that all queued Smart GWT actions have been processed before continuing.
- Limitations: `AutoTest.isSystemDone()` only tracks asynchronous processes managed by Smart GWT. Actions outside of Smart GWT?s control (e.g., third-party widget rendering, non-Smart GWT network requests) may require additional waits.
- Targeted waits: In scenarios where only a specific component?s readiness matters, you can wait for a specific element using `AutoTest.waitForElement()` instead of waiting for the entire system.
- Timeout control: Waiting methods support timeouts to avoid indefinite waits if a condition cannot be satisfied.