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 java.lang.Boolean` | `isCanvasDone(Canvas canvas)` Returns whether the canvas is in a consistent state with no pending operations.
    `static java.lang.Boolean` | `isElementClickable(Canvas canvas)` Returns whether the instance is ready to be clicked on by a Selenium test.
    `static java.lang.Boolean` | `isElementClickable(FormItem item)` Returns whether the instance is ready to be clicked on by a Selenium test.
    `static java.lang.Boolean` | `isGridDone(Canvas canvas)` Returns whether the ListGrid supplied or containing the supplied canvas 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 java.lang.Boolean` | `isTileGridDone(Canvas canvas)` Returns whether the TileGrid is in a consistent state with no pending operations.
    `static java.lang.Boolean` | `isTileLayoutDone(Canvas canvas)` Returns whether the TileLayout 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

    - #### isCanvasDone

          public static java.lang.Boolean isCanvasDone(Canvas canvas)

      Returns whether the canvas is in a consistent state with no pending operations. Returns null if the supplied argument is not a valid canvas. Otherwise, returns true or false according as the conditions below are all satisfied:
      - page has finished loading
      - canvas is drawn
      - canvas isn't dirty
      - canvas has no queued overflow operations
      - canvas is not animating
      Parameters:
        `canvas` - canvas to test
      Returns:
        whether canvas is 'done' as described above

    - #### isElementClickable

          public static java.lang.Boolean isElementClickable(Canvas canvas)

      Returns whether the instance is ready to be clicked on by a Selenium test. Returns null if the supplied instance is not a valid canvas or form item. Otherwise, returns true or false according as the conditions below are all satisfied:
      - page has finished loading
      - no network operations are outstanding (configurable, see `implicitNetworkWait`)
      - canvas is visible, enabled, and not masked,
      - canvas satisfies isCanvasDone()
      - if canvas is a TileGrid, it satisfies isTileGridDone()
      - if canvas is a TileLayout, it satisfies isTileLayoutDone()
      - if canvas is a ListGrid or body of a ListGrid, it satisfies isGridDone()
      Note that for a form item in a DynamicForm, the DynamicForm must satisfy the third condition above, while the container widget of the element must satisfy the remaining conditions.
      Parameters:
        `canvas` - instance to test
      Returns:
        whether instance is 'clickable' as described above

    - #### isElementClickable

          public static java.lang.Boolean isElementClickable(FormItem item)

      Returns whether the instance is ready to be clicked on by a Selenium test. Returns null if the supplied instance is not a valid canvas or form item. Otherwise, returns true or false according as the conditions below are all satisfied:
      - page has finished loading
      - no network operations are outstanding (configurable, see `implicitNetworkWait`)
      - canvas is visible, enabled, and not masked,
      - canvas satisfies isCanvasDone()
      - if canvas is a TileGrid, it satisfies isTileGridDone()
      - if canvas is a TileLayout, it satisfies isTileLayoutDone()
      - if canvas is a ListGrid or body of a ListGrid, it satisfies isGridDone()
      Note that for a form item in a DynamicForm, the DynamicForm must satisfy the third condition above, while the container widget of the element must satisfy the remaining conditions.
      Parameters:
        `item` - instance to test
      Returns:
        whether instance is 'clickable' as described above

    - #### isGridDone

          public static java.lang.Boolean isGridDone(Canvas canvas)

      Returns whether the ListGrid supplied or containing the supplied canvas is in a consistent state with no pending operations. Returns null if the supplied canvas is not a ListGrid or contained in a ListGrid. Otherwise, returns true or false according as the conditions below are all satisfied:
      - page has finished loading
      - no pending scroll operations
      - no pending filter editor operations
      - no unsaved edits to the grid records
      - no asynchronous regrouping operations are in progress
      - no outstanding fetch/filter operations are present for the ResultSet
      - no outstanding sort operations are present that will update the ListGrid
      Parameters:
        `canvas` - canvas to test
      Returns:
        whether canvas is 'done' as described above

    - #### 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 TileLayouts that are drawn satisfy isTileLayoutDone()
      - 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

    - #### isTileGridDone

          public static java.lang.Boolean isTileGridDone(Canvas canvas)

      Returns whether the TileGrid is in a consistent state with no pending operations. Returns null if the supplied canvas is not a valid TileGrid. Otherwise, returns true or false according as the conditions below are all satisfied:
      - page has finished loading
      - the TileGrid (as a tileLayout) satisfies autoTest.isTileLayoutDone()
      - the TileGrid has no pending layout animation operations queued
      Parameters:
        `canvas` - TileGrid to test
      Returns:
        whether TileGrid is 'done' as described above

    - #### isTileLayoutDone

          public static java.lang.Boolean isTileLayoutDone(Canvas canvas)

      Returns whether the TileLayout is in a consistent state with no pending operations. Returns null if the supplied canvas is not a valid TileLayout. Otherwise, returns true or false according as the conditions below are all satisfied:
      - page has finished loading
      - the TileLayout (as a canvas) satisfies autoTest.isCanvasDone()
      - the TileLayout is not currently animating any layout operations
      Parameters:
        `canvas` - TileLayout to test
      Returns:
        whether TileLayout 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