com.smartgwt.client.util

## Class AutoTest

- java.lang.Object
- - com.smartgwt.client.util.AutoTest

-     public class AutoTest
      extends java.lang.Object

  Standalone class providing a general interface for integration with Automated Testing Tools

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AutoTest()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Canvas` | `getTestRoot()` Gets the implicit root canvas available in scLocators starting "//testRoot[]".
    `static boolean` | `isGridDone(Canvas grid)` Returns whether the supplied ListGrid is in a consistent state with no pending operations.
    `static boolean` | `isSystemDone(boolean includeRedraws)` Returns whether the loaded page is in a consistent state with no pending operations.
    `static void` | `setTestRoot(Canvas canvas)` Sets the implicit root canvas available in scLocators starting "//testRoot[]".

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### AutoTest

          public AutoTest()

  - ### Method Detail

    - #### isSystemDone

          public static boolean isSystemDone(boolean includeRedraws)

      Returns whether the loaded page is in a consistent state with no pending operations. Specifically, returns true of false according as the conditions below are all satisfied:
      - page has finished loading
      - all ListGrids (as defined by isc.isA.ListGrid) satisfy isGridDone()
      - all TileGrids that are drawn satisfy isTileGridDone()
      - all Canvii that are drawn satisfy isCanvasDone()
      - no network operations are outstanding (configurable, see `implicitNetworkWait`)
      - there are no pending Canvas redraws (if includeRedraws parameter is true)
      Note: In a situation where messaging is being used to periodically refresh components, or if the application contains a label updated every second to show the current time, it's possible that this call might always return false if includeRedraws is true.
      Parameters:
        `includeRedraws` - whether to check for pending Canvas redraws
      Returns:
        whether loaded page is 'done' as described above

    - #### setTestRoot

          public static void setTestRoot(Canvas canvas)

      Sets the implicit root canvas available in scLocators starting "//testRoot[]". Setting this property may enable one to use the same script to test identical widget hierarchies that are rooted under different base widgets.
      Parameters:
        `canvas` - the implicit root

    - #### getTestRoot

          public static Canvas getTestRoot()

      Gets the implicit root canvas available in scLocators starting "//testRoot[]". Setting this property may enable one to use the same script to test identical widget hierarchies that are rooted under different base widgets.
      Returns:
        the canvas currently set as the test root

    - #### isGridDone

          public static boolean isGridDone(Canvas grid)

      Returns whether the supplied ListGrid is in a consistent state with no pending operations. Returns null if the supplied canvas isn't a valid ListGrid and isn't contained in a valid ListGrid. Otherwise, returns true or false according as associated ListGrid meets all the conditions below
      - no pending filter editor operations
      - no unsaved edits to the grid records
      - no outstanding fetch/filter operations are present for the ResultSet
      - no outstanding sort operations are present that will update the ListGrid
      Parameters:
        `grid` - canvas to test
      Returns:
        whether grid is 'done' as described above