org.zkoss.ztl
Class ZKClientTestCase

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.zkoss.ztl.ZKSeleneseTestCase
              extended by org.zkoss.ztl.ZKTestCase
                  extended by org.zkoss.ztl.ZKClientTestCase
All Implemented Interfaces:
com.thoughtworks.selenium.Selenium, junit.framework.Test
Direct Known Subclasses:
ZKParallelClientTestCase

public class ZKClientTestCase
extends ZKTestCase

A skeleton of ZK client widget.

Author:
jumperchen

Field Summary
protected  int _timeout
           
 
Fields inherited from class org.zkoss.ztl.ZKTestCase
_selenium, A, ALT, BACKSPACE, browsers, C, caseID, CTRL, DELETE, DELETE_NATIVE, DOWN, END, ENTER, ESC, HOME, INSERT, LEFT, NUM_0, NUM_1, NUM_2, NUM_3, NUM_4, NUM_5, NUM_6, NUM_7, NUM_8, NUM_9, PAGE_DOWN, PAGE_UP, recordCount, RIGHT, SHIFT, TAB, target, UP, V, X
 
Fields inherited from class org.zkoss.ztl.ZKSeleneseTestCase
selenium, timeUUID
 
Constructor Summary
ZKClientTestCase()
           
 
Method Summary
 void addSelection(ClientWidget locator, java.lang.String optionLocator)
           
 void assignId(ClientWidget locator, java.lang.String identifier)
           
 void blur(ClientWidget locator)
           
 void check(ClientWidget locator)
           
 void click(ClientWidget locator)
           
 void clickAlert()
           
 void clickAt(ClientWidget locator, java.lang.String coordString)
           
 void closeErrorBox()
          Close the errorbox for webdriver
 void contextMenu(ClientWidget locator)
           
 void contextMenuAt(ClientWidget locator, java.lang.String coordString)
           
 void doScroll(ClientWidget locatorOfObjectToBeDragged, ClientWidget locatorOfDragDestinationObject, java.lang.String from, java.lang.String to)
           
 void doubleClick(ClientWidget locator)
           
 void doubleClickAt(ClientWidget locator, java.lang.String coordString)
           
 void doubleTap(ClientWidget locator)
          Performs a double tap on the element found by locator, analogous to double click using a mouse
 void dragAndDrop(ClientWidget locator, java.lang.String movementsString)
           
 void dragAndDropToObject(ClientWidget locatorOfObjectToBeDragged, ClientWidget locatorOfDragDestinationObject)
           
 void dragdrop(ClientWidget locator, java.lang.String movementsString)
           
 void dragdropTo(ClientWidget locatorOfObjectToBeDragged, java.lang.String from, java.lang.String to)
           
 void dragdropToObject(ClientWidget locatorOfObjectToBeDragged, ClientWidget locatorOfDragDestinationObject, java.lang.String from, java.lang.String to)
           
 void ensureLandscape()
          Ensures the device is in landscape orientation
 void ensurePortrait()
          Ensures the device is in portrait orientation
 void fakeClick(ClientWidget locator)
           
 void fireEvent(ClientWidget locator, java.lang.String eventName)
           
 void focus(ClientWidget locator)
           
 void frozenScroll(ClientWidget locator, int num)
           
 java.lang.String getAlertMessage()
          a shortcut for getting alert message.
 java.lang.String getAttribute(ClientWidget attributeLocator)
           
 java.lang.Number getCursorPosition(ClientWidget locator)
           
 java.lang.Number getElementHeight(ClientWidget locator)
           
 java.lang.Number getElementIndex(ClientWidget locator)
           
 java.lang.Number getElementPositionLeft(ClientWidget locator)
           
 java.lang.Number getElementPositionTop(ClientWidget locator)
           
 java.lang.Number getElementWidth(ClientWidget locator)
           
 java.lang.String getOrientation()
          Returns the current device orientation
 int getScrollLeft(Widget widget)
           
 int getScrollTop(Widget widget)
           
 java.lang.String getSelectedId(ClientWidget selectLocator)
           
 java.lang.String[] getSelectedIds(ClientWidget selectLocator)
           
 java.lang.String getSelectedIndex(ClientWidget selectLocator)
           
 java.lang.String[] getSelectedIndexes(ClientWidget selectLocator)
           
 java.lang.String getSelectedLabel(ClientWidget selectLocator)
           
 java.lang.String[] getSelectedLabels(ClientWidget selectLocator)
           
 java.lang.String getSelectedValue(ClientWidget selectLocator)
           
 java.lang.String[] getSelectedValues(ClientWidget selectLocator)
           
 java.lang.String[] getSelectOptions(ClientWidget selectLocator)
           
 java.lang.String getTable(ClientWidget tableCellAddress)
           
 java.lang.String getText(ClientWidget locator)
           
 java.lang.String getValue(ClientWidget locator)
           
 java.lang.String getZKLog()
          a shortcut to get the value in zk.log textarea
protected  boolean hasError()
          Returns boolean to indicate if there is any js error or erro window
 boolean hasHScrollbar(ClientWidget locator)
          detect if it has a horizontal scroll bar
 boolean hasNativeScroll(ClientWidget locator)
           
 boolean hasVScrollbar(ClientWidget locator)
          detect if it has a vertical scroll bar
 void highlight(ClientWidget locator)
           
 void horScroll(ClientWidget locator, double percent)
           
 void horScrollNoBody(ClientWidget locator, double percent)
          In a case that widget only has 'cave' but 'body', we will calculate sum of all children's width of cave, and move widget's scrollbar
 boolean isChecked(ClientWidget locator)
           
 boolean isEditable(ClientWidget locator)
           
 boolean isElementPresent(ClientWidget locator)
           
 boolean isOrdered(ClientWidget locator1, ClientWidget locator2)
           
 boolean isSomethingSelected(ClientWidget selectLocator)
           
 boolean isTextPresent(java.lang.String pattern)
           
 boolean isVisible(ClientWidget locator)
           
protected  JQuery jq(ClientWidget el)
          Returns the Jquery object of the ZKClientObject.
protected  JQuery jq(java.lang.String selector)
          Returns the Jquery object of the selector Default: without "#" sign
 void keyDown(ClientWidget locator, java.lang.String keySequence)
           
 void keyPress(ClientWidget locator, java.lang.String keySequence)
          2010/10/29 TonyQ:note: when typing number in chrome , it failed
 void keyPressEnter(ClientWidget locator)
           2010/10/27 TonyQ: because there exist a lot of problem to press enter for ENTER key , so we build the method for it.
 void keyUp(ClientWidget locator, java.lang.String keySequence)
           
 void longPress(ClientWidget locator)
          Performs a long press gesture on the element found by locator
 void mouseDown(ClientWidget locator)
           
 void mouseDownAt(ClientWidget locator, java.lang.String coordString)
           
 void mouseDownRight(ClientWidget locator)
           
 void mouseDownRightAt(ClientWidget locator, java.lang.String coordString)
           
 void mouseMove(ClientWidget locator)
           
 void mouseMoveAt(ClientWidget locator, java.lang.String coordString)
           
 void mouseOut(ClientWidget locator)
           
 void mouseOver(org.openqa.selenium.By locator)
           
 void mouseUp(ClientWidget locator)
           
 void mouseUpAt(ClientWidget locator, java.lang.String coordString)
           
 void mouseUpRight(ClientWidget locator)
           
 void mouseUpRightAt(ClientWidget locator, java.lang.String coordString)
           
 void nativeFrozenScroll(ClientWidget locator, double dist)
           
static int parseInt(java.lang.String number)
          Returns the int value from the given string number.
 void removeAllSelections(ClientWidget locator)
           
protected  void removeChildren(Widget w)
          Remove all of the children of the given widget.
 void removeSelection(ClientWidget locator, java.lang.String optionLocator)
           
 void rollup(ClientWidget rollupName, java.lang.String kwargs)
           
 void rotate()
          Rotate the device
protected  void runZscript(java.lang.String zscript)
           
 void select(ClientWidget selectLocator, int index)
           
 void select(ClientWidget selectLocator, java.lang.String optionLocator)
           
 void selectFrame(ClientWidget locator)
           
 void sendKeys(org.openqa.selenium.By by, java.lang.CharSequence... keysToSend)
          Use this method to simulate typing into an element, which may set its value.
 void setContext(ClientWidget context)
           
 void setCursorPosition(ClientWidget locator, java.lang.String position)
           
 void singleTap(ClientWidget locator)
          Performs a single tap on the element found by locator, analogous to click using a mouse
 void singleTapAt(ClientWidget locator, int xOffset, int yOffset)
          Performs a single tap on the element found by locator tanalogous to click using a mouse The tap position is at an offset position.
 void submit(ClientWidget formLocator)
           
 void swipeDown(ClientWidget locator, int distance)
          Swipe down at the top edge of the element found by locator
 void swipeLeft(ClientWidget locator, int distance)
          Swipe left at the right edge of the element found by locator
 void swipeRight(ClientWidget locator, int distance)
          Swipe right at the left edge of the element found by locator
 void swipeUp(ClientWidget locator, int distance)
          Swipe up at the bottom edge of the element found by locator
 void switchTab()
          Switch to the next tab by sending "CTRL + TAB" to the browser, if current tab is the last tab, will switch to the first tab.
 void type(ClientWidget locator, java.lang.String value)
          Types the value to the locator.
 void typeKeys(ClientWidget locator, java.lang.String value)
          Types the value to the locator.
 void uncheck(ClientWidget locator)
           
 void verifyImage()
          Verify image after waitResponse().
 void verifyImage(Comparator comparator)
          Verifies the image before response has done.
 void verScroll(ClientWidget locator, double percent)
           
 void verScrollNoBody(ClientWidget locator, double percent)
          In a case that widget only has 'cave' but 'body', we will calculate sum of all children's height of cave, and move widget's scrollbar
protected  void waitResponse()
          Waits for Ajax response.
protected  void waitResponse(boolean includingAnimation)
          Waits for Ajax response.
protected  void waitResponse(int timeout)
          Waits for Ajax response according to the timeout attribute.
protected  void waitResponse(int timeout, boolean includingAnimation)
          Waits for Ajax response according to the timeout attribute.
protected  Widget widget(int number)
          Returns the Widget object of the UUID.
protected  Widget widget(JQuery jQuery)
          Returns the Widget object from the JQuery object.
protected  Widget widget(java.lang.String uuid)
          Returns the Widget object of the UUID.
protected  ZK zk(ClientWidget el)
          Returns the ZK object of the ZKClientObject.
protected  ZK zk(java.lang.String selector)
          Returns the ZK object of the selector
 
Methods inherited from class org.zkoss.ztl.ZKTestCase
addCustomRequestHeader, addLocationStrategy, addScript, addSelection, allowNativeXpath, altKeyDown, altKeyUp, answerOnNextPrompt, assignId, attachFile, captureEntirePageScreenshot, captureEntirePageScreenshotToString, captureNetworkTraffic, captureScreenshot, captureScreenshotToString, check, chooseCancelOnNextConfirmation, chooseOkOnNextConfirmation, click, clickAt, close, contextMenu, contextMenuAt, controlKeyDown, controlKeyUp, createCookie, deleteAllVisibleCookies, deleteCookie, deselectPopUp, doubleClick, doubleClickAt, dragAndDrop, dragAndDropToObject, dragdrop, dragdropTo, dragdropToObject, executeScript, findElement, fireEvent, focus, getActions, getAlert, getAllButtons, getAllFields, getAllLinks, getAllWindowIds, getAllWindowNames, getAllWindowTitles, getAttribute, getAttributeFromAllWindows, getBodyText, getBrowsers, getConfirmation, getCookie, getCookieByName, getCssCount, getCurrent, getCursorPosition, getElementHeight, getElementIndex, getElementPositionLeft, getElementPositionTop, getElementWidth, getEval, getExpression, getHtmlSource, getKeyboard, getLocation, getLog, getMouse, getMouseSpeed, getPrompt, getSelectedId, getSelectedIds, getSelectedIndex, getSelectedIndexes, getSelectedLabel, getSelectedLabels, getSelectedValue, getSelectedValues, getSelectOptions, getSpeed, getTable, getText, getTitle, getTouch, getValue, getWebDriver, getWhetherThisFrameMatchFrameExpression, getWhetherThisWindowMatchWindowExpression, getXpathCount, goBack, highlight, ignoreAttributesWithoutValue, isAlertPresent, isAndroid, isChecked, isChrome, isConfirmationPresent, isCookiePresent, isEditable, isElementPresent, isFirefox, isHtmlUnit, isIE, isIPhone, isOpera, isOrdered, isPromptPresent, isSafari, isSomethingSelected, isVisible, keyDown, keyDownNative, keyPress, keyPressNative, keyUp, keyUpNative, metaKeyDown, metaKeyUp, mouseDown, mouseDownAt, mouseDownRight, mouseDownRightAt, mouseMove, mouseMoveAt, mouseOut, mouseOver, mouseUp, mouseUpAt, mouseUpRight, mouseUpRightAt, open, open, openWindow, refresh, removeAllSelections, removeScript, removeSelection, retrieveLastRemoteControlLogs, rollup, runScript, select, selectFrame, selectPopUp, selectWindow, setBrowserLogLevel, setContext, setCursorPosition, setExtensionJs, setMouseSpeed, setSpeed, setTimeout, setUp, shiftKeyDown, shiftKeyUp, showContextualBanner, showContextualBanner, shutDownSeleniumServer, sleep, start, start, start, start, stop, submit, type, typeKeys, uncheck, useXpathLibrary, uuid, verifyContains, verifyEquals, verifyNotContains, waitForCondition, waitForFrameToLoad, waitForPageToLoad, waitForPopUp, windowFocus, windowMaximize, windowResizeTo
 
Methods inherited from class org.zkoss.ztl.ZKSeleneseTestCase
assertEquals, assertEquals, assertEquals, assertEquals, assertNotEquals, assertNotEquals, checkForVerificationErrors, clearVerificationErrors, getText, getTimeUUID, isCaptureScreenShotOnFailure, isCaptureScreetShotOnFailure, join, pause, runBare, runtimeBrowserString, seleniumEquals, seleniumEquals, setCaptureScreenShotOnFailure, setCaptureScreetShotOnFailure, setTestContext, setUp, setUp, tearDown, verifyContains, verifyEquals, verifyEquals, verifyEquals, verifyEquals, verifyEquals, verifyFalse, verifyFalse, verifyNotContains, verifyNotEquals, verifyNotEquals, verifyNotEquals, verifyNotEquals, verifyTolerant, verifyTrue, verifyTrue
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_timeout

protected int _timeout
Constructor Detail

ZKClientTestCase

public ZKClientTestCase()
Method Detail

waitResponse

protected void waitResponse()
Waits for Ajax response. (excluding animation check)

By default the timeout time is specified in config.properties

See Also:
waitResponse(int)

waitResponse

protected void waitResponse(boolean includingAnimation)
Waits for Ajax response.

By default the timeout time is specified in config.properties

Parameters:
includingAnimation - if true, it will include animation check.
Since:
2.0.0
See Also:
waitResponse(int, boolean)

verifyImage

public void verifyImage(Comparator comparator)
Verifies the image before response has done.

Overrides:
verifyImage in class ZKTestCase
Parameters:
comparator - an image comparator.

waitResponse

protected void waitResponse(int timeout,
                            boolean includingAnimation)
Waits for Ajax response according to the timeout attribute.

Parameters:
timeout -
includingAnimation - if true, it will include animation check.
Since:
2.0.0

waitResponse

protected void waitResponse(int timeout)
Waits for Ajax response according to the timeout attribute.(excluding animation check)

Parameters:
timeout - the time. (millisecond).
See Also:
waitResponse(int, boolean)

removeChildren

protected void removeChildren(Widget w)
Remove all of the children of the given widget.(internal use only)


runZscript

protected void runZscript(java.lang.String zscript)

verifyImage

public void verifyImage()
Verify image after waitResponse(). (including animation time)

Overrides:
verifyImage in class ZKTestCase
Since:
2.0.0
See Also:
DefaultComparator

widget

protected Widget widget(int number)
Returns the Widget object of the UUID.

Parameters:
number - the number of the widget ID.
See Also:
ZKTestCase.uuid(int), widget(String)

widget

protected Widget widget(java.lang.String uuid)
Returns the Widget object of the UUID.

Parameters:
uuid - the widget ID.

widget

protected Widget widget(JQuery jQuery)
Returns the Widget object from the JQuery object.

Parameters:
jQuery - the JQuery object.

jq

protected JQuery jq(java.lang.String selector)
Returns the Jquery object of the selector

Default: without "#" sign

Parameters:
selector - the selector

jq

protected JQuery jq(ClientWidget el)
Returns the Jquery object of the ZKClientObject.

Parameters:
el - the ZKClientObject

hasError

protected boolean hasError()
Returns boolean to indicate if there is any js error or erro window

Returns:

zk

protected ZK zk(ClientWidget el)
Returns the ZK object of the ZKClientObject.

Parameters:
el - the ZKClientObject

zk

protected ZK zk(java.lang.String selector)
Returns the ZK object of the selector

Parameters:
selector - the selector of the element

parseInt

public static int parseInt(java.lang.String number)
Returns the int value from the given string number.

Parameters:
number - the string number, if null or empty, 0 is assumed.

addSelection

public void addSelection(ClientWidget locator,
                         java.lang.String optionLocator)

assignId

public void assignId(ClientWidget locator,
                     java.lang.String identifier)

check

public void check(ClientWidget locator)

click

public void click(ClientWidget locator)

fakeClick

public void fakeClick(ClientWidget locator)

closeErrorBox

public void closeErrorBox()
Close the errorbox for webdriver

Since:
2.0.0

clickAt

public void clickAt(ClientWidget locator,
                    java.lang.String coordString)

contextMenu

public void contextMenu(ClientWidget locator)

contextMenuAt

public void contextMenuAt(ClientWidget locator,
                          java.lang.String coordString)

doubleClick

public void doubleClick(ClientWidget locator)

doubleClickAt

public void doubleClickAt(ClientWidget locator,
                          java.lang.String coordString)

dragAndDrop

public void dragAndDrop(ClientWidget locator,
                        java.lang.String movementsString)

dragdropTo

public void dragdropTo(ClientWidget locatorOfObjectToBeDragged,
                       java.lang.String from,
                       java.lang.String to)

dragdropToObject

public void dragdropToObject(ClientWidget locatorOfObjectToBeDragged,
                             ClientWidget locatorOfDragDestinationObject,
                             java.lang.String from,
                             java.lang.String to)

dragAndDropToObject

public void dragAndDropToObject(ClientWidget locatorOfObjectToBeDragged,
                                ClientWidget locatorOfDragDestinationObject)

dragdrop

public void dragdrop(ClientWidget locator,
                     java.lang.String movementsString)

fireEvent

public void fireEvent(ClientWidget locator,
                      java.lang.String eventName)

focus

public void focus(ClientWidget locator)
Parameters:
locator -

blur

public void blur(ClientWidget locator)
Parameters:
locator -

getAttribute

public java.lang.String getAttribute(ClientWidget attributeLocator)

getCursorPosition

public java.lang.Number getCursorPosition(ClientWidget locator)

getElementHeight

public java.lang.Number getElementHeight(ClientWidget locator)

getElementIndex

public java.lang.Number getElementIndex(ClientWidget locator)

getElementPositionLeft

public java.lang.Number getElementPositionLeft(ClientWidget locator)

getElementPositionTop

public java.lang.Number getElementPositionTop(ClientWidget locator)

getElementWidth

public java.lang.Number getElementWidth(ClientWidget locator)

getSelectOptions

public java.lang.String[] getSelectOptions(ClientWidget selectLocator)

getSelectedId

public java.lang.String getSelectedId(ClientWidget selectLocator)

getSelectedIds

public java.lang.String[] getSelectedIds(ClientWidget selectLocator)

getSelectedIndex

public java.lang.String getSelectedIndex(ClientWidget selectLocator)

getSelectedIndexes

public java.lang.String[] getSelectedIndexes(ClientWidget selectLocator)

getSelectedLabel

public java.lang.String getSelectedLabel(ClientWidget selectLocator)

getSelectedLabels

public java.lang.String[] getSelectedLabels(ClientWidget selectLocator)

getSelectedValue

public java.lang.String getSelectedValue(ClientWidget selectLocator)

getSelectedValues

public java.lang.String[] getSelectedValues(ClientWidget selectLocator)

getTable

public java.lang.String getTable(ClientWidget tableCellAddress)

getText

public java.lang.String getText(ClientWidget locator)

getValue

public java.lang.String getValue(ClientWidget locator)

highlight

public void highlight(ClientWidget locator)

isChecked

public boolean isChecked(ClientWidget locator)

isEditable

public boolean isEditable(ClientWidget locator)

isElementPresent

public boolean isElementPresent(ClientWidget locator)

isOrdered

public boolean isOrdered(ClientWidget locator1,
                         ClientWidget locator2)

isSomethingSelected

public boolean isSomethingSelected(ClientWidget selectLocator)

isTextPresent

public boolean isTextPresent(java.lang.String pattern)
Specified by:
isTextPresent in interface com.thoughtworks.selenium.Selenium
Overrides:
isTextPresent in class ZKTestCase

isVisible

public boolean isVisible(ClientWidget locator)

keyDown

public void keyDown(ClientWidget locator,
                    java.lang.String keySequence)

keyPress

public void keyPress(ClientWidget locator,
                     java.lang.String keySequence)
2010/10/29 TonyQ:note: when typing number in chrome , it failed

Parameters:
locator -
keySequence -

sendKeys

public void sendKeys(org.openqa.selenium.By by,
                     java.lang.CharSequence... keysToSend)
Use this method to simulate typing into an element, which may set its value.

Parameters:
by - The locating mechanism to use
keysToSend -
Since:
2.0.0

keyPressEnter

public void keyPressEnter(ClientWidget locator)
 2010/10/27 TonyQ:
 because there exist a lot of problem to press enter for ENTER key ,
 so we build the method for it.

 NOTICE:Because we use the keyPressNative , so you need to
        let computer focus on browser when you run the test case  which use this method,
  or the native key press will NOT work anyway.

 If you want modify this ,please make sure that browser compatibility is ok .
 This is a hard method anyway.

 It is a issue for selenium.


keyUp

public void keyUp(ClientWidget locator,
                  java.lang.String keySequence)

mouseDown

public void mouseDown(ClientWidget locator)

mouseDownAt

public void mouseDownAt(ClientWidget locator,
                        java.lang.String coordString)

mouseDownRight

public void mouseDownRight(ClientWidget locator)

mouseDownRightAt

public void mouseDownRightAt(ClientWidget locator,
                             java.lang.String coordString)

mouseMove

public void mouseMove(ClientWidget locator)

mouseMoveAt

public void mouseMoveAt(ClientWidget locator,
                        java.lang.String coordString)

mouseOut

public void mouseOut(ClientWidget locator)

mouseOver

public void mouseOver(org.openqa.selenium.By locator)

mouseUp

public void mouseUp(ClientWidget locator)

mouseUpAt

public void mouseUpAt(ClientWidget locator,
                      java.lang.String coordString)

mouseUpRight

public void mouseUpRight(ClientWidget locator)

mouseUpRightAt

public void mouseUpRightAt(ClientWidget locator,
                           java.lang.String coordString)

removeAllSelections

public void removeAllSelections(ClientWidget locator)

removeSelection

public void removeSelection(ClientWidget locator,
                            java.lang.String optionLocator)

rollup

public void rollup(ClientWidget rollupName,
                   java.lang.String kwargs)

select

public void select(ClientWidget selectLocator,
                   java.lang.String optionLocator)

select

public void select(ClientWidget selectLocator,
                   int index)

selectFrame

public void selectFrame(ClientWidget locator)

setContext

public void setContext(ClientWidget context)

setCursorPosition

public void setCursorPosition(ClientWidget locator,
                              java.lang.String position)

submit

public void submit(ClientWidget formLocator)

frozenScroll

public void frozenScroll(ClientWidget locator,
                         int num)
Parameters:
locator -
num -

nativeFrozenScroll

public void nativeFrozenScroll(ClientWidget locator,
                               double dist)
Parameters:
locator -
percent -

hasNativeScroll

public boolean hasNativeScroll(ClientWidget locator)

verScroll

public void verScroll(ClientWidget locator,
                      double percent)
Parameters:
locator -
percent -

horScroll

public void horScroll(ClientWidget locator,
                      double percent)
Parameters:
locator -
percent -

horScrollNoBody

public void horScrollNoBody(ClientWidget locator,
                            double percent)
In a case that widget only has 'cave' but 'body', we will calculate sum of all children's width of cave, and move widget's scrollbar

Parameters:
locator -
percent -

verScrollNoBody

public void verScrollNoBody(ClientWidget locator,
                            double percent)
In a case that widget only has 'cave' but 'body', we will calculate sum of all children's height of cave, and move widget's scrollbar

Parameters:
locator -
percent -

hasHScrollbar

public boolean hasHScrollbar(ClientWidget locator)
detect if it has a horizontal scroll bar

Parameters:
locator -
Returns:

hasVScrollbar

public boolean hasVScrollbar(ClientWidget locator)
detect if it has a vertical scroll bar

Parameters:
locator -
Returns:

doScroll

public void doScroll(ClientWidget locatorOfObjectToBeDragged,
                     ClientWidget locatorOfDragDestinationObject,
                     java.lang.String from,
                     java.lang.String to)

getScrollTop

public int getScrollTop(Widget widget)

getScrollLeft

public int getScrollLeft(Widget widget)

type

public void type(ClientWidget locator,
                 java.lang.String value)
Types the value to the locator.

The method will call focus() before typing and blur() after typed.


getAlertMessage

public java.lang.String getAlertMessage()
a shortcut for getting alert message. (Take care about the dom class and model will be different when event-thread is enable/disable , so we use title .)

Returns:

getZKLog

public java.lang.String getZKLog()
a shortcut to get the value in zk.log textarea

Returns:

clickAlert

public void clickAlert()

typeKeys

public void typeKeys(ClientWidget locator,
                     java.lang.String value)
Types the value to the locator.

The method will call focus() before typing and blur() after typed.


uncheck

public void uncheck(ClientWidget locator)

singleTap

public void singleTap(ClientWidget locator)
Performs a single tap on the element found by locator, analogous to click using a mouse

Parameters:
locator - an element locator
Since:
2.0.1

singleTapAt

public void singleTapAt(ClientWidget locator,
                        int xOffset,
                        int yOffset)
Performs a single tap on the element found by locator tanalogous to click using a mouse The tap position is at an offset position.

Parameters:
locator - an element locator
xOffset - px toward the right
yOffset - px toward the bottom
Since:
2.0.1

doubleTap

public void doubleTap(ClientWidget locator)
Performs a double tap on the element found by locator, analogous to double click using a mouse

Parameters:
locator - an element locator
Since:
2.0.1

longPress

public void longPress(ClientWidget locator)
Performs a long press gesture on the element found by locator

Parameters:
locator - an element locator
Since:
2.0.1

swipeUp

public void swipeUp(ClientWidget locator,
                    int distance)
Swipe up at the bottom edge of the element found by locator

Parameters:
locator - an element locator
distance - amount to swipe (in device pixel)
Since:
2.0.1

swipeDown

public void swipeDown(ClientWidget locator,
                      int distance)
Swipe down at the top edge of the element found by locator

Parameters:
locator - an element locator
distance - amount to swipe (in device pixel)
Since:
2.0.1

swipeLeft

public void swipeLeft(ClientWidget locator,
                      int distance)
Swipe left at the right edge of the element found by locator

Parameters:
locator - an element locator
distance - amount to swipe (in device pixel)
Since:
2.0.1

swipeRight

public void swipeRight(ClientWidget locator,
                       int distance)
Swipe right at the left edge of the element found by locator

Parameters:
locator - an element locator
distance - amount to swipe (in device pixel)
Since:
2.0.1

getOrientation

public java.lang.String getOrientation()
Returns the current device orientation

Returns:
the current device orientation
Since:
2.0.1

rotate

public void rotate()
Rotate the device

Since:
2.0.1

ensureLandscape

public void ensureLandscape()
Ensures the device is in landscape orientation

Since:
2.0.1

ensurePortrait

public void ensurePortrait()
Ensures the device is in portrait orientation

Since:
2.0.1

switchTab

public void switchTab()
Switch to the next tab by sending "CTRL + TAB" to the browser, if current tab is the last tab, will switch to the first tab.

Will also switch WebDriver's focus to the newly switched tab, so other operations can proceed as normal.



Copyright © 2015. All Rights Reserved.