public class AutoTest
extends java.lang.Object
Constructor and Description |
---|
AutoTest() |
Modifier and Type | Method and Description |
---|---|
static QualityIndicatedLocator |
getLocatorWithIndicators(com.google.gwt.dom.client.Element DOMElement)
Returns the
QualityIndicatedLocator associated with some DOM element in a Smart GWT
application page. |
static QualityIndicatedLocator |
getLocatorWithIndicators(com.google.gwt.dom.client.Element DOMElement,
boolean checkForNativeHandling) |
static QualityIndicatedLocator |
getLocatorWithIndicators(com.google.gwt.dom.client.Element DOMElement,
boolean checkForNativeHandling,
java.lang.String[] coords)
Returns the
QualityIndicatedLocator associated with some DOM element in a Smart GWT
application page. |
static java.lang.String |
getMinimalLocator(com.google.gwt.dom.client.Element DOMElement)
Returns a locator that's optimized to have minimal length while still trying to robustly represent that targeted canvas.
|
static java.lang.String |
getMinimalLocator(com.google.gwt.dom.client.Element DOMElement,
boolean checkForNativeHandling) |
static java.lang.String |
getMinimalLocator(com.google.gwt.dom.client.Element DOMElement,
boolean checkForNativeHandling,
java.lang.String[] coords)
Returns a locator that's optimized to have minimal length while still trying to robustly represent that targeted canvas.
|
static Canvas |
getTestRoot()
Gets the implicit root canvas available in scLocators starting "//testRoot[]".
|
static void |
installLocatorShortcut()
This method allows developers to retrieve locators for elements on the page via a key-combo plus mouseDown on the
element in question.
It may be invoked from a bookmarklet stored in the browser, giving developers a one-click way to retrieve locators for any Smart GWT application |
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 |
isElementReadyForKeyPresses(Canvas canvas)
Given a DOM element, returns whether the associated Smart GWT Canvas or FormItem is ready to receive keyPress events
from a Selenium test.
|
static java.lang.Boolean |
isElementReadyForKeyPresses(FormItem item)
Given a DOM element, returns whether the associated Smart GWT Canvas or FormItem is ready to receive keyPress events
from a Selenium test.
|
static java.lang.Boolean |
isFormDone(Canvas canvas)
Returns whether the DynamicForm is in a consistent state with no pending operations.
|
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 java.lang.Boolean |
isItemDone(FormItem item)
Returns whether the FormItem is in a consistent state with no pending operations.
|
static boolean |
isSystemDone()
Returns whether the loaded page is in a consistent state with no pending operations.
|
static boolean |
isSystemDone(boolean includeRedraws) |
static boolean |
isSystemDone(boolean includeRedraws,
boolean includeEdits)
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 Canvas |
locateCanvasFromDOMElement(com.google.gwt.dom.client.Element element)
Given an element in the DOM, returns the canvas containing this element, or null if the element is not contained in any
canvas handle.
|
static void |
setTestRoot(Canvas canvas)
Sets the implicit root canvas available in scLocators starting "//testRoot[]".
|
static void |
uninstallLocatorShortcut()
Uninstalls the locator shortcut installed by
installLocatorShortcut() |
public static QualityIndicatedLocator getLocatorWithIndicators(com.google.gwt.dom.client.Element DOMElement)
QualityIndicatedLocator
associated with some DOM element in a Smart GWT
application page. If coords, representing the page position, is passed in, the locator may be generated with a specific
trailing "target area" identifer that will map back to the appropriate, potentially different, physical coordinates,
even if the widget is moved. The coords argument will only have an effect in cases where the mouse position over the
target could potentially change behavior.DOMElement
- DOM element within in the page. If null the locator for the last mouse event target will be generatedpublic static QualityIndicatedLocator getLocatorWithIndicators(com.google.gwt.dom.client.Element DOMElement, boolean checkForNativeHandling)
public static QualityIndicatedLocator getLocatorWithIndicators(com.google.gwt.dom.client.Element DOMElement, boolean checkForNativeHandling, java.lang.String[] coords)
QualityIndicatedLocator
associated with some DOM element in a Smart GWT
application page. If coords, representing the page position, is passed in, the locator may be generated with a specific
trailing "target area" identifer that will map back to the appropriate, potentially different, physical coordinates,
even if the widget is moved. The coords argument will only have an effect in cases where the mouse position over the
target could potentially change behavior.DOMElement
- DOM element within in the page. If null the locator for the last mouse event target will be generatedcheckForNativeHandling
- If this parameter is passed in, check whether the target element responds to native browser events directly rather than
going through the Smart GWT widget/event handling model. If we detect this case, return null rather than a live
locator. This allows us to differentiate between (for example) an event on a Canvas handle, and an event occurring
directly on a simple <a href=...>
tag written inside a Canvas handle.coords
- X, Y page positionpublic static java.lang.String getMinimalLocator(com.google.gwt.dom.client.Element DOMElement)
//:
that will search for a widget with the specified ID or defining property (e.g. "title"). A minimal
locator may also contain a second, interior search denoted by //
that searches the hierarchy below the
preceding part of the locator. A minimal locator should be passed to getObject()
, getElement()
, etc., to retrieve the original target.
Note that when searching by defining property, a breadth-first search of the widget hierarchy will be run looking for the first widget of the appropriate framework class with the specified defining property.
DOMElement
- DOM element within in the page. If null the locator for the last mouse event target will be generatedAutoTestLocator
public static java.lang.String getMinimalLocator(com.google.gwt.dom.client.Element DOMElement, boolean checkForNativeHandling)
public static java.lang.String getMinimalLocator(com.google.gwt.dom.client.Element DOMElement, boolean checkForNativeHandling, java.lang.String[] coords)
//:
that will search for a widget with the specified ID or defining property (e.g. "title"). A minimal
locator may also contain a second, interior search denoted by //
that searches the hierarchy below the
preceding part of the locator. A minimal locator should be passed to getObject()
, getElement()
, etc., to retrieve the original target.
Note that when searching by defining property, a breadth-first search of the widget hierarchy will be run looking for the first widget of the appropriate framework class with the specified defining property.
DOMElement
- DOM element within in the page. If null the locator for the last mouse event target will be generatedcheckForNativeHandling
- If this parameter is passed in, check whether the target element responds to native browser events directly rather than
going through the Smart GWT widget/event handling model. If we detect this case, return null rather than a live
locator. This allows us to differentiate between (for example) an event on a Canvas handle, and an event occurring
directly on a simple <a href=...>
tag written inside a Canvas handle.coords
- X, Y page positionAutoTestLocator
public static void installLocatorShortcut()
When installLocatorShortcut() is invoked, it will register a
Page-level mouseDown
handler which, if the Shift+Ctrl or Shift+Meta key-combo are being held down will
display the locator for the element under the mouse in a text-box and also copy it to clipboard.
As with the isc.showConsole()
method, developers may wish to create a bookmark in their browser
to quickly enable this functionality on any Smart GWT application, without any changes to the application code:
To uninstall the locator
shortcut, call uninstallLocatorShortcut()
public static java.lang.Boolean isCanvasDone(Canvas canvas)
canvas
- canvas to testpublic static java.lang.Boolean isElementClickable(Canvas canvas)
implicitNetworkWait
) isCanvasDone()
isTileGridDone()
isTileLayoutDone()
isGridDone()
isFormDone()
canvas
- instance to testpublic static java.lang.Boolean isElementClickable(FormItem item)
implicitNetworkWait
) isCanvasDone()
isTileGridDone()
isTileLayoutDone()
isGridDone()
isFormDone()
item
- instance to testpublic static java.lang.Boolean isElementReadyForKeyPresses(Canvas canvas)
TextItem
, FileItem
, or TextAreaItem
,
it has native focus, isElementClickable()
canvas
- DOM element to test (element obtained from canvas, form item, or Smart GWT locator if provided)public static java.lang.Boolean isElementReadyForKeyPresses(FormItem item)
TextItem
, FileItem
, or TextAreaItem
,
it has native focus, isElementClickable()
item
- DOM element to test (element obtained from canvas, form item, or Smart GWT locator if provided)public static java.lang.Boolean isFormDone(Canvas canvas)
DynamicForm
. Otherwise, returns true or false
according as the conditions below are all satisfied: isItemDone()
canvas
- canvas to testpublic static java.lang.Boolean isGridDone(Canvas canvas)
canvas
- canvas to testpublic static java.lang.Boolean isItemDone(FormItem item)
FormItem
. Otherwise, returns true or false according as
the conditions below are all satisfied: isCanvasDone()
(or isGridDone()
, etc., as appropriate) SelectItem
or
ComboBoxItem
) cannot have any pending row fetches FormItem
s must satisfy isItemDone()
themselves
Canvas
must satisfy isCanvasDone()
(or isGridDone()
, etc., as appropriate) item
- canvas to testpublic static boolean isSystemDone()
isGridDone()
isTileGridDone()
isTileLayoutDone()
isFormDone()
isCanvasDone()
implicitNetworkWait
) public static boolean isSystemDone(boolean includeRedraws)
isSystemDone()
public static boolean isSystemDone(boolean includeRedraws, boolean includeEdits)
isGridDone()
isTileGridDone()
isTileLayoutDone()
isFormDone()
isCanvasDone()
implicitNetworkWait
) includeRedraws
- whether to check for pending Canvas redrawsincludeEdits
- whether to check for unsaved edits for ListGridspublic static java.lang.Boolean isTileGridDone(Canvas canvas)
isTileLayoutDone()
canvas
- TileGrid to testpublic static java.lang.Boolean isTileLayoutDone(Canvas canvas)
isCanvasDone()
canvas
- TileLayout to testpublic static Canvas locateCanvasFromDOMElement(com.google.gwt.dom.client.Element element)
element
- DOM element within in the pagepublic static void setTestRoot(Canvas canvas)
canvas
- the implicit rootpublic static void uninstallLocatorShortcut()
installLocatorShortcut()
public static Canvas getTestRoot()